ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/server/include/util.h
(Generate patch)

Comparing deliantra/server/include/util.h (file contents):
Revision 1.21 by root, Thu Dec 21 06:12:36 2006 UTC vs.
Revision 1.24 by root, Mon Dec 25 11:25:49 2006 UTC

120 { 120 {
121 p->~Tp (); 121 p->~Tp ();
122 } 122 }
123}; 123};
124 124
125struct refcounted
126{
127 refcounted () : refcnt (0) { }
128// virtual ~refcounted ();
129 void refcnt_inc () { ++refcnt; }
130 void refcnt_dec () { --refcnt; }
131 bool dead () { return refcnt == 0; }
132 mutable int refcnt;
133#if 0
134private:
135 static refcounted *rc_first;
136 refcounted *rc_next;
137#endif
138};
139
140template<class T> 125template<class T>
141struct refptr 126struct refptr
142{ 127{
143 T *p; 128 T *p;
144 129
165 T &operator * () const { return *p; } 150 T &operator * () const { return *p; }
166 T *operator ->() const { return p; } 151 T *operator ->() const { return p; }
167 152
168 operator T *() const { return p; } 153 operator T *() const { return p; }
169}; 154};
155
156typedef refptr<maptile> maptile_ptr;
157typedef refptr<object> object_ptr;
158typedef refptr<archetype> arch_ptr;
159typedef refptr<client> client_ptr;
160typedef refptr<player> player_ptr;
170 161
171struct str_hash 162struct str_hash
172{ 163{
173 std::size_t operator ()(const char *s) const 164 std::size_t operator ()(const char *s) const
174 { 165 {

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines