GEOS
Classes | Namespaces | Macros
ObjectCatalog.hpp File Reference
#include "common/logger/Logger.hpp"
#include "common/format/StringUtilities.hpp"
#include "LvArray/src/system.hpp"
#include <iostream>
#include <list>
#include <memory>
#include <unordered_map>

Go to the source code of this file.

Classes

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

Namespaces

 geos
 
 geos::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 { GEOS_MAYBE_UNUSED geos::dataRepository::CatalogEntryConstructor< BaseType, DerivedType, __VA_ARGS__ > catEntry_ ## DerivedType; }
 Object catalog class registration macro. More...
 
#define REGISTER_CATALOG_ENTRY0(BaseType, DerivedType)    namespace { GEOS_MAYBE_UNUSED geos::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 { GEOS_MAYBE_UNUSED geos::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 701 of file ObjectCatalog.hpp.