![]() |
OpenMS
|
Functions | |
| template<class ContainerType > | |
| Size | indexOf (const ContainerType &cont, const typename ContainerType::value_type &val) |
| template<class EnumType > | |
| std::vector< std::string > | enumNames (const std::string *names, EnumType size_value) |
Returns the names of all enum values, i.e. the first size_value entries of names. | |
| template<class EnumType > | |
| const std::string & | enumToName (const std::string *names, EnumType value, EnumType size_value, const char *size_name, const char *function) |
Converts an enum value to its entry in names. | |
| template<class EnumType > | |
| EnumType | enumFromName (const std::string *names, EnumType size_value, const std::string &name, const char *message, const char *function) |
Converts a name to the enum value at its index in names. | |
| template<class T > | |
| const std::vector< std::shared_ptr< const T > > & | constifyPointerVector (const std::vector< std::shared_ptr< T > > &vec) |
| Helper function to add constness to a vector of shared pointers. | |
| template<class PtrType > | |
| bool | cmpPtrSafe (const PtrType &a, const PtrType &b) |
| Helper comparing two pointers for equality (taking NULL into account) | |
| template<class ContainerType > | |
| bool | cmpPtrContainer (const ContainerType &a, const ContainerType &b) |
| Helper function to compare two pointer-containers for equality of all elements. | |
|
inline |
Helper function to compare two pointer-containers for equality of all elements.
References cmpPtrSafe().
|
inline |
Helper comparing two pointers for equality (taking NULL into account)
Referenced by cmpPtrContainer().
| const std::vector< std::shared_ptr< const T > > & constifyPointerVector | ( | const std::vector< std::shared_ptr< T > > & | vec | ) |
Helper function to add constness to a vector of shared pointers.
| EnumType enumFromName | ( | const std::string * | names, |
| EnumType | size_value, | ||
| const std::string & | name, | ||
| const char * | message, | ||
| const char * | function | ||
| ) |
Converts a name to the enum value at its index in names.
Implements the toX(const std::string&) functions of enums with a NamesOfX[] array and a trailing SIZE_OF_X value. Unlike indexOf(), this throws Exception::InvalidValue.
| [in] | names | Array of names, indexed by enum value |
| [in] | size_value | The enum's SIZE_OF_X value (number of valid enum values) |
| [in] | name | The name to convert |
| [in] | message | Message of the exception thrown if name is unknown (e.g. "Value unknown") |
| [in] | function | Name of the calling function, reported by the exception |
| Exception::InvalidValue | if name is not among the first size_value entries of names |
References first.
| std::vector< std::string > enumNames | ( | const std::string * | names, |
| EnumType | size_value | ||
| ) |
Returns the names of all enum values, i.e. the first size_value entries of names.
Implements the getAllNamesOfX() functions of enums with a NamesOfX[] array and a trailing SIZE_OF_X value.
| [in] | names | Array of names, indexed by enum value |
| [in] | size_value | The enum's SIZE_OF_X value (number of valid enum values) |
| const std::string & enumToName | ( | const std::string * | names, |
| EnumType | value, | ||
| EnumType | size_value, | ||
| const char * | size_name, | ||
| const char * | function | ||
| ) |
Converts an enum value to its entry in names.
Implements the xToString(X) functions of enums with a NamesOfX[] array and a trailing SIZE_OF_X value.
| [in] | names | Array of names, indexed by enum value |
| [in] | value | The enum value to convert |
| [in] | size_value | The enum's SIZE_OF_X value, which is rejected |
| [in] | size_name | Name of size_value, reported as the invalid value (e.g. "SIZE_OF_X") |
| [in] | function | Name of the calling function, reported by the exception |
| Exception::InvalidValue | ("Value not allowed") if value is size_value |
| Size indexOf | ( | const ContainerType & | cont, |
| const typename ContainerType::value_type & | val | ||
| ) |
return the index of an element in a container useful for matching 'names_of_...' arrays to their enum value