1 #ifndef MESSAGETYPEDATA_
2 #define MESSAGETYPEDATA_
4 #include "Tourist/AbstractMessage.h"
5 #include "Poco/DynamicFactory.h"
6 #include "Poco/Instantiator.h"
8 using Tourist::AbstractMessage
;
9 using Poco::DynamicFactory
;
10 using Poco::AbstractInstantiator
;
16 * Handles mapping between message type and actual object that
17 * contains logic for serialization and deserialization for that
28 typedef AbstractInstantiator
<AbstractMessage
> MessageInstantiator
;
30 int registerMessageObj(int type
, MessageInstantiator
* instance
);
32 AbstractMessage
* createInstance(int type
);
34 // cache transfer reuqest object id
35 const static int CACHE_XFER_REQ
;
37 // cache transfer reply object id
38 const static int CACHE_XFER_REP
;
40 //boot strap request method id
41 const static int BOOTSTRAP_REQ
;
43 const static int BOOTSTRAP_REP
;
45 const static int PEER_ANNOUNCE
;
47 const static int MULTICAST
;
50 DynamicFactory
<AbstractMessage
> dynFactory
;
52 //register builtin message objects.
53 void registerBuiltIns();
58 } // namespace Message
59 } // namespace Tourist
61 #endif /*MESSAGETYPEDATA_*/