Ocular Engine
SceneObjectRegistrar.hpp
1 
17 #pragma once
18 #ifndef __H__OCULAR_CORE_SCENE_OBJECT_REGISTRAR__H__
19 #define __H__OCULAR_CORE_SCENE_OBJECT_REGISTRAR__H__
20 
21 #include "OcularEngine.hpp"
22 
23 //------------------------------------------------------------------------------------------
24 
29 namespace Ocular
30 {
35  namespace Core
36  {
37  template<class T>
39  {
40  public:
41 
42  SceneObjectRegistrar(std::string const& name)
43  {
44  if(!OcularScene->getSceneObjectFactory().registerComponent<T>(name))
45  {
46  OcularLogger->error("Failed to register SceneObject with name '", name, "' as the name is already in use", OCULAR_INTERNAL_LOG("RoutineRegistrar", "RoutineRegistrar"));
47  }
48  }
49 
51  {
52 
53  }
54 
55  protected:
56 
57  private:
58  };
59  }
63 }
68 #define OCULAR_REGISTER_SCENEOBJECT(x,y) Ocular::Core::SceneObjectRegistrar<x> OCULAR_INTERNAL_SceneObjectRegistrar(y);
69 
70 //------------------------------------------------------------------------------------------
71 
72 #endif
Note: Once this library is made dynamic, this will no longer be needed.
Definition: Common.hpp:70
Definition: SceneObjectRegistrar.hpp:38