NEST
2.6.0,not_revisioned_source_dir@0
|
Class Dictionary defines the standard user interface for accessing tokens from dictionaries (see there). More...
Functions | |
template<typename FT > | |
FT | getValue (const DictionaryDatum &d, Name const n) |
Get the value of an existing dictionary entry. More... | |
double | get_double_in_range (const DictionaryDatum &d, Name const n, double min, double max, int mode=2) |
Get the value of an existing dictionary entry and check that it is in a specified range. More... | |
long | get_long_in_range (const DictionaryDatum &d, Name const n, long min, long max, int mode=2) |
Get the value of an existing dictionary entry and check that it is in a specified range. More... | |
template<typename FT , class D > | |
void | def2 (DictionaryDatum &d, Name const n, FT const &value) |
Define a new dictionary entry from a fundamental type. More... | |
template<typename FT > | |
void | def (DictionaryDatum &d, Name const n, FT const &value) |
Define a new dictionary entry from a fundamental type. More... | |
template<typename FT , typename VT > | |
bool | updateValue (DictionaryDatum const &d, Name const n, VT &value) |
Update a variable from a dictionary entry if it exists, skip call if it doesn't. More... | |
template<typename FT , typename VT , class C > | |
void | updateValue2 (DictionaryDatum const &d, Name const n, C &obj, void(C::*setfunc)(VT)) |
Call a member function of an object, passing the value of an dictionary entry if it exists, skip call if it doesn't. More... | |
void | initialize_property_array (DictionaryDatum &d, Name propname) |
Create a property of type ArrayDatum in the dictionary, if it does not already exist. More... | |
void | initialize_property_doublevector (DictionaryDatum &d, Name propname) |
Create a property of type DoubleVectorDatum in the dictionary, if it does not already exist. More... | |
void | initialize_property_intvector (DictionaryDatum &d, Name propname) |
Create a property of type IntVectorDatum in the dictionary, if it does not already exist. More... | |
template<typename PropT > | |
void | append_property (DictionaryDatum &d, Name propname, const PropT &prop) |
Append a value to a property ArrayDatum in the dictionary. More... | |
template<> | |
void | append_property< std::vector< double > > (DictionaryDatum &d, Name propname, const std::vector< double > &prop) |
Append a value to a property DoubleVectorDatum in the dictionary. More... | |
template<> | |
void | append_property< std::vector< long > > (DictionaryDatum &d, Name propname, const std::vector< long > &prop) |
Append a value to a property IntVectorDatum in the dictionary. More... | |
void | provide_property (DictionaryDatum &, Name, const std::vector< double > &) |
Provide a value to a property DoubleVectorDatum in the dictionary. More... | |
void | provide_property (DictionaryDatum &, Name, const std::vector< long > &) |
Provide a value to a property IntVectorDatum in the dictionary. More... | |
void | accumulate_property (DictionaryDatum &, Name, const std::vector< double > &) |
Add values of a vector<double> to a property DoubleVectorDatum in the dictionary. More... | |
Class Dictionary defines the standard user interface for accessing tokens from dictionaries (see there).
However, this user interface returns tokens, from which the actual value would still need to be extracted. The utilitiy functions described in this group shortcut this step and provide direct access to the underlying fundamental values associated to a dictionary entry.
void accumulate_property | ( | DictionaryDatum & | , |
Name | , | ||
const std::vector< double > & | |||
) |
Add values of a vector<double> to a property DoubleVectorDatum in the dictionary.
This variant of append_property is for adding vector<double>s to vector<double>s of the same size. It is required for collecting data across threads when multimeter is running in accumulation mode.
References assert(), and Token::datum().
Referenced by nest::Multimeter::add_data_().
|
inline |
Append a value to a property ArrayDatum in the dictionary.
This is the version for scalar values
References assert(), Token::datum(), and Token::empty().
Referenced by nest::Multimeter::add_data_(), nest::RecordingDevice::Parameters_::get(), and nest::RecordingDevice::State_::get().
|
inline |
Append a value to a property DoubleVectorDatum in the dictionary.
This is a specialization for appending vector<double>s to vector<double>s
References assert(), Token::datum(), and Token::empty().
|
inline |
Append a value to a property IntVectorDatum in the dictionary.
This is a specialization for appending vector<long>s to vector<long>s
References assert(), Token::datum(), and Token::empty().
void def | ( | DictionaryDatum & | d, |
Name const | n, | ||
FT const & | value | ||
) |
Define a new dictionary entry from a fundamental type.
TypeMismatch | Creating a Token from the fundamental type failed, probably due to a missing template specialization. |
Referenced by nest::Layer< D >::dump_connections().
void def2 | ( | DictionaryDatum & | d, |
Name const | n, | ||
FT const & | value | ||
) |
Define a new dictionary entry from a fundamental type.
TypeMismatch | Fundamental type and requested SLI type are incompatible. |
|
inline |
Get the value of an existing dictionary entry and check that it is in a specified range.
The range is specified by two parameters min and max which have the same type as the template argument. The last parameter mode defines the type of the range:
0 min < x < max 1 min <= x < max 2 min <= x <= max
UnknownName | An entry of the given name is not known in the dictionary. |
RangeCheck | if a value is outside the range |
References Token::datum(), GenericDatum< D, slt >::get(), and nest::names::x.
|
inline |
Get the value of an existing dictionary entry and check that it is in a specified range.
The range is specified by two parameters min and max which have the same type as the template argument. The last parameter mode defines the type of the range:
0 min < x < max 1 min <= x < max 2 min <= x <= max
UnknownName | An entry of the given name is not known in the dictionary. |
RangeCheck | if a value is outside the range |
References Token::datum(), GenericDatum< D, slt >::get(), and nest::names::x.
FT getValue | ( | const DictionaryDatum & | d, |
Name const | n | ||
) |
Get the value of an existing dictionary entry.
UnknownName | An entry of the given name is not known in the dictionary. |
Referenced by nest::create_doughnut(), SLIArrayModule::Array2IntVectorFunction::execute(), and SLIArrayModule::Array2DoubleVectorFunction::execute().
void initialize_property_array | ( | DictionaryDatum & | d, |
Name | propname | ||
) |
Create a property of type ArrayDatum in the dictionary, if it does not already exist.
References nest::names::d, and Token::empty().
Referenced by nest::RecordingDevice::Parameters_::get().
void initialize_property_doublevector | ( | DictionaryDatum & | d, |
Name | propname | ||
) |
Create a property of type DoubleVectorDatum in the dictionary, if it does not already exist.
References nest::names::d, and Token::empty().
Referenced by nest::Multimeter::add_data_(), and nest::RecordingDevice::State_::get().
void initialize_property_intvector | ( | DictionaryDatum & | d, |
Name | propname | ||
) |
Create a property of type IntVectorDatum in the dictionary, if it does not already exist.
References nest::names::d, and Token::empty().
Referenced by nest::RecordingDevice::State_::get().
void provide_property | ( | DictionaryDatum & | , |
Name | , | ||
const std::vector< double > & | |||
) |
Provide a value to a property DoubleVectorDatum in the dictionary.
In contrast to append_property, this function adds the value only once to the property. On all subsequent events, it ensures that the value passed in is identical to the value present. This is needed by recording_decive.
References assert(), and Token::datum().
Referenced by nest::RecordingDevice::State_::get().
void provide_property | ( | DictionaryDatum & | , |
Name | , | ||
const std::vector< long > & | |||
) |
Provide a value to a property IntVectorDatum in the dictionary.
In contrast to append_property, this function adds the value only once to the property. On all subsequent events, it ensures that the value passed in is identical to the value present. This is needed by recording_decive.
References assert(), and Token::datum().
bool updateValue | ( | DictionaryDatum const & | d, |
Name const | n, | ||
VT & | value | ||
) |
Update a variable from a dictionary entry if it exists, skip call if it doesn't.
see | getValue(DictionaryDatum, Name) |
References Token::empty().
Referenced by nest::pulsepacket_generator::Parameters_::set(), nest::iaf_psc_exp_multisynapse::Parameters_::set(), nest::iaf_psc_alpha_multisynapse::Parameters_::set(), nest::aeif_cond_alpha_multisynapse::Parameters_::set(), and nest::correlation_detector::State_::set().
void updateValue2 | ( | DictionaryDatum const & | d, |
Name const | n, | ||
C & | obj, | ||
void(C::*)(VT) | setfunc | ||
) |
Call a member function of an object, passing the value of an dictionary entry if it exists, skip call if it doesn't.
see | getValue(DictionaryDatum, Name) |