Ocular Engine
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
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>
38
class
SceneObjectRegistrar
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
50
~
SceneObjectRegistrar
()
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
Ocular
Note: Once this library is made dynamic, this will no longer be needed.
Definition:
Common.hpp:70
Ocular::Core::SceneObjectRegistrar
Definition:
SceneObjectRegistrar.hpp:38
OcularCore
include
Scene
SceneObjectRegistrar.hpp
Generated on Tue Oct 18 2016 01:28:56 for Ocular Engine by
1.8.10