Cantera 2.6.0
Public Member Functions | Private Types | Private Member Functions | Static Private Member Functions | Private Attributes | Friends | List of all members
AnyValue Class Reference

A wrapper for a variable whose type is determined at runtime. More...

#include <AnyMap.h>

Inheritance diagram for AnyValue:
[legend]
Collaboration diagram for AnyValue:
[legend]

Public Member Functions

 AnyValue (AnyValue const &other)
 
 AnyValue (AnyValue &&other)
 
AnyValueoperator= (AnyValue const &other)
 
AnyValueoperator= (AnyValue &&other)
 
bool operator== (const AnyValue &other) const
 
bool operator!= (const AnyValue &other) const
 
AnyValueoperator[] (const std::string &key)
 If this AnyValue is an AnyMap, return the value stored in key. More...
 
const AnyValueoperator[] (const std::string &key) const
 
bool hasKey (const std::string &key) const
 Returns true if this AnyValue is an AnyMap and that map contains a key with the given name. More...
 
void setKey (const std::string &key)
 Set the name of the key storing this value in an AnyMap. More...
 
void propagateMetadata (shared_ptr< AnyMap > &file)
 Propagate metadata to any child elements. More...
 
template<class T >
const T & as () const
 Get the value of this key as the specified type. More...
 
template<class T >
T & as ()
 
const std::type_info & type () const
 Returns the type of the held value. More...
 
std::string type_str () const
 Returns a string specifying the type of the held value. More...
 
bool empty () const
 Return boolean indicating whether AnyValue is empty. More...
 
template<class T >
bool is () const
 Returns true if the held value is of the specified type. More...
 
bool isScalar () const
 Returns true if the held value is a scalar type (such as double, long int, string, or bool). More...
 
 AnyValue (const std::string &value)
 
 AnyValue (const char *value)
 
AnyValueoperator= (const std::string &value)
 
AnyValueoperator= (const char *value)
 
const std::string & asString () const
 Return the held value, if it is a string. More...
 
bool operator== (const std::string &other) const
 
bool operator!= (const std::string &other) const
 
 AnyValue (double value)
 
AnyValueoperator= (double value)
 
double & asDouble ()
 Return the held value as a double, if it is a double or a long int. More...
 
const double & asDouble () const
 
bool operator== (const double &other) const
 
bool operator!= (const double &other) const
 
 AnyValue (bool value)
 
AnyValueoperator= (bool value)
 
bool & asBool ()
 Return the held value, if it is a bool. More...
 
const bool & asBool () const
 
 AnyValue (long int value)
 
 AnyValue (int value)
 
AnyValueoperator= (long int value)
 
AnyValueoperator= (int value)
 
long int & asInt ()
 Return the held value, if it is a long int. More...
 
const long int & asInt () const
 
bool operator== (const long int &other) const
 
bool operator!= (const long int &other) const
 
bool operator== (const int &other) const
 
bool operator!= (const int &other) const
 
template<class T >
AnyValueoperator= (const std::vector< T > &value)
 
template<class T >
const std::vector< T > & asVector (size_t nMin=npos, size_t nMax=npos) const
 Return the held value, if it is a vector of type T. More...
 
template<class T >
std::vector< T > & asVector (size_t nMin=npos, size_t nMax=npos)
 
 AnyValue (const AnyMap &value)
 
AnyValueoperator= (const AnyMap &value)
 
AnyValueoperator= (AnyMap &&value)
 
template<class T >
AnyValueoperator= (const std::unordered_map< std::string, T > items)
 
template<class T >
AnyValueoperator= (const std::map< std::string, T > items)
 
template<class T >
std::map< std::string, T > asMap () const
 Return the held AnyMap as a std::map where all of the values have the specified type. More...
 
std::unordered_map< std::string, const AnyMap * > asMap (const std::string &name) const
 Access a vector<AnyMap> as a mapping using the value of name from each item as the key in the new mapping. More...
 
std::unordered_map< std::string, AnyMap * > asMap (const std::string &name)
 
AnyMapgetMapWhere (const std::string &key, const std::string &value, bool create=false)
 Treating the value as vector<AnyMap>, return the item where the given key has the specified value. More...
 
