reference.h

#include <primo/platform/reference.h>

Includes

  • primo/platform/config.h

  • memory

Classes

Name

Description

primo::Reference

Base class for all objects that require reference management.

Namespaces

  • primo

Source

 1#ifndef ___PRIMO_PLATFORM_REFERENCE_H___
 2#define ___PRIMO_PLATFORM_REFERENCE_H___
 3
 4/** @file */
 5
 6#include <primo/platform/config.h>
 7
 8#include <memory>
 9
10/**	
11	Top namespace for all libraries developed by Primo Software Corp 
12*/
13namespace primo
14{
15/**
16	Base class for all objects that require reference management
17*/
18class Reference
19{
20public:
21	/**
22		Retains the instance. Increments the internal reference count.
23
24		@return the updated reference count.
25	*/
26	virtual int32_t retain() const = 0;
27
28	/**
29		Releases the instance. Decrements the internal reference count.
30
31		@return the new reference count.
32	*/
33	virtual int32_t release() const = 0;
34
35	/**
36		Returns the current reference count.
37
38		@return the current reference count.
39	*/
40	virtual int32_t retainCount() const = 0;
41};
42
43}
44
45#endif