ADTF  3.18.2
UncountedObject< Interface, Implementation >

Default implementation of a non-counting reference counter. More...

Inheritance diagram for UncountedObject< Interface, Implementation >:
[legend]

Public Member Functions

 UncountedObject ()=default
 Default CTOR.
 
template<typename... Args>
 UncountedObject (Args &&... args)
 CTOR constructing the managed resource. More...
 
virtual ~UncountedObject ()=default
 Default DTOR, provided to be consistent with rule-of-five.
 
void addReference () const override
 Noop.
 
void removeReference () const override
 Noop.
 
const Interface & getObject () const override
 Get a reference to the handled object's interface - provided for const correctness. More...
 
Interface & getObject () override
 Get a reference to the handled object's interface. More...
 

Private Member Functions

 UncountedObject (const UncountedObject &)=delete
 
UncountedObjectoperator= (UncountedObject &)=delete
 
 UncountedObject (UncountedObject &&)=delete
 
UncountedObjectoperator= (UncountedObject &&)=delete
 

Private Attributes

Implementation _resource
 Resource to manage.
 

Additional Inherited Members

- Protected Member Functions inherited from ReferenceCountedObjectInterface< Interface >
 ~ReferenceCountedObjectInterface ()
 DTOR.
 

Detailed Description

template<typename Interface, typename Implementation>
class a_util::result::detail::UncountedObject< Interface, Implementation >

Default implementation of a non-counting reference counter.

Template Parameters
InterfaceThe interface of the resource to handle
ImplementationThe type implementing the Interface type

Definition at line 104 of file reference_counted_object.h.

Constructor & Destructor Documentation

◆ UncountedObject()

UncountedObject ( Args &&...  args)
inline

CTOR constructing the managed resource.

Template Parameters
ArgsArgument types of the resource's constructor
Parameters
[in]argsValues to forward to the resource's constructor

Definition at line 121 of file reference_counted_object.h.

Member Function Documentation

◆ getObject() [1/2]

const Interface& getObject ( ) const
inlineoverridevirtual

Get a reference to the handled object's interface - provided for const correctness.

Returns
Const reference to the handled object

Implements ReferenceCountedObjectInterface< Interface >.

Definition at line 145 of file reference_counted_object.h.

References UncountedObject< Interface, Implementation >::_resource.

◆ getObject() [2/2]

Interface& getObject ( )
inlineoverridevirtual

Get a reference to the handled object's interface.

Returns
Reference to the handled object

Implements ReferenceCountedObjectInterface< Interface >.

Definition at line 154 of file reference_counted_object.h.

References UncountedObject< Interface, Implementation >::_resource.