Cogs.Core
DynamicComponent.h
1#pragma once
2
3#include "../../Base.h"
4
5#include "Foundation/ComponentModel/Entity.h"
6#include "Foundation/Reflection/TypeDatabase.h"
7
8#include <string>
9
10namespace Cogs
11{
12 namespace Core
13 {
14 class Context;
15
31 {
32 public:
34 COGSCORE_DLL_API static void registerType();
35
36 void * messageCallback = nullptr;
37 void * userData = nullptr;
38 size_t dynamicTypeInfoIndex = static_cast<size_t>(-1);
39
46 template<typename T>
48 {
49 return Reflection::TypeDatabase::createType<T>().template setBase<DynamicComponent>();
50 }
51 };
52 }
53}
54
55template<> inline Cogs::StringView getName<Cogs::Core::DynamicComponent>() { return "DynamicComponent"; }
Base class for Component instances.
Definition: Component.h:143
Base class for components implementing dynamic behavior.
static Reflection::Type & registerDerivedType()
Convenience method for registering the type of a derived component.
static COGSCORE_DLL_API void registerType()
Register the type in the type system.
Represents a discrete type definition, describing a native type class.
Definition: Type.h:89
Provides a weakly referenced view over the contents of a string.
Definition: StringView.h:24
Contains all Cogs related functionality.
Definition: FieldSetter.h:23