GEOSX
Public Types | Public Member Functions | Static Public Member Functions | List of all members
geos::dataRepository::CatalogInterface< BASETYPE > Class Template Referenceabstract

Specialization of CatalogInterface for types with no-argument constructors/. More...

#include <ObjectCatalog.hpp>

Inheritance diagram for geos::dataRepository::CatalogInterface< BASETYPE >:
Inheritance graph
[legend]

Public Types

typedef std::unordered_map< std::string, std::unique_ptr< CatalogInterface< BASETYPE > > > 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.
 
CatalogInterfaceoperator= (CatalogInterface const &)=default
 Copy assignment operator. More...
 
CatalogInterfaceoperator= (CatalogInterface &&)=default
 Move assignment operator. More...
 
virtual std::unique_ptr< BASETYPE > allocate () const =0
 Create a new object that derives from BASETYPE. More...
 

Static Public Member Functions

static CatalogTypegetCatalog ()
 Get the catalog from that is stored in the target base class. More...
 
static std::unique_ptr< BASETYPE > factory (std::string const &objectTypeName)
 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...
 

Detailed Description

template<typename BASETYPE>
class geos::dataRepository::CatalogInterface< BASETYPE >

Specialization of CatalogInterface for types with no-argument constructors/.

Template Parameters
BASETYPEbase class that contains the catalog

Definition at line 412 of file ObjectCatalog.hpp.

Member Function Documentation

◆ allocate()

template<typename BASETYPE >
virtual std::unique_ptr< BASETYPE > geos::dataRepository::CatalogInterface< BASETYPE >::allocate ( ) const
pure virtual

Create a new object that derives from BASETYPE.

Returns
passes a unique_ptr<BASETYPE> to the newly allocated class.

Implemented in geos::dataRepository::CatalogEntry< BASETYPE, TYPE >.

◆ catalogCast()

template<typename BASETYPE >
template<typename TYPE >
static TYPE& geos::dataRepository::CatalogInterface< BASETYPE >::catalogCast ( BASETYPE &  object)
inlinestatic

Downcast base type reference to derived type.

Template Parameters
TYPEtype to cast to
Parameters
objectbase type reference to object
Returns
reference to the same object, cast to derived type

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 505 of file ObjectCatalog.hpp.

◆ factory()

template<typename BASETYPE >
static std::unique_ptr< BASETYPE > geos::dataRepository::CatalogInterface< BASETYPE >::factory ( std::string const &  objectTypeName)
inlinestatic

Create a new object that derives from BASETYPE.

Parameters
objectTypeNameThe key to the catalog entry that is able to create the correct type.
Returns
passes a unique_ptr<BASETYPE> to the newly allocated class.

Definition at line 488 of file ObjectCatalog.hpp.

◆ getCatalog()

template<typename BASETYPE >
static CatalogType& geos::dataRepository::CatalogInterface< BASETYPE >::getCatalog ( )
inlinestatic

Get the catalog from that is stored in the target base class.

Returns
returns the catalog for this

Definition at line 467 of file ObjectCatalog.hpp.

◆ operator=() [1/2]

template<typename BASETYPE >
CatalogInterface& geos::dataRepository::CatalogInterface< BASETYPE >::operator= ( CatalogInterface< BASETYPE > &&  )
default

Move assignment operator.

Returns
reference to this object

◆ operator=() [2/2]

template<typename BASETYPE >
CatalogInterface& geos::dataRepository::CatalogInterface< BASETYPE >::operator= ( CatalogInterface< BASETYPE > const &  )
default

Copy assignment operator.

Returns
reference to this object

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