Drive Engine  1.0.0
Plateforme de reconstruction 3D
ExportableFactory.h
1 // Copyright (c) 2015. All rights reserved to DriveEngine Team.
2 
3 #pragma once
4 
5 #include "IExportable.h"
6 #include "DynamicLibraryRecord.h"
7 #include <string>
8 #include <map>
9 
10 namespace DriveEngine
11 {
18  {
19  private:
20  class ConstructorRecord
21  {
22  public:
23  DynamicLibraryRecord dynamicLibraryRecord;
24  std::string constructorName;
25  ConstructorRecord(std::string constructorName, DynamicLibraryRecord dynamicLibraryRecord) : constructorName(constructorName), dynamicLibraryRecord(dynamicLibraryRecord) {};
26  };
27 
28  typedef std::map<std::string, ConstructorRecord> ConstructorRecords;
29  typedef std::pair<std::string, ConstructorRecord> ConstructorRecordPair;
30  static ConstructorRecords records;
31 
33  public:
34 
45  static IExportable* Create(const std::string& identifier);
46 
61  static void Load(const std::string& identifier, const std::string& constructorName, const std::string& path);
62 
63  private:
64  static bool ExportableFactory::IsRecordExist(const std::string& identifier);
65  static ConstructorRecords::iterator ExportableFactory::GetRecord(const std::string& identifier);
66  };
67 }
The exportable object factory.
Definition: ExportableFactory.h:17
static IExportable * Create(const std::string &identifier)
Creates a new exportable object.
Definition: ExportableFactory.cpp:40
Definition: DefaultCalibrationInfoList.h:12
static void Load(const std::string &identifier, const std::string &constructorName, const std::string &path)
Loads a function and register it with an unique identifier.
Definition: ExportableFactory.cpp:13
The main interface
Definition: IExportable.h:12
(Internal class) Dynamic library record
Definition: DynamicLibraryRecord.h:27