XLE  v0.02.0
Classes | Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | Friends | List of all members
EntityInterface::RetainedEntities Class Reference

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 RetainedEntityGetEntity (DocumentId doc, ObjectId obj) const
 
const RetainedEntityGetEntity (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

RegisteredObjectTypeGetObjectType (ObjectTypeId id) const
 
void InvokeOnChange (RegisteredObjectType &type, RetainedEntity &obj, ChangeType changeType) const
 
RetainedEntityGetEntityInt (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
 

Detailed Description

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.


The documentation for this class was generated from the following files: