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_error
is derived fromarb::arbor_exception
which in turn is derived fromstd::runtime_error
. It contains information about theline
andposition
of an encountered error in a document.arb::util::expected
contains either an object of typeT
or an error object.
-
class
cable_cell_component
¶ -
-
cable_cell_variant
component
¶ Stores one of
decor
,label_dict
,morphology
orcable_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_component
object by parsing the contents of a string. It will return aparse_hopefully
containing 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_component
above, but starting fromstd::istream
.
Writing arbor-components¶
-
std::ostream &
write_component
(std::ostream&, const cable_cell_component&)¶ Writes the
cable_cell_component
object to the givenstd::ostream
.
-
std::ostream &
write_component
(std::ostream &o, const arb::decor &x, const meta_data &m = {})¶ Constructs a
cable_cell_component
from adecor
object, 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_component
from alabel_dict
object, 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_component
from amorphology
object, 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_component
from acable_cell
object, 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
.