HOPS
HOPS class reference
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
hops::MHO_ClassIdentityMap Class Reference

Class MHO_ClassIdentityMap. More...

#include <MHO_ClassIdentityMap.hh>

Inheritance diagram for hops::MHO_ClassIdentityMap:
[legend]

Public Member Functions

 MHO_ClassIdentityMap ()
 
virtual ~MHO_ClassIdentityMap ()
 
template<typename XClassType >
void AddClassType ()
 Function AddClassType, adds a class of a particular type to the identity map. More...
 
template<typename XClassType >
void AddClassType (const XClassType &obj)
 Function AddClassType, overload provided for passing object reference. More...
 
MHO_SerializableGenerateContainerFromUUID (const MHO_UUID &uuid)
 Generates a container from a UUID and returns a ptr to MHO_Serializable if found in factory map. More...
 
template<typename XClassType >
std::string GetClassNameFromObject (const XClassType &obj)
 Getter for class name from object. More...
 
std::string GetClassNameFromUUID (const MHO_UUID &uuid) const
 Getter for class name from uuid. More...
 
template<typename XClassType >
MHO_UUID GetUUIDFor () const
 Getter for uuid for a class type. More...
 
MHO_UUID GetUUIDFromClassName (const std::string &name) const
 Getter for uuid from class name. More...
 
bool IsTypePresent (const MHO_UUID &uuid) const
 Checks if a UUID is present in the class name map. More...
 

Protected Member Functions

void AddToMap (const MHO_UUID &type_uuid, const std::string &name)
 Adds an entry to the UUID-name map and its reverse map. More...
 

Protected Attributes

std::map< std::string, MHO_UUIDfClassName2UUID
 
std::map< MHO_UUID, MHO_SerializableObjectFactory * > fFactoryMap
 
std::map< MHO_UUID, MHO_JSONConverter * > fJSONConverterMap
 
MHO_MD5HashGenerator fMD5Generator
 
std::map< MHO_UUID, std::string > fUUID2ClassName
 

Detailed Description

Class MHO_ClassIdentityMap.

Author
J. Barrett - barre.nosp@m.ttj@.nosp@m.mit.e.nosp@m.du
Date
Thu Apr 29 12:30:28 2021 -0400

Constructor & Destructor Documentation

◆ MHO_ClassIdentityMap()

hops::MHO_ClassIdentityMap::MHO_ClassIdentityMap ( )
inline

◆ ~MHO_ClassIdentityMap()

virtual hops::MHO_ClassIdentityMap::~MHO_ClassIdentityMap ( )
inlinevirtual

Member Function Documentation

◆ AddClassType() [1/2]

template<typename XClassType >
void hops::MHO_ClassIdentityMap::AddClassType ( )
inline

Function AddClassType, adds a class of a particular type to the identity map.

when a class is added to the identity map, this also creates a MHO_SerializableObjectFactory and MHO_ContainerJSONConverter that are dedicated to handling objects of this type

◆ AddClassType() [2/2]

template<typename XClassType >
void hops::MHO_ClassIdentityMap::AddClassType ( const XClassType &  obj)
inline

Function AddClassType, overload provided for passing object reference.

Parameters
obj(const XClassType&)
Returns
Return value (template< typename XClassType > void)

◆ AddToMap()

void hops::MHO_ClassIdentityMap::AddToMap ( const MHO_UUID type_uuid,
const std::string &  name 
)
inlineprotected

Adds an entry to the UUID-name map and its reverse map.

Parameters
type_uuidThe UUID of the type to add.
nameThe name associated with the given UUID.

◆ GenerateContainerFromUUID()

MHO_Serializable* hops::MHO_ClassIdentityMap::GenerateContainerFromUUID ( const MHO_UUID uuid)
inline

Generates a container from a UUID and returns a ptr to MHO_Serializable if found in factory map.

Parameters
uuidInput UUID to search for in factory map

returns a ptr to base class MHO_Serializable, but the underlying type is that which is associated with the uuid, if the uuid is not in the factory map then nullptr is returned, memory managment is delegated to the caller

Returns
MHO_Serializable* object pointer or nullptr if UUID not found

◆ GetClassNameFromObject()

template<typename XClassType >
std::string hops::MHO_ClassIdentityMap::GetClassNameFromObject ( const XClassType &  obj)
inline

Getter for class name from object.

Parameters
objInput object of type XClassType& to retrieve its class name.
Returns
String representation of the input object's class name.

◆ GetClassNameFromUUID()

std::string hops::MHO_ClassIdentityMap::GetClassNameFromUUID ( const MHO_UUID uuid) const
inline

Getter for class name from uuid.

Parameters
uuidInput UUID to lookup its corresponding class name
Returns
Class name as string; 'unknown' if not found

◆ GetUUIDFor()

template<typename XClassType >
MHO_UUID hops::MHO_ClassIdentityMap::GetUUIDFor ( ) const
inline

Getter for uuid for a class type.

Returns
MHO_UUID corresponding to the input class type

◆ GetUUIDFromClassName()

MHO_UUID hops::MHO_ClassIdentityMap::GetUUIDFromClassName ( const std::string &  name) const
inline

Getter for uuid from class name.

Parameters
nameClass name to search for
Returns
UUID corresponding to the input class name if found

◆ IsTypePresent()

bool hops::MHO_ClassIdentityMap::IsTypePresent ( const MHO_UUID uuid) const
inline

Checks if a UUID is present in the class name map.

Parameters
uuidThe UUID to search for.
Returns
True if the UUID is found, false otherwise.

Member Data Documentation

◆ fClassName2UUID

std::map< std::string, MHO_UUID > hops::MHO_ClassIdentityMap::fClassName2UUID
protected

◆ fFactoryMap

std::map< MHO_UUID, MHO_SerializableObjectFactory* > hops::MHO_ClassIdentityMap::fFactoryMap
protected

◆ fJSONConverterMap

std::map< MHO_UUID, MHO_JSONConverter* > hops::MHO_ClassIdentityMap::fJSONConverterMap
protected

◆ fMD5Generator

MHO_MD5HashGenerator hops::MHO_ClassIdentityMap::fMD5Generator
protected

◆ fUUID2ClassName

std::map< MHO_UUID, std::string > hops::MHO_ClassIdentityMap::fUUID2ClassName
protected

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