GEOSX
Classes | Namespaces | Macros
ObjectCatalog.hpp File Reference
#include "common/Logger.hpp"
#include "LvArray/src/system.hpp"
#include <unordered_map>
#include <string>
#include <iostream>
#include <memory>

Go to the source code of this file.

Classes

class  geosx::dataRepository::CatalogInterface< BASETYPE, ARGS >
 This class provides the base class/interface for the catalog value objects. More...
 
class  geosx::dataRepository::CatalogEntry< BASETYPE, TYPE, ARGS >
 Class to hold allocation capability for specific target derived types. More...
 
class  geosx::dataRepository::CatalogEntryConstructor< BASETYPE, TYPE, ARGS >
 A class to generate the catalog entry. More...
 
class  geosx::dataRepository::CatalogInterface< BASETYPE >
 Specialization of CatalogInterface for types with no-argument constructors/. More...
 
class  geosx::dataRepository::CatalogEntry< BASETYPE, TYPE >
 Specialization of CatalogEntry for types with no-argument constructors. More...
 
class  geosx::dataRepository::CatalogEntryConstructor< BASETYPE, TYPE >
 A specialization of CatalogEntryConstructor for types with no-argument constructors. More...
 

Namespaces

 geosx
 
 geosx::dataRepository
 

Macros

#define OBJECTCATALOGVERBOSE   0
 Enables verbose logging of object catalog.
 
#define BASEHOLDSCATALOG   1
 Enables storing catalogs in the base class.
 
#define REGISTER_CATALOG_ENTRY(BaseType, DerivedType, ...)   namespace { geosx::dataRepository::CatalogEntryConstructor< BaseType, DerivedType, __VA_ARGS__ > catEntry_ ## DerivedType; }
 Object catalog class registration macro. More...
 
#define REGISTER_CATALOG_ENTRY0(BaseType, DerivedType)   namespace { geosx::dataRepository::CatalogEntryConstructor< BaseType, DerivedType > catEntry_ ## DerivedType; }
 Same as REGISTER_CATALOG_ENTRY, but for classes with no-argument constructors.
 

Detailed Description

The ObjectCatalog acts as a statically initialized factory. It functions in a similar manner to classic virtual factory method, except that it is no maintained list of derived objects that is required to create new objects. Instead, the ObjectCatalog creates a "catalog" of derived objects using a std::unordered_map. This std::unordered_map is then statically initialized through the declaration of a

Definition in file ObjectCatalog.hpp.

Macro Definition Documentation

◆ REGISTER_CATALOG_ENTRY

#define REGISTER_CATALOG_ENTRY (   BaseType,
  DerivedType,
  ... 
)    namespace { geosx::dataRepository::CatalogEntryConstructor< BaseType, DerivedType, __VA_ARGS__ > catEntry_ ## DerivedType; }

Object catalog class registration macro.

Macro that takes in the base class of the catalog, the derived class, and the argument types for the constructor of the derived class/base class, and create an object of type CatalogEntryConstructor<ClassName,BaseType,VA_ARGS> in an anonymous namespace. This should be called from the source file for the derived class, which will result in the generation of a CatalogEntry<BaseType,ClassName,...> prior to main().

Definition at line 655 of file ObjectCatalog.hpp.