Pol  Revision:cb584c9
reftypes.h
Go to the documentation of this file.
1 
7 #ifndef REFTYPES_H
8 #define REFTYPES_H
9 #include "../clib/refptr.h"
10 
11 namespace Pol
12 {
13 namespace Accounts
14 {
15 class Account;
16 }
17 namespace Mobile
18 {
19 class Character;
20 class NPC;
21 }
22 namespace Items
23 {
24 class Item;
25 }
26 
27 namespace Core
28 {
29 #ifdef NDEBUG
30 // release mode
31 #define REFTYPE_DEBUG 0
32 #else
33 // debug mode
34 #define REFTYPE_DEBUG 0
35 #endif
36 
37 class UObject;
38 
39 
40 #if !REFTYPE_DEBUG
46 #else
47 class UObjectRef : public ref_ptr<UObject>
48 {
49 public:
50  explicit UObjectRef( UObject* ptr = 0 );
51  UObjectRef( const UObjectRef& rptr );
52  ~UObjectRef();
53 };
54 
55 class CharacterRef : public ref_ptr<Mobile::Character>
56 {
57 public:
58  explicit CharacterRef( Mobile::Character* chr );
59  CharacterRef( const CharacterRef& rptr );
60  ~CharacterRef();
61 
62  CharacterRef& operator=( const CharacterRef& rptr );
63  void set( Mobile::Character* chr );
64  void clear();
65 
66  unsigned int cref_instance;
67 };
68 
69 class ItemRef : public ref_ptr<Items::Item>
70 {
71 public:
72  explicit ItemRef( Items::Item* item = 0 );
73  ItemRef( const ItemRef& rptr );
74  ~ItemRef();
75 };
76 
77 class NpcRef : public ref_ptr<Mobile::NPC>
78 {
79 public:
80  explicit NpcRef( Mobile::NPC* npc = 0 );
81  NpcRef( const NpcRef& rptr );
82  ~NpcRef();
83 };
84 
86 
87 #endif
88 }
89 }
90 
91 #endif
ref_ptr< UObject > UObjectRef
Definition: reftypes.h:37
ref_ptr< Mobile::NPC > NpcRef
Definition: reftypes.h:44
ref_ptr< Mobile::Character > CharacterRef
Definition: reftypes.h:42
ref_ptr< Items::Item > ItemRef
Definition: reftypes.h:43
ref_ptr< Accounts::Account > AccountRef
Definition: reftypes.h:45
Definition: berror.cpp:12