Open-Transactions  0.93.0-ge03d287
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
opentxs::OTDB::Storable Class Reference

#include <OTStorage.hpp>

Inheritance diagram for opentxs::OTDB::Storable:
Collaboration diagram for opentxs::OTDB::Storable:

Public Member Functions

virtual ~Storable ()
 

Static Public Member Functions

static EXPORT StorableCreate (StoredObjectType eType, PackType thePackType)
 

Protected Member Functions

 Storable ()
 

Protected Attributes

std::string m_Type
 

Friends

class Storage
 

Detailed Description

Definition at line 436 of file OTStorage.hpp.

Constructor & Destructor Documentation

opentxs::OTDB::Storable::Storable ( )
inlineprotected

Definition at line 442 of file OTStorage.hpp.

443  : m_Type("Storable")
444  {
445  }
virtual opentxs::OTDB::Storable::~Storable ( )
inlinevirtual

Definition at line 450 of file OTStorage.hpp.

451  {
452  }

Member Function Documentation

Storable * opentxs::OTDB::Storable::Create ( StoredObjectType  eType,
PackType  thePackType 
)
static

Definition at line 860 of file OTStorage.cpp.

861 {
862  if (nullptr == details::pFunctionMap) return nullptr;
863 
864  Storable* pStorable = nullptr;
865 
866  // The Pack type, plus the Stored Object type, is the Key to the map of
867  // function pointers.
868  InstantiateFuncKey theKey(thePackType, eType);
869 
870  // If the key works, we get the function pointer to the static Create()
871  // method for
872  // the appropriate object type.
873 
874  auto it = details::pFunctionMap->find(theKey);
875 
876  if (details::pFunctionMap->end() == it) return nullptr;
877 
878  InstantiateFunc* pFunc = it->second;
879 
880  if (nullptr != pFunc) {
881  pStorable = (*pFunc)(); // Now we instantiate the object...
882  }
883 
884  return pStorable; // May return nullptr...
885 }
Storable *( InstantiateFunc)()
Definition: OTStorage.hpp:327
std::pair< PackType, StoredObjectType > InstantiateFuncKey
Definition: OTStorage.hpp:329
OTDB::mapOfFunctions * pFunctionMap
Definition: OTStorage.cpp:295

Friends And Related Function Documentation

friend class Storage
friend

Definition at line 438 of file OTStorage.hpp.

Member Data Documentation

std::string opentxs::OTDB::Storable::m_Type
protected

Definition at line 447 of file OTStorage.hpp.


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