SmartFoxServer 2X C++ API
ISFSObject.h
1 // ===================================================================
2 //
3 // Description
4 // Contains the definition of ISFSObject interface
5 //
6 // Revision history
7 // Date Description
8 // 30-Nov-2012 First version
9 //
10 // ===================================================================
11 #ifndef __ISFSObject__
12 #define __ISFSObject__
13 
14 // Forward class declaration
15 namespace Sfs2X {
16 namespace Entities {
17 namespace Data {
18  class ISFSObject;
19 } // namespace Data
20 } // namespace Entities
21 } // namespace Sfs2X
22 
23 #include "../../Util/ByteArray.h"
24 #include "SFSDataWrapper.h"
25 #include "ISFSArray.h"
26 
27 #include <boost/shared_ptr.hpp> // Boost Asio shared pointer
28 
29 #if defined(_MSC_VER)
30 #pragma warning(disable:4786) // STL library: disable warning 4786; this warning is generated due to a Microsoft bug
31 #endif
32 #include <string> // STL library: string object
33 #include <vector> // STL library: vector object
34 using namespace std; // STL library: declare the STL namespace
35 
36 using namespace Sfs2X::Util;
37 
38 namespace Sfs2X {
39 namespace Entities {
40 namespace Data {
41 
45  class DLLImportExport ISFSObject
46  {
47  public:
55  virtual bool IsNull(string key) = 0;
56 
64  virtual bool IsNull(boost::shared_ptr<string> key) = 0;
65 
73  virtual bool ContainsKey(string key) = 0;
74 
82  virtual bool ContainsKey(boost::shared_ptr<string> key) = 0;
83 
89  virtual void RemoveElement(string key) = 0;
90 
96  virtual void RemoveElement(boost::shared_ptr<string> key) = 0;
97 
103  virtual boost::shared_ptr<vector<string> > GetKeys() = 0;
104 
110  virtual long int Size() = 0;
111 
117  virtual boost::shared_ptr<ByteArray> ToBinary() = 0;
118 
130  virtual boost::shared_ptr<string> GetDump(bool format) = 0;
131 
135  virtual boost::shared_ptr<string> GetDump() = 0; // default to true
136 
146  virtual boost::shared_ptr<string> GetHexDump() = 0;
147 
148  /*
149  * :::::::::::::::::::::::::::::::::::::::::
150  * Type getters
151  * :::::::::::::::::::::::::::::::::::::::::
152  */
153 
155  virtual boost::shared_ptr<SFSDataWrapper> GetData(string key) = 0;
156  virtual boost::shared_ptr<SFSDataWrapper> GetData(boost::shared_ptr<string> key) = 0;
157 
165  virtual boost::shared_ptr<bool> GetBool(string key) = 0;
166 
174  virtual boost::shared_ptr<bool> GetBool(boost::shared_ptr<string> key) = 0;
175 
183  virtual boost::shared_ptr<unsigned char> GetByte(string key) = 0;
184 
192  virtual boost::shared_ptr<unsigned char> GetByte(boost::shared_ptr<string> key) = 0;
193 
201  virtual boost::shared_ptr<short int> GetShort(string key) = 0;
202 
210  virtual boost::shared_ptr<short int> GetShort(boost::shared_ptr<string> key) = 0;
211 
219  virtual boost::shared_ptr<long int> GetInt(string key) = 0;
220 
228  virtual boost::shared_ptr<long int> GetInt(boost::shared_ptr<string> key) = 0;
229 
237  virtual boost::shared_ptr<long long> GetLong(string key) = 0;
238 
246  virtual boost::shared_ptr<long long> GetLong(boost::shared_ptr<string> key) = 0;
247 
255  virtual boost::shared_ptr<float> GetFloat(string key) = 0;
256 
264  virtual boost::shared_ptr<float> GetFloat(boost::shared_ptr<string> key) = 0;
265 
273  virtual boost::shared_ptr<double> GetDouble(string key) = 0;
274 
282  virtual boost::shared_ptr<double> GetDouble(boost::shared_ptr<string> key) = 0;
283 
291  virtual boost::shared_ptr<string> GetUtfString(string key) = 0;
292 
300  virtual boost::shared_ptr<string> GetUtfString(boost::shared_ptr<string> key) = 0;
301 
309  virtual boost::shared_ptr<string> GetText(string key) = 0;
310 
318  virtual boost::shared_ptr<string> GetText(boost::shared_ptr<string> key) = 0;
319 
327  virtual boost::shared_ptr<vector<bool> > GetBoolArray(string key) = 0;
328 
336  virtual boost::shared_ptr<vector<bool> > GetBoolArray(boost::shared_ptr<string> key) = 0;
337 
349  virtual boost::shared_ptr<ByteArray> GetByteArray(string key) = 0;
350 
362  virtual boost::shared_ptr<ByteArray> GetByteArray(boost::shared_ptr<string> key) = 0;
363 
371  virtual boost::shared_ptr<vector<short int> > GetShortArray(string key) = 0;
372 
380  virtual boost::shared_ptr<vector<short int> > GetShortArray(boost::shared_ptr<string> key) = 0;
381 
389  virtual boost::shared_ptr<vector<long int> > GetIntArray(string key) = 0;
390 
398  virtual boost::shared_ptr<vector<long int> > GetIntArray(boost::shared_ptr<string> key) = 0;
399 
407  virtual boost::shared_ptr<vector<long long> > GetLongArray(string key) = 0;
408 
416  virtual boost::shared_ptr<vector<long long> > GetLongArray(boost::shared_ptr<string> key) = 0;
417 
425  virtual boost::shared_ptr<vector<float> > GetFloatArray(string key) = 0;
426 
434  virtual boost::shared_ptr<vector<float> > GetFloatArray(boost::shared_ptr<string> key) = 0;
435 
443  virtual boost::shared_ptr<vector<double> > GetDoubleArray(string key) = 0;
444 
452  virtual boost::shared_ptr<vector<double> > GetDoubleArray(boost::shared_ptr<string> key) = 0;
453 
461  virtual boost::shared_ptr<vector<string> > GetUtfStringArray(string key) = 0;
462 
470  virtual boost::shared_ptr<vector<string> > GetUtfStringArray(boost::shared_ptr<string> key) = 0;
471 
481  virtual boost::shared_ptr<ISFSArray> GetSFSArray(string key) = 0;
482 
492  virtual boost::shared_ptr<ISFSArray> GetSFSArray(boost::shared_ptr<string> key) = 0;
493 
503  virtual boost::shared_ptr<ISFSObject> GetSFSObject(string key) = 0;
504 
514  virtual boost::shared_ptr<ISFSObject> GetSFSObject(boost::shared_ptr<string> key) = 0;
515 
585  virtual boost::shared_ptr<void> GetClass(string key) = 0;
586  virtual boost::shared_ptr<void> GetClass(boost::shared_ptr<string> key) = 0;
587 
588  /*
589  * :::::::::::::::::::::::::::::::::::::::::
590  * Type setters
591  * :::::::::::::::::::::::::::::::::::::::::
592  */
593 
595  virtual void PutNull(string key) = 0;
596  virtual void PutNull(boost::shared_ptr<string> key) = 0;
597 
604  virtual void PutBool(string key, boost::shared_ptr<bool> val) = 0;
605 
612  virtual void PutBool(boost::shared_ptr<string> key, boost::shared_ptr<bool> val) = 0;
613 
620  virtual void PutBool(string key, bool val) = 0;
621 
628  virtual void PutBool(boost::shared_ptr<string> key, bool val) = 0;
629 
636  virtual void PutByte(string key, boost::shared_ptr<unsigned char> val) = 0;
637 
644  virtual void PutByte(boost::shared_ptr<string> key, boost::shared_ptr<unsigned char> val) = 0;
645 
652  virtual void PutByte(string key, unsigned char val) = 0;
653 
660  virtual void PutByte(boost::shared_ptr<string> key, unsigned char val) = 0;
661 
668  virtual void PutShort(string key, boost::shared_ptr<short int> val) = 0;
669 
676  virtual void PutShort(boost::shared_ptr<string> key, boost::shared_ptr<short int> val) = 0;
677 
684  virtual void PutShort(string key, short int val) = 0;
685 
692  virtual void PutShort(boost::shared_ptr<string> key, short int val) = 0;
693 
700  virtual void PutInt(string key, boost::shared_ptr<long int> val) = 0;
701 
708  virtual void PutInt(boost::shared_ptr<string> key, boost::shared_ptr<long int> val) = 0;
709 
716  virtual void PutInt(string key, long int val) = 0;
717 
724  virtual void PutInt(boost::shared_ptr<string> key, long int val) = 0;
725 
732  virtual void PutLong(string key, boost::shared_ptr<long long> val) = 0;
733 
740  virtual void PutLong(boost::shared_ptr<string> key, boost::shared_ptr<long long> val) = 0;
741 
748  virtual void PutLong(string key, long long val) = 0;
749 
756  virtual void PutLong(boost::shared_ptr<string> key, long long val) = 0;
757 
764  virtual void PutFloat(string key, boost::shared_ptr<float> val) = 0;
765 
772  virtual void PutFloat(boost::shared_ptr<string> key, boost::shared_ptr<float> val) = 0;
773 
780  virtual void PutFloat(string key, float val) = 0;
781 
788  virtual void PutFloat(boost::shared_ptr<string> key, float val) = 0;
789 
796  virtual void PutDouble(string key, boost::shared_ptr<double> val) = 0;
797 
804  virtual void PutDouble(boost::shared_ptr<string> key, boost::shared_ptr<double> val) = 0;
805 
812  virtual void PutDouble(string key, double val) = 0;
813 
820  virtual void PutDouble(boost::shared_ptr<string> key, double val) = 0;
821 
828  virtual void PutUtfString(string key, boost::shared_ptr<string> val) = 0;
829 
836  virtual void PutUtfString(boost::shared_ptr<string> key, boost::shared_ptr<string> val) = 0;
837 
844  virtual void PutUtfString(string key, string val) = 0;
845 
852  virtual void PutUtfString(boost::shared_ptr<string> key, string val) = 0;
853 
860  virtual void PutText(string key, boost::shared_ptr<string> val) = 0;
861 
868  virtual void PutText(boost::shared_ptr<string> key, boost::shared_ptr<string> val) = 0;
869 
876  virtual void PutText(string key, string val) = 0;
877 
884  virtual void PutText(boost::shared_ptr<string> key, string val) = 0;
885 
892  virtual void PutBoolArray(string key, boost::shared_ptr<vector<bool> > val) = 0;
893 
900  virtual void PutBoolArray(boost::shared_ptr<string> key, boost::shared_ptr<vector<bool> > val) = 0;
901 
912  virtual void PutByteArray(string key, boost::shared_ptr<ByteArray> val) = 0;
913 
924  virtual void PutByteArray(boost::shared_ptr<string> key, boost::shared_ptr<ByteArray> val) = 0;
925 
932  virtual void PutShortArray(string key, boost::shared_ptr<vector<short int> > val) = 0;
933 
940  virtual void PutShortArray(boost::shared_ptr<string> key, boost::shared_ptr<vector<short int> > val) = 0;
941 
948  virtual void PutIntArray(string key, boost::shared_ptr<vector<long int> > val) = 0;
949 
956  virtual void PutIntArray(boost::shared_ptr<string> key, boost::shared_ptr<vector<long int> > val) = 0;
957 
964  virtual void PutLongArray(string key, boost::shared_ptr<vector<long long> > val) = 0;
965 
972  virtual void PutLongArray(boost::shared_ptr<string> key, boost::shared_ptr<vector<long long> > val) = 0;
973 
980  virtual void PutFloatArray(string key, boost::shared_ptr<vector<float> > val) = 0;
981 
988  virtual void PutFloatArray(boost::shared_ptr<string> key, boost::shared_ptr<vector<float> > val) = 0;
989 
996  virtual void PutDoubleArray(string key, boost::shared_ptr<vector<double> > val) = 0;
997 
1004  virtual void PutDoubleArray(boost::shared_ptr<string> key, boost::shared_ptr<vector<double> > val) = 0;
1005 
1012  virtual void PutUtfStringArray(string key, boost::shared_ptr<vector<string> > val) = 0;
1013 
1020  virtual void PutUtfStringArray(boost::shared_ptr<string> key, boost::shared_ptr<vector<string> > val) = 0;
1021 
1028  virtual void PutSFSArray(string key, boost::shared_ptr<ISFSArray> val) = 0;
1029 
1036  virtual void PutSFSArray(boost::shared_ptr<string> key, boost::shared_ptr<ISFSArray> val) = 0;
1037 
1044  virtual void PutSFSObject(string key, boost::shared_ptr<ISFSObject> val) = 0;
1045 
1052  virtual void PutSFSObject(boost::shared_ptr<string> key, boost::shared_ptr<ISFSObject> val) = 0;
1053 
1067  virtual void PutClass(string key, boost::shared_ptr<void> val) = 0;
1068 
1082  virtual void PutClass(boost::shared_ptr<string> key, boost::shared_ptr<void> val) = 0;
1083 
1085  virtual void Put(string key, boost::shared_ptr<SFSDataWrapper> val) = 0;
1086 
1088  virtual void Put(boost::shared_ptr<string> key, boost::shared_ptr<SFSDataWrapper> val) = 0;
1089  };
1090 
1091 } // namespace Data
1092 } // namespace Entities
1093 } // namespace Sfs2X
1094 
1095 #endif
STL namespace.
SFSObject interface
Definition: ISFSObject.h:45
Definition: BuddyOnlineState.h:15
Definition: SmartFox.cpp:24