Common Types

Cell Identifiers and Indexes

These types, defined in common_types.hpp, are used as identifiers for cells and members of cell-local collections.

Note

Arbor uses std::unit32_t for cell_gid_type, cell_size_type, cell_lid_type, and cell_local_size_type at the time of writing, however this could change, e.g. to handle models that cell gid that don’t fit into a 32 bit unsigned integer. It is thus recommended that these type aliases be used whenever identifying or counting cells and cell members.

type cell_gid_type

An integer type used for identifying cells globally.

type cell_size_type

An unsigned integer for sizes of collections of cells. Unsigned type for counting cell_gid_type.

type cell_lid_type

For indexes into cell-local data. Local indices for items within a particular cell-local collection should be zero-based and numbered contiguously.

type cell_local_size_type

An unsigned integer for for counts of cell-local data.

class cell_member_type

For global identification of an item of cell local data. Items of cell_member_type must:

  • be associated with a unique cell, identified by the member gid;
  • identify an item within a cell-local collection by the member index.

An example is uniquely identifying a synapse in the model. Each synapse has a post-synaptic cell (gid), and an index (index) into the set of synapses on the post-synaptic cell.

Lexicographically ordered by gid, then index.

cell_gid_type gid

Global identifier of the cell containing/associated with the item.

cell_lid_type index

The index of the item in a cell-local collection.

enum class cell_kind

Enumeration used to identify the cell type/kind, used by the model to group equal kinds in the same cell group.

enumerator cable

A cell with morphology described by branching 1D cable segments.

enumerator lif

Leaky-integrate and fire neuron.

enumerator spike_source

Proxy cell that generates spikes from a spike sequence provided by the user.

enumerator benchmark

Proxy cell used for benchmarking.

Probes

using probe_tag = int

Extra contextual information associated with a probe.

class probe_info

Probes are specified in the recipe objects that are used to initialize a model; the specification of the item or value that is subjected to a probe will be specific to a particular cell type.

cell_member_type id

Cell gid, index of probe.

probe_tag tag

Opaque key, returned in sample record.

util::any address

Cell-type specific location info, specific to cell kind of id.gid.

Utility Wrappers and Containers

template<typename T>
class optional

A wrapper around a contained value of type T, that may or may not be set. A faithful copy of the C++17 std::optional type. See the online C++ standard documentation https://en.cppreference.com/w/cpp/utility/optional for more information.

class any

A container for a single value of any type that is copy constructable. Used in the Arbor API where a type of a value passed to or from the API is decided at run time.

A faithful copy of the C++17 std::any type. See the online C++ standard documentation https://en.cppreference.com/w/cpp/utility/any for more information.

The arb::util namespace also implementations of the any_cast, make_any and bad_any_cast helper functions and types from C++17.

class unique_any

Equivalent to util::any, except that:

  • it can store any type that is move constructable;
  • it is move only, that is it can’t be copied.