const AnyMapgetMapWhere (const std::string &key, const std::string &value) const
 
bool hasMapWhere (const std::string &key, const std::string &value) const
 Returns true when getMapWhere() would succeed. More...
 
std::pair< int, int > order () const
 Return values used to determine the sort order when outputting to YAML. More...
 
void applyUnits (shared_ptr< UnitSystem > &units)
 
void setFlowStyle (bool flow=true)
 
template<>
const std::vector< AnyValue > & asVector (size_t nMin, size_t nMax) const
 Implicit conversion to vector<AnyValue> More...
 
template<>
std::vector< AnyValue > & asVector (size_t nMin, size_t nMax)
 
template<>
const std::vector< double > & asVector (size_t nMin, size_t nMax) const
 Implicit conversion of long int to double if accessed as a vector<double> More...
 
template<>
std::vector< double > & asVector (size_t nMin, size_t nMax)
 
template<>
const std::vector< vector_fp > & asVector (size_t nMin, size_t nMax) const
 Implicit conversion of long int to double if accessed as a vector<vector<double>> More...
 
template<>
std::vector< vector_fp > & asVector (size_t nMin, size_t nMax)
 
template<>
const std::vector< AnyMap > & asVector (size_t nMin, size_t nMax) const
 Implicit conversion of AnyMap to a vector<AnyMap> of length 1, or an empty vector<AnyValue> an empty vector<AnyMap> More...
 
template<>
std::vector< AnyMap > & asVector (size_t nMin, size_t nMax)
 
template<>
AnyMapas ()
 
template<>
bool is () const
 
template<>
const std::vector< AnyValue > & asVector (size_t nMin, size_t nMax) const
 
template<>
std::vector< AnyValue > & asVector (size_t nMin, size_t nMax)
 
template<>
const std::vector< double > & asVector (size_t nMin, size_t nMax) const
 
template<>
std::vector< double > & asVector (size_t nMin, size_t nMax)
 
template<>
const std::vector< vector_fp > & asVector (size_t nMin, size_t nMax) const
 
template<>
std::vector< vector_fp > & asVector (size_t nMin, size_t nMax)
 
template<>
const std::vector< AnyMap > & asVector (size_t nMin, size_t nMax) const
 
template<>
std::vector< AnyMap > & asVector (size_t nMin, size_t nMax)
 
- Public Member Functions inherited from AnyBase
void setLoc (int line, int column)
 For values which are derived from an input file, set the line and column of this value in that file. More...
 
const AnyValuegetMetadata (const std::string &key) const
 Get a value from the metadata applicable to the AnyMap tree containing this node. More...
 

Private Types

typedef bool(* Comparer) (const boost::any &, const boost::any &)
 

Private Member Functions

template<class T >
void checkSize (const std::vector< T > &v, size_t nMin, size_t nMax) const
 

Static Private Member Functions

template<typename T >
static bool eq_comparer (const boost::any &lhs, const boost::any &rhs)
 Equality comparison function used when lhs is of type T More...
 
template<class T , class U >
static bool vector_eq (const boost::any &lhs, const boost::any &rhs)
 Helper function for comparing vectors of different (but comparable) types, for example vector<double> and vector<long int> More...
 
template<class T , class U >
static bool vector2_eq (const boost::any &lhs, const boost::any &rhs)
 Helper function for comparing nested vectors of different (but comparable) types, for example vector<vector<double>> and vector<vector<long int>> More...
 

Private Attributes

std::string m_key
 Key of this value in a parent AnyMap More...
 
std::unique_ptr< boost::any > m_value
 The held value. More...
 
Comparer m_equals
 

Friends

bool operator== (const std::string &lhs, const AnyValue &rhs)
 
bool operator!= (const std::string &lhs, const AnyValue &rhs)
 
bool operator== (const double &lhs, const AnyValue &rhs)
 
bool operator!= (const double &lhs, const AnyValue &rhs)
 
bool operator== (const long int &lhs, const AnyValue &rhs)
 
bool operator!= (const long int &lhs, const AnyValue &rhs)
 
bool operator== (const int &lhs, const AnyValue &rhs)
 
