eris 1.4.0
A WorldForge client library.
TypeService.h
1#ifndef ERIS_TYPE_SERVICE_H
2#define ERIS_TYPE_SERVICE_H
3
4#include <Atlas/Objects/ObjectsFwd.h>
5
6#include <sigc++/trackable.h>
7#include <sigc++/signal.h>
8
9#include <unordered_map>
10#include <set>
11#include <string>
12#include <memory>
13
14namespace Eris {
15
16class Connection;
17class TypeInfo;
18
19
23class TypeService : virtual public sigc::trackable
24{
25public:
26 explicit TypeService(Connection &con);
27 virtual ~TypeService();
28
29 void init();
30
34 TypeInfo* getTypeByName(const std::string &tynm);
35
38 TypeInfo* getTypeForAtlas(const Atlas::Objects::Root &obj);
39
41 TypeInfo* findTypeByName(const std::string &tynm);
42
44 sigc::signal<void, TypeInfo*> BoundType;
45
47 sigc::signal<void, TypeInfo*> BadType;
48
49 void handleOperation(const Atlas::Objects::Operation::RootOperation&);
50
54 void sendRequest(const std::string& id);
55
64 void setTypeProviderId(std::string id);
65
66protected:
67
68 void recvTypeInfo(const Atlas::Objects::Root &atype);
69 void recvError(const Atlas::Objects::Operation::Get& get);
70 void recvTypeUpdate(const Atlas::Objects::Root &atype);
71
72 TypeInfo* defineBuiltin(const std::string& name, TypeInfo* parent);
73
77 std::unordered_map<std::string, std::unique_ptr<TypeInfo>> m_types;
78
79 Connection& m_con;
80 bool m_inited;
81
85 std::string m_type_provider_id;
86};
87
88} // of namespace Eris
89
90#endif // of ERIS_TYPE_SERVICE_H
The representation of an Atlas type (i.e a class or operation definition). This class supports effice...
Definition: TypeInfo.h:33
std::unordered_map< std::string, std::unique_ptr< TypeInfo > > m_types
Definition: TypeService.h:77
void sendRequest(const std::string &id)
std::string m_type_provider_id
Definition: TypeService.h:85
TypeInfo * findTypeByName(const std::string &tynm)
Definition: TypeService.cpp:51
TypeInfo * getTypeForAtlas(const Atlas::Objects::Root &obj)
Definition: TypeService.cpp:77
sigc::signal< void, TypeInfo * > BoundType
Definition: TypeService.h:44
void setTypeProviderId(std::string id)
Set another provider of type data than the connection.
TypeInfo * getTypeByName(const std::string &tynm)
Definition: TypeService.cpp:61
sigc::signal< void, TypeInfo * > BadType
Definition: TypeService.h:47
Definition: Account.cpp:33