XLE
v0.02.0
|
Stores entity data generically More...
#include <RetainedEntities.h>
Classes | |
class | RegisteredObjectType |
Public Types | |
enum | ChangeType { SetProperty, Create, Delete, SetParent, AddChild, RemoveChild, ChildSetProperty, ChangeHierachy } |
using | OnChangeDelegate = std::function< void(const RetainedEntities &flexSys, const Identifier &, ChangeType) > |
Public Member Functions | |
const RetainedEntity * | GetEntity (DocumentId doc, ObjectId obj) const |
const RetainedEntity * | GetEntity (const Identifier &) const |
std::vector< const RetainedEntity * > | FindEntitiesOfType (ObjectTypeId typeId) const |
bool | RegisterCallback (ObjectTypeId typeId, OnChangeDelegate onChange) |
ObjectTypeId | GetTypeId (const utf8 name[]) const |
PropertyId | GetPropertyId (ObjectTypeId typeId, const utf8 name[]) const |
ChildListId | GetChildListId (ObjectTypeId typeId, const utf8 name[]) const |
std::basic_string< utf8 > | GetTypeName (ObjectTypeId id) const |
Protected Member Functions | |
RegisteredObjectType * | GetObjectType (ObjectTypeId id) const |
void | InvokeOnChange (RegisteredObjectType &type, RetainedEntity &obj, ChangeType changeType) const |
RetainedEntity * | GetEntityInt (DocumentId doc, ObjectId obj) const |
bool | SetSingleProperties (RetainedEntity &dest, const RegisteredObjectType &type, const PropertyInitializer &initializer) const |
Protected Attributes | |
ObjectId | _nextObjectId |
std::vector< RetainedEntity > | _objects |
std::vector< std::pair< ObjectTypeId, RegisteredObjectType > > | _registeredObjectTypes |
ObjectTypeId | _nextObjectTypeId |
Friends | |
class | RetainedEntityInterface |
Stores entity data generically
This implemention simply stores all information that comes from IObjectType in a generic data structure.
Clients can put callbacks on specific object types to watch for changes. This can make it easier to implement lightweight object types. Instead of having to implement the IEntityInterface, simply set a callback with RegisterCallback().
All of the properties and data related to that object will be available in the callback.