bool operator!= (const int &lhs, const AnyValue &rhs)
 
YAML::Emitter & YAML::operator<< (YAML::Emitter &out, const AnyValue &rhs)
 

Quantity conversions

Assign a quantity consisting of one or more values and their corresponding units, which will be converted to a target unit system when the applyUnits() function is later called on the root of the AnyMap.

typedef std::function< void(AnyValue &, const UnitSystem &)> unitConverter
 
void setQuantity (double value, const std::string &units, bool is_act_energy=false)
 Assign a scalar quantity with units as a string, for example {3.0, "m^2"}. More...
 
void setQuantity (double value, const Units &units)
 Assign a scalar quantity with units as a Units object, for cases where the units vary and are determined dynamically, such as reaction pre-exponential factors. More...
 
void setQuantity (const vector_fp &values, const std::string &units)
 Assign a vector where all the values have the same units. More...
 
void setQuantity (const AnyValue &value, const unitConverter &converter)
 Assign a value of any type where the unit conversion requires a different behavior besides scaling all values by the same factor. More...
 

Additional Inherited Members

- Protected Attributes inherited from AnyBase
int m_line
 The line where this value occurs in the input file. More...
 
int m_column
 If m_line >= 0, the column where this value occurs in the input file. More...
 
shared_ptr< AnyMapm_metadata
 Metadata relevant to an entire AnyMap tree, such as information about. More...
 

Detailed Description

A wrapper for a variable whose type is determined at runtime.

Instances of AnyValue are used as values in an AnyMap. Values are converted to a concrete type using the templated as() method or convenience methods such as asString() and asDouble(). See AnyMap for usage examples.

Elements are set using assignment, and the assignment operator has been overloaded for specific types so that only those types are allowed to be used in an AnyValue. The allowed types are:

Definition at line 83 of file AnyMap.h.

Member Typedef Documentation

◆ unitConverter

typedef std::function<void(AnyValue&, const UnitSystem&)> unitConverter

Definition at line 166 of file AnyMap.h.

◆ Comparer

typedef bool(* Comparer) (const boost::any &, const boost::any &)
private

Definition at line 280 of file AnyMap.h.

Constructor & Destructor Documentation

◆ AnyValue() [1/10]

AnyValue ( )

Definition at line 588 of file AnyMap.cpp.

◆ AnyValue() [2/10]

AnyValue ( AnyValue const &  other)

Definition at line 596 of file AnyMap.cpp.

◆ AnyValue() [3/10]

AnyValue ( AnyValue &&  other)

Definition at line 604 of file AnyMap.cpp.

◆ AnyValue() [4/10]

AnyValue ( const std::string &  value)
explicit

Definition at line 694 of file AnyMap.cpp.

◆ AnyValue() [5/10]

AnyValue ( const char *  value)
explicit

Definition at line 699 of file AnyMap.cpp.

◆ AnyValue() [6/10]

AnyValue ( double  value)
explicit

Definition at line 790 of file AnyMap.cpp.

◆ AnyValue() [7/10]

AnyValue ( bool  value)
explicit

Definition at line 837 of file AnyMap.cpp.

◆ AnyValue() [8/10]

AnyValue ( long int  value)
explicit

Definition at line 858 of file AnyMap.cpp.

◆ AnyValue() [9/10]

AnyValue ( int  value)
explicit

Definition at line 863 of file AnyMap.cpp.

◆ AnyValue() [10/10]

AnyValue ( const AnyMap value)
explicit

Definition at line 936 of file AnyMap.cpp.

Member Function Documentation

◆ operator=() [1/13]

AnyValue & operator= ( AnyValue const &  other)

Definition at line 612 of file AnyMap.cpp.

◆ operator=() [2/13]

AnyValue & operator= ( AnyValue &&  other)

Definition at line 623 of file AnyMap.cpp.

◆ operator==() [1/5]

bool operator== ( const AnyValue other) const

Definition at line 634 of file AnyMap.cpp.

◆ operator!=() [1/5]

bool operator!= ( const AnyValue other) const

Definition at line 639 of file AnyMap.cpp.

◆ operator[]() [1/2]

AnyValue & operator[] ( const std::string &  key)

If this AnyValue is an AnyMap, return the value stored in key.

Definition at line 644 of file AnyMap.cpp.

◆ operator[]() [2/2]

const AnyValue & operator[] ( const std::string &  key) const

Definition at line 649 of file AnyMap.cpp.

◆ hasKey()

bool hasKey ( const std::string &  key) const

Returns true if this AnyValue is an AnyMap and that map contains a key with the given name.

Definition at line 654 of file AnyMap.cpp.

References AnyValue::hasKey().

Referenced by AnyValue::getMapWhere(), AnyValue::hasKey(), AnyValue::hasMapWhere(), and Domain1D::restore().

◆ setKey()

void setKey ( const std::string &  key)

Set the name of the key storing this value in an AnyMap.

Used for providing informative error messages in class InputFileError.

Definition at line 658 of file AnyMap.cpp.

References AnyValue::m_key.

Referenced by AnyMap::createForYaml(), and AnyMap::operator[]().

◆ propagateMetadata()

void propagateMetadata ( shared_ptr< AnyMap > &  file)

Propagate metadata to any child elements.

Definition at line 664 of file AnyMap.cpp.

References AnyValue::is(), and AnyBase::m_metadata.

Referenced by AnyMap::createForYaml(), and AnyMap::operator[]().

◆ as() [1/3]

const T & as

Get the value of this key as the specified type.

Definition at line 19 of file AnyMap.inl.h.

Referenced by AnyValue::applyUnits().

◆ as() [2/3]

T & as

Definition at line 51 of file AnyMap.inl.h.

◆ type()

const std::type_info & type ( ) const

Returns the type of the held value.

Definition at line 660 of file AnyMap.cpp.

References AnyValue::m_value.

Referenced by AnyValue::type_str().

◆ type_str()

std::string type_str ( ) const

Returns a string specifying the type of the held value.

Definition at line 680 of file AnyMap.cpp.

References Cantera::demangle(), and AnyValue::type().

◆ empty()

bool empty ( ) const

Return boolean indicating whether AnyValue is empty.

Definition at line 684 of file AnyMap.cpp.

References AnyValue::m_value.

Referenced by ReactingSurf1D::serialize(), StFlow::serialize(), and ArrheniusBase::setRateParameters().

◆ is() [1/2]

bool is

Returns true if the held value is of the specified type.

Definition at line 58 of file AnyMap.inl.h.

References AnyValue::m_value.

Referenced by AnyValue::applyUnits(), AnyValue::getMapWhere(), AnyValue::hasMapWhere(), AnyValue::propagateMetadata(), ArrheniusBase::setRateParameters(), and MolalityVPSSTP::setState().

◆ isScalar()

bool isScalar ( ) const

Returns true if the held value is a scalar type (such as double, long int, string, or bool).

Definition at line 688 of file AnyMap.cpp.

Referenced by StFlow::restore().

◆ operator=() [3/13]

AnyValue & operator= ( const std::string &  value)

Definition at line 704 of file AnyMap.cpp.

◆ operator=() [4/13]

AnyValue & operator= ( const char *  value)

Definition at line 710 of file AnyMap.cpp.

◆ asString()

const std::string & asString ( ) const

Return the held value, if it is a string.

Definition at line 716 of file AnyMap.cpp.

Referenced by ReactingSurf1D::serialize(), StFlow::serialize(), and MolalityVPSSTP::setState().

◆ operator==() [2/5]

bool operator== ( const std::string &  other) const

Definition at line 720 of file AnyMap.cpp.

◆ operator!=() [2/5]

bool operator!= ( const std::string &  other) const

Definition at line 729 of file AnyMap.cpp.

◆ setQuantity() [1/4]

void setQuantity ( double  value,
const std::string &  units,
bool  is_act_energy = false 
)

Assign a scalar quantity with units as a string, for example {3.0, "m^2"}.

If the is_act_energy flag is set to true, the units will be converted using the special rules for activation energies.

Definition at line 746 of file AnyMap.cpp.

References AnyValue::m_value.

◆ setQuantity() [2/4]

void setQuantity ( double  value,
const Units units 
)

Assign a scalar quantity with units as a Units object, for cases where the units vary and are determined dynamically, such as reaction pre-exponential factors.

