eris 1.4.0
A WorldForge client library.
Factory.h
1#ifndef ERIS_FACTORY_H
2#define ERIS_FACTORY_H
3
4#include <Atlas/Objects/ObjectsFwd.h>
5#include "ViewEntity.h"
6
7namespace Eris {
8
9// forward decls
10class Entity;
11class View;
12class TypeInfo;
13
16{
17public:
18 virtual ~Factory();
20
23 virtual bool accept(const Atlas::Objects::Entity::RootEntity &ge, TypeInfo* type) = 0;
24
26 virtual std::unique_ptr<ViewEntity> instantiate(const Atlas::Objects::Entity::RootEntity &ge, TypeInfo* type, View& v) = 0;
27
31 virtual int priority();
32};
33
34} // of namespace Eris
35
36#endif
Factory is used to allow custom entity creation by client libraries.
Definition: Factory.h:16
virtual int priority()
Definition: Factory.cpp:11
virtual bool accept(const Atlas::Objects::Entity::RootEntity &ge, TypeInfo *type)=0
Accept is called by the world to test if this factory can instantiate the specified object.
virtual std::unique_ptr< ViewEntity > instantiate(const Atlas::Objects::Entity::RootEntity &ge, TypeInfo *type, View &v)=0
create whatever entity the client desires
The representation of an Atlas type (i.e a class or operation definition). This class supports effice...
Definition: TypeInfo.h:33
Definition: Account.cpp:33