SmartFoxServer 2X C++ API
BaseEvent.h
1 // ===================================================================
2 //
3 // Description
4 // Contains the definition of BaseEvent
5 //
6 // Revision history
7 // Date Description
8 // 30-Nov-2012 First version
9 //
10 // ===================================================================
11 #ifndef __BaseEvent__
12 #define __BaseEvent__
13 
14 #include "../Util/Common.h"
15 #include <stdio.h>
16 
17 #include <boost/shared_ptr.hpp> // Boost Asio shared pointer
18 
19 #if defined(_MSC_VER)
20 #pragma warning(disable:4786) // STL library: disable warning 4786; this warning is generated due to a Microsoft bug
21 #endif
22 #include <string> // STL library: string object
23 #include <map> // STL library: map object
24 using namespace std; // Declare the STL namespace
25 
26 namespace Sfs2X {
27 namespace Core {
28 
34  class DLLImportExport BaseEvent
35  {
36  public:
37 
38  // -------------------------------------------------------------------
39  // Public methods
40  // -------------------------------------------------------------------
41 
42  BaseEvent();
43  BaseEvent(boost::shared_ptr<string> type);
44  BaseEvent(boost::shared_ptr<string> type, boost::shared_ptr<map<string, boost::shared_ptr<void> > > args);
45  ~BaseEvent();
46 
47  boost::shared_ptr<string> Type();
48  void Type(boost::shared_ptr<string> value);
49 
53  boost::shared_ptr<map<string, boost::shared_ptr<void> > > Params();
54  void Params(boost::shared_ptr<map<string, boost::shared_ptr<void> > > value);
55 
56  boost::shared_ptr<void> Target();
57  void Target(boost::shared_ptr<void> value);
58 
59  boost::shared_ptr<string> ToString();
60  boost::shared_ptr<BaseEvent> Clone();
61 
62  // -------------------------------------------------------------------
63  // Public members
64  // -------------------------------------------------------------------
65 
66  protected:
67  // -------------------------------------------------------------------
68  // Protected methods
69  // -------------------------------------------------------------------
70 
71  // -------------------------------------------------------------------
72  // Protected members
73  // -------------------------------------------------------------------
74 
75  boost::shared_ptr<map<string, boost::shared_ptr<void> > > arguments;
76  boost::shared_ptr<string> type;
77  boost::shared_ptr<void> target;
78 
79  private:
80 
81  // -------------------------------------------------------------------
82  // Private methods
83  // -------------------------------------------------------------------
84 
85  // -------------------------------------------------------------------
86  // Private members
87  // -------------------------------------------------------------------
88  };
89 
90 } // namespace Core
91 } // namespace Sfs2X
92 
93 #endif
STL namespace.
This is the Base class of all Events in the API
Definition: BaseEvent.h:34
Definition: SmartFox.cpp:24