Definition at line 751 of file AnyMap.cpp.

References AnyValue::m_value.

◆ setQuantity() [3/4]

void setQuantity ( const vector_fp values,
const std::string &  units 
)

Assign a vector where all the values have the same units.

Definition at line 756 of file AnyMap.cpp.

References AnyValue::m_value.

◆ setQuantity() [4/4]

void setQuantity ( const AnyValue value,
const unitConverter &  converter 
)

Assign a value of any type where the unit conversion requires a different behavior besides scaling all values by the same factor.

Definition at line 763 of file AnyMap.cpp.

References AnyValue::m_value.

◆ operator=() [5/13]

AnyValue & operator= ( double  value)

Definition at line 795 of file AnyMap.cpp.

◆ asDouble() [1/2]

double & asDouble ( )

Return the held value as a double, if it is a double or a long int.

Definition at line 801 of file AnyMap.cpp.

◆ asDouble() [2/2]

const double & asDouble ( ) const

Definition at line 805 of file AnyMap.cpp.

◆ operator==() [3/5]

bool operator== ( const double &  other) const

Definition at line 809 of file AnyMap.cpp.

◆ operator!=() [3/5]

bool operator!= ( const double &  other) const

Definition at line 820 of file AnyMap.cpp.

◆ operator=() [6/13]

AnyValue & operator= ( bool  value)

Definition at line 842 of file AnyMap.cpp.

◆ asBool() [1/2]

bool & asBool ( )

Return the held value, if it is a bool.

Definition at line 848 of file AnyMap.cpp.

Referenced by StFlow::restore().

◆ asBool() [2/2]

const bool & asBool ( ) const

Definition at line 852 of file AnyMap.cpp.

◆ operator=() [7/13]

AnyValue & operator= ( long int  value)

Definition at line 868 of file AnyMap.cpp.

◆ operator=() [8/13]

AnyValue & operator= ( int  value)

Definition at line 874 of file AnyMap.cpp.

◆ asInt() [1/2]

long int & asInt ( )

Return the held value, if it is a long int.

Definition at line 880 of file AnyMap.cpp.

◆ asInt() [2/2]

const long int & asInt ( ) const

Definition at line 884 of file AnyMap.cpp.

◆ operator==() [4/5]

bool operator== ( const long int &  other) const

Definition at line 888 of file AnyMap.cpp.

◆ operator!=() [4/5]

bool operator!= ( const long int &  other) const

Definition at line 899 of file AnyMap.cpp.

◆ operator==() [5/5]

bool operator== ( const int &  other) const

Definition at line 904 of file AnyMap.cpp.

◆ operator!=() [5/5]

bool operator!= ( const int &  other) const

Definition at line 909 of file AnyMap.cpp.

◆ operator=() [9/13]

AnyValue & operator= ( const std::vector< T > &  value)

Definition at line 65 of file AnyMap.inl.h.

◆ asVector() [1/14]

const std::vector< T > & asVector ( size_t  nMin = npos,
size_t  nMax = npos 
) const

Return the held value, if it is a vector of type T.

If called with one argument, requires the vector to be of the specified size. If called with two arguments, requires the vector to be within the range specified by the two values, inclusive.

Definition at line 72 of file AnyMap.inl.h.

Referenced by Cantera::getReactions(), Cantera::getSpecies(), and StFlow::restore().

◆ asVector() [2/14]

std::vector< T > & asVector ( size_t  nMin = npos,
size_t  nMax = npos 
)

Definition at line 79 of file AnyMap.inl.h.

◆ operator=() [10/13]

AnyValue & operator= ( const AnyMap value)

Definition at line 941 of file AnyMap.cpp.

◆ operator=() [11/13]

AnyValue & operator= ( AnyMap &&  value)

Definition at line 947 of file AnyMap.cpp.

◆ operator=() [12/13]

AnyValue & operator= ( const std::unordered_map< std::string, T >  items)

Definition at line 86 of file AnyMap.inl.h.

◆ operator=() [13/13]

AnyValue & operator= ( const std::map< std::string, T >  items)

Definition at line 97 of file AnyMap.inl.h.

