|
| NamedVariantData (const NamedData< boost::any > &namedData) |
| Implicit conversion for NamedVariantData constructor is used on purpose.
|
|
template<typename T > |
bool | hasTypedData (int index) const |
| Check whether the entry with the specified index contains valid data. More...
|
|
template<typename T > |
bool | hasTypedData (const std::string &name) const |
| Check whether the entry with the specified name contains valid data. More...
|
|
template<typename T > |
bool | get (int index, T *value) const |
| Given an index, get the corresponding value. More...
|
|
template<typename T > |
bool | get (const std::string &name, T *value) const |
| Given a name, get the corresponding value. More...
|
|
| NamedData () |
| Create an empty object, with no associated names and indices yet.
|
|
| NamedData (std::shared_ptr< const IndexDirectory > directory) |
| Create an object containing items from an index directory. More...
|
|
| NamedData (const std::vector< std::string > &names) |
| Construct an object, using the names from a vector of strings. More...
|
|
| NamedData (const NamedData &namedData) |
| Construct an object as a copy of the data from another object. More...
|
|
| NamedData (NamedData &&namedData) |
| Create an object and move the data from another object. More...
|
|
NamedData & | operator= (const NamedData &namedData) |
| Copy the data from another object. More...
|
|
NamedData & | operator= (NamedData &&namedData) |
| Move the data from another object. More...
|
|
bool | isValid () const |
| Check if the object has been initialized, which means it has a set of entries (i.e., names, indices, and the map between them). More...
|
|
std::shared_ptr< const IndexDirectory > | getDirectory () const |
| Return the object's layout directory, which is its collection of names and indices. More...
|
|
int | getIndex (const std::string &name) const |
| Given a name, return the corresponding index (or -1). More...
|
|
std::string | getName (int index) const |
| Given an index, return the corresponding name (or ""). More...
|
|
bool | hasEntry (int index) const |
| Check whether the object contains an entry with the specified index. More...
|
|
bool | hasEntry (const std::string &name) const |
| Check whether the object contains an entry with the specified name. More...
|
|
bool | hasData (int index) const |
| Check whether the entry with the specified index contains valid data. More...
|
|
bool | hasData (const std::string &name) const |
| Check whether the entry with the specified name contains valid data. More...
|
|
bool | get (int index, boost::any *value) const |
| Given an index, get the corresponding value. More...
|
|
bool | get (const std::string &name, boost::any *value) const |
| Given a name, get the corresponding value. More...
|
|
bool | set (int index, const boost::any &value) |
| Record the data for an entry specified by an index. More...
|
|
bool | set (int index, boost::any &&value) |
| Record the data for an entry specified by an index. More...
|
|
bool | set (const std::string &name, const boost::any &value) |
| Record the data for an entry specified by a name. More...
|
|
bool | set (const std::string &name, boost::any &&value) |
| Record the data for an entry specified by a name. More...
|
|
bool | reset (int index) |
| Invalidate an entry— mark it as not containing any valid data. More...
|
|
bool | reset (const std::string &name) |
| Invalidate an entry— mark it as not containing any valid data. More...
|
|
void | resetAll () |
| Invalidate all entries— mark everything as not containing any valid data.
|
|
size_t | size () const |
| Check the number of existing entries. More...
|
|
int | getNumEntries () const |
| Check the number of existing entries. More...
|
|
void | copy (const NamedData< N > &source, const NamedDataCopyMap &map) |
| Copy the data from another NamedData, based on a map of indices. More...
|
|
void | cacheIndex (const std::string &name, int *index) const |
| Caches an entry's index if it is not already cached. More...
|
|
A NamedData collection of variant data type.
A NamedVariantData collection is a collection variant datatypes. Each entry in the collection can be accessed by using either its unique name (a std::string) or its unique index (a non-negative integer). Access by name is more convenient, but also less efficient.
This sub-class of NameData encapsulates the boost::any variant type, and adds two get functions that provide typed access to the contained data.