Description Format¶
Arbor provides readers and writers for describing label dictionaries, decoration objects, morphologies and cable cells, referred to here as arbor-components.
A detailed description of the s-expression format used to describe each of these components can be found here.
Reading and writing of the arbor-component description format is delegated to the arborio
library and the responsible classes and functions are present in the arborio namespace.
The arbor-components and meta-data¶
-
using
cable_cell_variant= std::variant<arb::morphology, arb::label_dict, arb::decor, arb::cable_cell>¶
-
template<typename
T>
usingparse_hopefully= arb::util::expected<T, cableio_parse_error>¶ arborio::cableio_parse_erroris derived fromarb::arbor_exceptionwhich in turn is derived fromstd::runtime_error. It contains information about thelineandpositionof an encountered error in a document.arb::util::expectedcontains either an object of typeTor an error object.
-
class
cable_cell_component¶ -
-
cable_cell_variant
component¶ Stores one of
decor,label_dict,morphologyorcable_cell.
-
cable_cell_variant
Reading arbor-components¶
-
parse_hopefully<cable_cell_component>
parse_component(const std::string&)¶ This function will attempt to construct a
cable_cell_componentobject by parsing the contents of a string. It will return aparse_hopefullycontaining the constructed object, or, if parsing fails, a helpfulcableio_parse_error.
-
parse_hopefully<cable_cell_component>
parse_component(std::istream&)¶ Performs the same functionality as
parse_componentabove, but starting fromstd::istream.
Writing arbor-components¶
-
std::ostream &
write_component(std::ostream&, const cable_cell_component&)¶ Writes the
cable_cell_componentobject to the givenstd::ostream.
-
std::ostream &
write_component(std::ostream &o, const arb::decor &x, const meta_data &m = {})¶ Constructs a
cable_cell_componentfrom adecorobject, and optionalmeta_data. If no meta_data is provided, the most recent version of the format is used to create it. The resulting object is written to the givenstd::ostream.
-
std::ostream &
write_component(std::ostream &o, const arb::label_dict &x, const meta_data &m = {})¶ Constructs a
cable_cell_componentfrom alabel_dictobject, and optionalmeta_data. If no meta_data is provided, the most recent version of the format is used to create it. The resulting object is written to the givenstd::ostream.
-
std::ostream &
write_component(std::ostream &o, const arb::morphology &x, const meta_data &m = {})¶ Constructs a
cable_cell_componentfrom amorphologyobject, and optionalmeta_data. If no meta_data is provided, the most recent version of the format is used to create it. The resulting object is written to the givenstd::ostream.
-
std::ostream &
write_component(std::ostream &o, const arb::cable_cell &x, const meta_data &m = {})¶ Constructs a
cable_cell_componentfrom acable_cellobject, and optionalmeta_data. If no meta_data is provided, the most recent version of the format is used to create it. The resulting object is written to the givenstd::ostream.