Verovio
Source code documentation
vrv::ObjectFactory Class Reference

Public Member Functions

ObjectCreate (const std::string &name)
 Create the object from the MEI element string name by making a lookup in the register.
 
ObjectCreate (ClassId classId)
 Create the object from the ClassId by making a lookup in the register.
 
void Register (const std::string &name, ClassId classId, std::function< Object *(void)> function)
 Add the name / constructor map entry to the static register.
 
ClassId GetClassId (const std::string &name)
 Get the ClassId from the MEI element string name by making a lookup in the register.
 
std::string GetClassName (ClassId classId)
 Get the MEI element name from the ClassId by making a lookup in the register.
 
void GetClassIds (const std::vector< std::string > &classStrings, std::vector< ClassId > &classIds)
 Get the correspondings ClassIds from the vector of MEI element string names.
 

Static Public Member Functions

static ObjectFactoryGetInstance ()
 A static method returning a static object in order to guarantee initialisation.
 

Public Attributes

std::shared_mutex m_mutex
 
MapOfClassIdConstructors m_ctorsRegistry
 
MapOfStrClassIds m_classIdsRegistry
 

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