* \brief The shared handle * * A shared handle provides access to an object that lives outside a space, * and is shared between entities that possibly reside inside different * spaces. * * This is the base class that all shared handles must inherit from. * */
| 44 | * |
| 45 | */ |
| 46 | class SharedHandle { |
| 47 | public: |
| 48 | /** |
| 49 | * \brief The shared object |
| 50 | * |
| 51 | * Shared objects must inherit from this base class. |
| 52 | */ |
| 53 | class GECODE_KERNEL_EXPORT Object : public HeapAllocated { |
| 54 | friend class SharedHandle; |
| 55 | private: |
| 56 | /// The counter used for reference counting |
| 57 | Support::RefCount rc; |
| 58 | public: |
| 59 | /// Initialize |
| 60 | Object(void); |
| 61 | /// Delete shared object |
| 62 | virtual ~Object(void); |
| 63 | }; |
| 64 | private: |
| 65 | /// The shared object |
| 66 | Object* o; |