◆ asMap() [1/3]

std::map< std::string, T > asMap

Return the held AnyMap as a std::map where all of the values have the specified type.

Definition at line 125 of file AnyMap.inl.h.

Referenced by MolalityVPSSTP::setState().

◆ asMap() [2/3]

std::unordered_map< std::string, const AnyMap * > asMap ( const std::string &  name) const

Access a vector<AnyMap> as a mapping using the value of name from each item as the key in the new mapping.

For example, for the list:

[{name: O2, weight: 32}, {name: CH4, weight: 16}]

calling asMap("name") will create a map with keys O2 and CH4.

Definition at line 953 of file AnyMap.cpp.

◆ asMap() [3/3]

std::unordered_map< std::string, AnyMap * > asMap ( const std::string &  name)

Definition at line 968 of file AnyMap.cpp.

◆ getMapWhere() [1/2]

AnyMap & getMapWhere ( const std::string &  key,
const std::string &  value,
bool  create = false 
)

Treating the value as vector<AnyMap>, return the item where the given key has the specified value.

If value is the empty string, returns the first item in the list.

If the contained type is just AnyMap rather than vector<AnyMap>, it will be treated as a vector of length 1.

If the value does not exist but the create flag is set to true, a new map with that key and value will be created and returned.

Definition at line 1012 of file AnyMap.cpp.

References AnyMap::at(), AnyValue::hasKey(), AnyValue::is(), and AnyValue::m_key.

Referenced by Cantera::newSolution().

◆ getMapWhere() [2/2]

const AnyMap & getMapWhere ( const std::string &  key,
const std::string &  value 
) const

Definition at line 982 of file AnyMap.cpp.

◆ hasMapWhere()

bool hasMapWhere ( const std::string &  key,
const std::string &  value 
) const

Returns true when getMapWhere() would succeed.

Definition at line 1063 of file AnyMap.cpp.

References AnyValue::hasKey(), and AnyValue::is().

◆ order()

std::pair< int, int > order ( ) const

Return values used to determine the sort order when outputting to YAML.

Definition at line 1086 of file AnyMap.cpp.

References AnyBase::m_column, and AnyBase::m_line.

◆ applyUnits()

void applyUnits ( shared_ptr< UnitSystem > &  units)
See also
AnyMap::applyUnits(const UnitSystem&)

Definition at line 1091 of file AnyMap.cpp.

References AnyMap::applyUnits(), AnyValue::as(), AnyMap::getBool(), AnyMap::hasKey(), AnyValue::is(), AnyValue::m_key, AnyValue::m_value, and Cantera::scale().

◆ setFlowStyle()

void setFlowStyle ( bool  flow = true)
See also
AnyMap::setFlowStyle

Definition at line 1188 of file AnyMap.cpp.

◆ checkSize()

void checkSize ( const std::vector< T > &  v,
size_t  nMin,
size_t  nMax 
) const
private

Definition at line 135 of file AnyMap.inl.h.

◆ eq_comparer()

bool eq_comparer ( const boost::any &  lhs,
const boost::any &  rhs 
)
staticprivate

Equality comparison function used when lhs is of type T

Definition at line 179 of file AnyMap.inl.h.

References AssertThrowMsg.

◆ vector_eq()

bool vector_eq ( const boost::any &  lhs,
const boost::any &  rhs 
)
staticprivate

Helper function for comparing vectors of different (but comparable) types, for example vector<double> and vector<long int>

Definition at line 150 of file AnyMap.inl.h.

◆ vector2_eq()

bool vector2_eq ( const boost::any &  lhs,
const boost::any &  rhs 
)
staticprivate

Helper function for comparing nested vectors of different (but comparable) types, for example vector<vector<double>> and vector<vector<long int>>

Definition at line 162 of file AnyMap.inl.h.

◆ asVector() [3/14]

const std::vector< AnyValue > & asVector ( size_t  nMin,
size_t  nMax 
) const

Implicit conversion to vector<AnyValue>

◆ asVector() [4/14]

const std::vector< double > & asVector ( size_t  nMin,
size_t  nMax 
) const

Implicit conversion of long int to double if accessed as a vector<double>

◆ asVector() [5/14]

