iFun Engine API  1.0.0-b2936
Great Technology for Great Games
 All Classes Files Functions Variables Typedefs Macros
types.h
Go to the documentation of this file.
1 // Copyright (C) 2013-2015 iFunFactory Inc. All Rights Reserved.
2 //
3 // This work is confidential and proprietary to iFunFactory Inc. and
4 // must not be used, disclosed, copied, or distributed without the prior
5 // consent of iFunFactory Inc.
6 
9 #ifndef INCLUDE_FUNAPI_TYPES_H_
10 #define INCLUDE_FUNAPI_TYPES_H_
11 
12 #include <boost/bind.hpp>
13 #include <boost/function.hpp>
14 #include <boost/make_shared.hpp>
15 #include <boost/shared_ptr.hpp>
16 #include <boost/thread.hpp>
17 #include <boost/uuid/uuid.hpp>
18 #include <boost/uuid/uuid_io.hpp>
19 #include <boost/weak_ptr.hpp>
20 #include <funapi/network/fun_message.pb.h>
21 #include <stdint.h>
22 
23 #include <string>
24 #include <vector>
25 
26 
27 #define Ptr boost::shared_ptr
28 #define WeakPtr boost::weak_ptr
29 
30 
31 // Funapi default namespace.
32 namespace fun {
33 
35 using boost::shared_ptr;
36 
38 using boost::weak_ptr;
39 
41 using boost::bind;
42 
44 using boost::function;
45 
47 typedef boost::uuids::uuid Uuid;
48 
50 typedef std::string string;
51 
53 using ::FunMessage;
54 
58 enum ChainAction {
59  CONTINUE = 0,
60  STOP,
61  NULLIFY,
62  ABORT
64 };
65 
66 } // namespace fun
67 
68 
72 #define DECLARE_CLASS_PTR(CLS) \
73  static const Ptr<CLS> kNullPtr; \
74  static const WeakPtr<CLS> kNullWeakPtr;
75 
76 
81 #define DEFINE_CLASS_PTR(CLS) \
82  const Ptr<CLS> CLS::kNullPtr; \
83  const WeakPtr<CLS> CLS::kNullWeakPtr;
84 
85 
89 #define DECLARE_EVENT(Event) \
90  typedef fun::function<fun::ChainAction (Ptr<const Event>)> Handler;
91 
92 
93 #define DEPRECATED(func) func __attribute__((deprecated))
94 
95 #define ROLLBACK
96 #define ASSERT_NO_ROLLBACK
97 
98 #endif // INCLUDE_FUNAPI_TYPES_H_