Atoms Crowd  7.0.0
AtomsCore::MetadataFactory Class Reference

Metadata factory. More...

#include <MetadataFactory.h>

Public Types

typedef Metadata *(* creatorFn) ()
 

Public Member Functions

AtomsPtr< MetadatacreateMetadata (const std::string &typeName)
 Create a metadata. More...
 
AtomsPtr< MetadatacreateMetadata (unsigned int id)
 Create a metadata. More...
 
MetadatacreateMetadataRawPtr (const std::string &typeName)
 Create a metadata. More...
 
MetadatacreateMetadataRawPtr (unsigned int &id)
 Create a metadata. More...
 
void registerMetadata (const std::string &name, unsigned int id, creatorFn funct)
 Register a metadata type to the factory. More...
 
void deregisterMetadata (const std::string &name)
 Deregister a metadata type from the factory. More...
 
std::vector< std::string > getRegisteredMetadata ()
 Get all registered metadata. More...
 
bool isRegistered (const std::string &name)
 Check if a metadata type is registered. More...
 
const std::string getMetadataName (unsigned int id)
 Get metadata name from id. More...
 

Static Public Member Functions

static MetadataFactoryinstance ()
 Singleton access.
 

Detailed Description

Metadata factory.

Metadata factory used to create different type of metadata.

Member Function Documentation

◆ createMetadata() [1/2]

AtomsPtr<Metadata> AtomsCore::MetadataFactory::createMetadata ( const std::string &  typeName)

Create a metadata.

Parameters
typeNamemetadata type
Returns
Smart pointer to the matadata created

◆ createMetadata() [2/2]

AtomsPtr<Metadata> AtomsCore::MetadataFactory::createMetadata ( unsigned int  id)

Create a metadata.

Parameters
idmetadata id
Returns
Smart pointer to the matadata created

◆ createMetadataRawPtr() [1/2]

Metadata* AtomsCore::MetadataFactory::createMetadataRawPtr ( const std::string &  typeName)

Create a metadata.

Parameters
typeNamemetadata type
Returns
Raw pointer to the matadata created

◆ createMetadataRawPtr() [2/2]

Metadata* AtomsCore::MetadataFactory::createMetadataRawPtr ( unsigned int &  id)

Create a metadata.

Parameters
idmetadata id
Returns
Raw pointer to the matadata created

◆ deregisterMetadata()

void AtomsCore::MetadataFactory::deregisterMetadata ( const std::string &  name)

Deregister a metadata type from the factory.

Parameters
nameMetadata type name

◆ getMetadataName()

const std::string AtomsCore::MetadataFactory::getMetadataName ( unsigned int  id)

Get metadata name from id.

Parameters
idmetadata id
Returns
Return name of the given metadata

◆ getRegisteredMetadata()

std::vector<std::string> AtomsCore::MetadataFactory::getRegisteredMetadata ( )

Get all registered metadata.

Returns
List of all metadata type registered

◆ isRegistered()

bool AtomsCore::MetadataFactory::isRegistered ( const std::string &  name)

Check if a metadata type is registered.

Parameters
nameMetadata type name
Returns
Return true if the type is already registered

◆ registerMetadata()

void AtomsCore::MetadataFactory::registerMetadata ( const std::string &  name,
unsigned int  id,
creatorFn  funct 
)

Register a metadata type to the factory.

Parameters
nameMetadata type name \patam funct creator function

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