Ice 3.7 C++98 API Reference
Loading...
Searching...
No Matches
GCObject.h
Go to the documentation of this file.
1//
2// Copyright (c) ZeroC, Inc. All rights reserved.
3//
4
5#ifndef ICE_GC_OBJECT_H
6#define ICE_GC_OBJECT_H
7
8#ifndef ICE_CPP11_MAPPING
9
10#include <Ice/Object.h>
11
13#include <IceUtil/Mutex.h>
14
15namespace IceInternal
16{
17
18class GCObject;
19
20class GCVisitor
21{
22public:
23
24 virtual ~GCVisitor()
25 {
26 }
27
28 virtual bool visit(GCObject*) = 0;
29};
30
31class ICE_API GCObject : public virtual Ice::Object
32{
33public:
34
35 //
36 // Flags constant used for collection of graphs
37 //
38 static const unsigned char Collectable;
39 static const unsigned char CycleMember;
40 static const unsigned char Visiting;
41
42 //
43 // Override IceUtil::Shared methods
44 //
45 virtual void __incRef();
46 virtual void __decRef();
47 virtual int __getRef() const;
48 virtual void __setNoDelete(bool);
49
50 //
51 // Override Object methods
52 //
53 virtual bool _iceGcVisit(GCVisitor&);
54 virtual void ice_collectable(bool);
55
56 //
57 // This method is implemented by Slice classes to visit class
58 // members.
59 //
60 virtual void _iceGcVisitMembers(IceInternal::GCVisitor&) = 0;
61
62 int _iceGetRefUnsafe()
63 {
64 return _ref;
65 }
66
67private:
68
69 bool collect(IceUtilInternal::MutexPtrLock<IceUtil::Mutex>&);
70};
71
72}
73
74#endif
75
76#endif
#define ICE_API
Definition Config.h:197