GEOSX
|
This class provides the base class/interface for the catalog value objects. More...
#include <ObjectCatalog.hpp>
Public Types | |
typedef std::unordered_map< std::string, std::unique_ptr< CatalogInterface< BASETYPE, ARGS... > > > | CatalogType |
This is the type that will be used for the catalog. The catalog is actually instantiated in the BASETYPE . | |
Public Member Functions | |
CatalogInterface () | |
Default constructor. | |
virtual | ~CatalogInterface () |
Default destructor. | |
CatalogInterface (CatalogInterface const &)=default | |
Copy constructor. | |
CatalogInterface (CatalogInterface &&)=default | |
Move constructor. | |
CatalogInterface & | operator= (CatalogInterface const &)=default |
Copy assignment operator. More... | |
CatalogInterface & | operator= (CatalogInterface &&)=default |
Move assignment operator. More... | |
virtual std::unique_ptr< BASETYPE > | allocate (ARGS... args) const =0 |
Create a new object that derives from BASETYPE. More... | |
Static Public Member Functions | |
static CatalogType & | getCatalog () |
Get the catalog from that is stored in the target base class. More... | |
static bool | hasKeyName (std::string const &objectTypeName) |
Check if catalog contains a given key. More... | |
static std::list< typename CatalogType::key_type > | getKeys () |
Returns the product keys of the catalog. Keys are sorted in alphabetical order, case insensitive. More... | |
static std::unique_ptr< BASETYPE > | factory (std::string const &objectTypeName, ARGS... args) |
Static method to create a new object that derives from BASETYPE. More... | |
template<typename TYPE > | |
static TYPE & | catalogCast (BASETYPE &object) |
Downcast base type reference to derived type. More... | |
This class provides the base class/interface for the catalog value objects.
BASETYPE | base class of the objects that the factory produces |
ARGS | variadic template pack to hold the parameters needed for the constructor of the BASETYPE |
Definition at line 65 of file ObjectCatalog.hpp.
|
pure virtual |
Create a new object that derives from BASETYPE.
args | arguments to the constructor of the target type |
Implemented in geos::dataRepository::CatalogEntry< BASETYPE, TYPE, ARGS >.
|
inlinestatic |
Downcast base type reference to derived type.
TYPE | type to cast to |
object | base type reference to object |
If OBJECTCATALOGVERBOSE
is enabled, will check that runtime name of the object is the same as catalog name of the derived type. Therefore may fail for objects that have been assigned a different name (e.g. through XML "name" attribute).
Definition at line 216 of file ObjectCatalog.hpp.
|
inlinestatic |
Static method to create a new object that derives from BASETYPE.
[in] | objectTypeName | the key to the catalog entry that is able to create the correct type. |
args | these are the arguments to the constructor of the target type |
Definition at line 178 of file ObjectCatalog.hpp.
|
inlinestatic |
Get the catalog from that is stored in the target base class.
Definition at line 121 of file ObjectCatalog.hpp.
|
inlinestatic |
Returns the product keys of the catalog. Keys are sorted in alphabetical order, case insensitive.
Definition at line 152 of file ObjectCatalog.hpp.
|
inlinestatic |
Check if catalog contains a given key.
objectTypeName | name of the type tp look up |
true
if type has been registered with this catalog, false
otherwise Definition at line 143 of file ObjectCatalog.hpp.
|
default |
Move assignment operator.
|
default |
Copy assignment operator.