Atlas-C++
Dispatcher.h
1 // This file may be redistributed and modified only under the terms of
2 // the GNU Lesser General Public License (See COPYING for details).
3 // Copyright 2000-2001 Stefanus Du Toit and Aloril.
4 // Copyright 2001-2005 Alistair Riddoch.
5 // Copyright 2011 Erik Ogenvik.
6 // Automatically generated using gen_cpp.py.
7 
8 #ifndef ATLAS_OBJECTS_DISPATCHER_H
9 #define ATLAS_OBJECTS_DISPATCHER_H
10 
11 
12 #include <Atlas/Objects/Decoder.h>
13 
14 #include <Atlas/Objects/Root.h>
15 #include <Atlas/Objects/Entity.h>
16 #include <Atlas/Objects/Operation.h>
17 
18 namespace Atlas { namespace Objects {
19 
31 {
32  typedef void (Dispatcher::*objectArrivedPtr)(const Root&);
33  typedef std::map<int, objectArrivedPtr> methodMap_t;
34 public:
36  virtual ~Dispatcher();
37 
39  void addMethod(int, objectArrivedPtr method);
40 protected:
42  methodMap_t m_methods;
43 
45  virtual void unknownObjectArrived(const Root&) { }
46 
48  virtual void objectArrived(const Root&);
49 
51  virtual void dispatchObject(const Root& obj);
52 
54  virtual void objectRootArrived(const Root&) { }
60  virtual void objectAccountArrived(const Entity::Account&) { }
62  virtual void objectPlayerArrived(const Entity::Player&) { }
64  virtual void objectAdminArrived(const Entity::Admin&) { }
66  virtual void objectGameArrived(const Entity::Game&) { }
72  virtual void objectActionArrived(const Operation::Action&) { }
74  virtual void objectCreateArrived(const Operation::Create&) { }
76  virtual void objectCombineArrived(const Operation::Combine&) { }
78  virtual void objectDivideArrived(const Operation::Divide&) { }
82  virtual void objectTalkArrived(const Operation::Talk&) { }
84  virtual void objectDeleteArrived(const Operation::Delete&) { }
86  virtual void objectSetArrived(const Operation::Set&) { }
88  virtual void objectAffectArrived(const Operation::Affect&) { }
90  virtual void objectMoveArrived(const Operation::Move&) { }
92  virtual void objectWieldArrived(const Operation::Wield&) { }
94  virtual void objectGetArrived(const Operation::Get&) { }
96  virtual void objectPerceiveArrived(const Operation::Perceive&) { }
98  virtual void objectLookArrived(const Operation::Look&) { }
100  virtual void objectListenArrived(const Operation::Listen&) { }
102  virtual void objectSniffArrived(const Operation::Sniff&) { }
104  virtual void objectTouchArrived(const Operation::Touch&) { }
106  virtual void objectLoginArrived(const Operation::Login&) { }
108  virtual void objectLogoutArrived(const Operation::Logout&) { }
112  virtual void objectUseArrived(const Operation::Use&) { }
114  virtual void objectInfoArrived(const Operation::Info&) { }
118  virtual void objectSightArrived(const Operation::Sight&) { }
124  virtual void objectSoundArrived(const Operation::Sound&) { }
126  virtual void objectSmellArrived(const Operation::Smell&) { }
128  virtual void objectFeelArrived(const Operation::Feel&) { }
130  virtual void objectErrorArrived(const Operation::Error&) { }
132  virtual void objectAnonymousArrived(const Entity::Anonymous&) { }
134  virtual void objectGenericArrived(const Operation::Generic&) { }
135 };
136 
137 } } // namespace Atlas::Objects
138 
139 #endif // ATLAS_OBJECTS_DISPATCHER_H
virtual void objectTouchArrived(const Operation::Touch &)
Override this to get called when a Touch object arrives.
Definition: Dispatcher.h:104
virtual void objectImaginaryArrived(const Operation::Imaginary &)
Override this to get called when a Imaginary object arrives.
Definition: Dispatcher.h:110
virtual void unknownObjectArrived(const Root &)
An unknown object has arrived.
Definition: Dispatcher.h:45
virtual void objectRootArrived(const Root &)
Override this to get called when a Root object arrives.
Definition: Dispatcher.h:54
virtual void objectPerceptionArrived(const Operation::Perception &)
Override this to get called when a Perception object arrives.
Definition: Dispatcher.h:116
virtual void objectAdminEntityArrived(const Entity::AdminEntity &)
Override this to get called when a AdminEntity object arrives.
Definition: Dispatcher.h:58
virtual void dispatchObject(const Root &obj)
call right object*Arrived method
virtual void objectAffectArrived(const Operation::Affect &)
Override this to get called when a Affect object arrives.
Definition: Dispatcher.h:88
virtual void objectDeleteArrived(const Operation::Delete &)
Override this to get called when a Delete object arrives.
Definition: Dispatcher.h:84
virtual void objectWieldArrived(const Operation::Wield &)
Override this to get called when a Wield object arrives.
Definition: Dispatcher.h:92
virtual void objectAppearanceArrived(const Operation::Appearance &)
Override this to get called when a Appearance object arrives.
Definition: Dispatcher.h:120
virtual void objectRootOperationArrived(const Operation::RootOperation &)
Override this to get called when a RootOperation object arrives.
Definition: Dispatcher.h:70
virtual void objectUseArrived(const Operation::Use &)
Override this to get called when a Use object arrives.
Definition: Dispatcher.h:112
virtual void objectSmellArrived(const Operation::Smell &)
Override this to get called when a Smell object arrives.
Definition: Dispatcher.h:126
virtual void objectPerceiveArrived(const Operation::Perceive &)
Override this to get called when a Perceive object arrives.
Definition: Dispatcher.h:96
virtual void objectActionArrived(const Operation::Action &)
Override this to get called when a Action object arrives.
Definition: Dispatcher.h:72
virtual void objectInfoArrived(const Operation::Info &)
Override this to get called when a Info object arrives.
Definition: Dispatcher.h:114
virtual void objectLogoutArrived(const Operation::Logout &)
Override this to get called when a Logout object arrives.
Definition: Dispatcher.h:108
virtual void objectCommunicateArrived(const Operation::Communicate &)
Override this to get called when a Communicate object arrives.
Definition: Dispatcher.h:80
virtual void objectSniffArrived(const Operation::Sniff &)
Override this to get called when a Sniff object arrives.
Definition: Dispatcher.h:102
virtual void objectMoveArrived(const Operation::Move &)
Override this to get called when a Move object arrives.
Definition: Dispatcher.h:90
virtual void objectAccountArrived(const Entity::Account &)
Override this to get called when a Account object arrives.
Definition: Dispatcher.h:60
virtual void objectDisappearanceArrived(const Operation::Disappearance &)
Override this to get called when a Disappearance object arrives.
Definition: Dispatcher.h:122
Objects hierarchy dispatcher.
Definition: Dispatcher.h:30
virtual void objectFeelArrived(const Operation::Feel &)
Override this to get called when a Feel object arrives.
Definition: Dispatcher.h:128
The Atlas namespace.
Definition: Bridge.h:20
virtual ~Dispatcher()
Default destructor.
virtual void objectCombineArrived(const Operation::Combine &)
Override this to get called when a Combine object arrives.
Definition: Dispatcher.h:76
virtual void objectRootEntityArrived(const Entity::RootEntity &)
Override this to get called when a RootEntity object arrives.
Definition: Dispatcher.h:56
virtual void objectLookArrived(const Operation::Look &)
Override this to get called when a Look object arrives.
Definition: Dispatcher.h:98
void addMethod(int, objectArrivedPtr method)
Add a new method for Objects class defined by application.
virtual void objectDivideArrived(const Operation::Divide &)
Override this to get called when a Divide object arrives.
Definition: Dispatcher.h:78
virtual void objectGameEntityArrived(const Entity::GameEntity &)
Override this to get called when a GameEntity object arrives.
Definition: Dispatcher.h:68
virtual void objectGenericArrived(const Operation::Generic &)
Override this to get called when a Generic object arrives.
Definition: Dispatcher.h:134
Objects hierarchy decoder.
Definition: Decoder.h:32
virtual void objectAdminArrived(const Entity::Admin &)
Override this to get called when a Admin object arrives.
Definition: Dispatcher.h:64
virtual void objectListenArrived(const Operation::Listen &)
Override this to get called when a Listen object arrives.
Definition: Dispatcher.h:100
virtual void objectSightArrived(const Operation::Sight &)
Override this to get called when a Sight object arrives.
Definition: Dispatcher.h:118
Definition: Decoder.h:16
virtual void objectErrorArrived(const Operation::Error &)
Override this to get called when a Error object arrives.
Definition: Dispatcher.h:130
virtual void objectSoundArrived(const Operation::Sound &)
Override this to get called when a Sound object arrives.
Definition: Dispatcher.h:124
virtual void objectSetArrived(const Operation::Set &)
Override this to get called when a Set object arrives.
Definition: Dispatcher.h:86
virtual void objectLoginArrived(const Operation::Login &)
Override this to get called when a Login object arrives.
Definition: Dispatcher.h:106
methodMap_t m_methods
Store extension methods for Objects classes defined by application.
Definition: Dispatcher.h:42
virtual void objectAnonymousArrived(const Entity::Anonymous &)
Override this to get called when a Anonymous object arrives.
Definition: Dispatcher.h:132
virtual void objectTalkArrived(const Operation::Talk &)
Override this to get called when a Talk object arrives.
Definition: Dispatcher.h:82
virtual void objectGameArrived(const Entity::Game &)
Override this to get called when a Game object arrives.
Definition: Dispatcher.h:66
virtual void objectArrived(const Root &)
An object has arrived for dispatch.
virtual void objectPlayerArrived(const Entity::Player &)
Override this to get called when a Player object arrives.
Definition: Dispatcher.h:62
virtual void objectCreateArrived(const Operation::Create &)
Override this to get called when a Create object arrives.
Definition: Dispatcher.h:74
virtual void objectGetArrived(const Operation::Get &)
Override this to get called when a Get object arrives.
Definition: Dispatcher.h:94

Copyright 2000-2004 the respective authors.

This document can be licensed under the terms of the GNU Free Documentation License or the GNU General Public License and may be freely distributed under the terms given by one of these licenses.