const std::vector< vector_fp > & asVector ( size_t  nMin,
size_t  nMax 
) const

Implicit conversion of long int to double if accessed as a vector<vector<double>>

◆ asVector() [6/14]

const std::vector< AnyMap > & asVector ( size_t  nMin,
size_t  nMax 
) const

Implicit conversion of AnyMap to a vector<AnyMap> of length 1, or an empty vector<AnyValue> an empty vector<AnyMap>

◆ as() [3/3]

AnyMap & as ( )
inline

Definition at line 108 of file AnyMap.inl.h.

◆ is() [2/2]

bool is ( ) const

Definition at line 770 of file AnyMap.cpp.

◆ asVector() [7/14]

const std::vector< AnyValue > & asVector ( size_t  nMin,
size_t  nMax 
) const

Definition at line 1196 of file AnyMap.cpp.

◆ asVector() [8/14]

std::vector< AnyValue > & asVector ( size_t  nMin,
size_t  nMax 
)

Definition at line 1196 of file AnyMap.cpp.

◆ asVector() [9/14]

const std::vector< double > & asVector ( size_t  nMin,
size_t  nMax 
) const

Definition at line 1235 of file AnyMap.cpp.

◆ asVector() [10/14]

std::vector< double > & asVector ( size_t  nMin,
size_t  nMax 
)

Definition at line 1235 of file AnyMap.cpp.

◆ asVector() [11/14]

const std::vector< vector_fp > & asVector ( size_t  nMin,
size_t  nMax 
) const

Definition at line 1267 of file AnyMap.cpp.

◆ asVector() [12/14]

std::vector< vector_fp > & asVector ( size_t  nMin,
size_t  nMax 
)

Definition at line 1267 of file AnyMap.cpp.

◆ asVector() [13/14]

const std::vector< AnyMap > & asVector ( size_t  nMin,
size_t  nMax 
) const

Definition at line 1305 of file AnyMap.cpp.

◆ asVector() [14/14]

std::vector< AnyMap > & asVector ( size_t  nMin,
size_t  nMax 
)

Definition at line 1305 of file AnyMap.cpp.

Friends And Related Function Documentation

◆ operator== [1/4]

bool operator== ( const std::string &  lhs,
const AnyValue rhs 
)
friend

Definition at line 734 of file AnyMap.cpp.

◆ operator!= [1/4]

bool operator!= ( const std::string &  lhs,
const AnyValue rhs 
)
friend

Definition at line 739 of file AnyMap.cpp.

◆ operator== [2/4]

bool operator== ( const double &  lhs,
const AnyValue rhs 
)
friend

Definition at line 825 of file AnyMap.cpp.

◆ operator!= [2/4]

bool operator!= ( const double &  lhs,
const AnyValue rhs 
)
friend

Definition at line 830 of file AnyMap.cpp.

◆ operator== [3/4]

bool operator== ( const long int &  lhs,
const AnyValue rhs 
)
friend

Definition at line 914 of file AnyMap.cpp.

◆ operator!= [3/4]

bool operator!= ( const long int &  lhs,
const AnyValue rhs 
)
friend

Definition at line 919 of file AnyMap.cpp.

◆ operator== [4/4]

bool operator== ( const int &  lhs,
const AnyValue rhs 
)
friend

Definition at line 924 of file AnyMap.cpp.

◆ operator!= [4/4]

bool operator!= ( const int &  lhs,
const AnyValue rhs 
)
friend

Definition at line 929 of file AnyMap.cpp.

Member Data Documentation

◆ m_key

std::string m_key
private

Key of this value in a parent AnyMap

Definition at line 275 of file AnyMap.h.

Referenced by AnyValue::applyUnits(), AnyValue::getMapWhere(), and AnyValue::setKey().

◆ m_value

std::unique_ptr<boost::any> m_value
private

The held value.

Definition at line 278 of file AnyMap.h.

Referenced by AnyValue::applyUnits(), AnyValue::empty(), AnyValue::is(), AnyValue::setQuantity(), and AnyValue::type().

◆ m_equals

Comparer m_equals
mutableprivate

Definition at line 297 of file AnyMap.h.


The documentation for this class was generated from the following files: