general-purpose store for any kind of object with the particular copy semantics of copying by value. This is effectively a map of string pairs to (constant) pointers. The first string represents the category of the object, and the second being a name for that particular object. The guarantee with the ConstDataMap is that if an object is put into the map, it may be read from, but it will not be changed underneath you. Data stored in the ConstDataMap can safely be shared between threads.
More...
#include <ConstDataMap.hh>
general-purpose store for any kind of object with the particular copy semantics of copying by value. This is effectively a map of string pairs to (constant) pointers. The first string represents the category of the object, and the second being a name for that particular object. The guarantee with the ConstDataMap is that if an object is put into the map, it may be read from, but it will not be changed underneath you. Data stored in the ConstDataMap can safely be shared between threads.
◆ CategorizedConstObjectMap
◆ const_iterator
◆ iterator
◆ NamedConstObjectMap
◆ ConstDataMap() [1/2]
basic::datacache::ConstDataMap::ConstDataMap |
( |
| ) |
|
|
default |
◆ ConstDataMap() [2/2]
basic::datacache::ConstDataMap::ConstDataMap |
( |
ConstDataMap const & |
src | ) |
|
|
default |
◆ ~ConstDataMap()
basic::datacache::ConstDataMap::~ConstDataMap |
( |
| ) |
|
|
overridedefault |
◆ add()
void basic::datacache::ConstDataMap::add |
( |
std::string const & |
type, |
|
|
std::string const & |
name, |
|
|
utility::VirtualBaseCOP const |
op |
|
) |
| |
◆ begin() [1/2]
◆ begin() [2/2]
◆ end() [1/2]
◆ end() [2/2]
◆ get()
template<class Ty >
Ty const & basic::datacache::ConstDataMap::get |
( |
std::string const & |
type, |
|
|
std::string const & |
name |
|
) |
| const |
a template utility function to grab any type of object from the Data_map. Downcasts the VirtualBase object in map to the template data type using dynamic_cast to ensure type-correctness
- Exceptions
-
Throws | a utility::excn::EXCN_Msg_Exception in the event that the requested object cannot be found in the ConstDataMap. |
References CREATE_EXCEPTION, data_map_, and has().
Referenced by main().
◆ get_ptr()
template<class Ty >
utility::pointer::shared_ptr< Ty const > basic::datacache::ConstDataMap::get_ptr |
( |
std::string const & |
type, |
|
|
std::string const & |
name |
|
) |
| const |
a template utility function to grab any type of object from the ConstDataMap. Downcasts the owning pointer in map to the template data type using dynamic_pointer_cast to ensure type-correctness
- Exceptions
-
Throws | a utility::excn::EXCN_Msg_Exception in the event that the requested object cannot be found in the ConstDataMap. |
References CREATE_EXCEPTION, data_map_, and has().
◆ has() [1/2]
bool basic::datacache::ConstDataMap::has |
( |
std::string const & |
category | ) |
const |
are there any objects in the outer map with the given category?
References data_map_.
Referenced by get(), and get_ptr().
◆ has() [2/2]
bool basic::datacache::ConstDataMap::has |
( |
std::string const & |
category, |
|
|
std::string const & |
name |
|
) |
| const |
Is there an object with the given category and the given name?
References data_map_.
◆ operator=()
Performs a shallow copy of all of the pointers stored in rhs into this.
merge-sort style iteration over the elements of both data-maps. This implementation may not be necessary as the STL library may already implement map's assignment operator this way.
References data_map_.
◆ operator==()
bool basic::datacache::ConstDataMap::operator== |
( |
ConstDataMap const & |
rhs | ) |
const |
Performs pointer comparison to determine if these two maps point at the same data.
merge-sort style iteration over the elements of both data-maps.
References data_map_.
◆ operator[]()
◆ size()
returns the number of objects contained in the map
References count, and data_map_.
◆ data_map_
The documentation for this class was generated from the following files: