ADTF  3.18.2
cRPCObjectsRegistry::cLockedRPCObjectfinal

Implements thread safe access to the rpc::IRPCObject object. More...

Public Member Functions

 cLockedRPCObject ()=default
 Default CTOR.
 
 cLockedRPCObject (const tRPCItem &oItem)
 Construct with an tRPCItem and lock the shared mutex. More...
 
 ~cLockedRPCObject ()
 DTOR, unlocking any shared lock if previously locked.
 
 cLockedRPCObject (const cLockedRPCObject &other)
 Create a copy from other and add lock to the shared mutex. More...
 
cLockedRPCObjectoperator= (const cLockedRPCObject &other)
 Copy assignment from other. More...
 
 cLockedRPCObject (cLockedRPCObject &&)=default
 Default move construction.
 
cLockedRPCObjectoperator= (cLockedRPCObject &&)=default
 Default move assignment.
 
IRPCObjectoperator-> ()
 Pointer like access to rpc object protected by *this via a shared lock. More...
 
 operator bool () const
 Bool conversion operator. More...
 

Private Types

typedef std::pair< a_util::concurrency::shared_mutex *, IRPCObject * > tRPCRawItem
 

Private Attributes

tRPCRawItem m_oItem
 

Detailed Description

Implements thread safe access to the rpc::IRPCObject object.

Definition at line 48 of file rpc_object_registry.h.

Constructor & Destructor Documentation

◆ cLockedRPCObject() [1/2]

cLockedRPCObject ( const tRPCItem oItem)

Construct with an tRPCItem and lock the shared mutex.

Parameters
[in]oItemThe rpc item to gain exclusive access on

◆ cLockedRPCObject() [2/2]

cLockedRPCObject ( const cLockedRPCObject other)

Create a copy from other and add lock to the shared mutex.

Parameters
[in]otherOther object to create *this from

Member Function Documentation

◆ operator bool()

operator bool ( ) const

Bool conversion operator.

Returns
true if the rpc item is not nullptr, false otherwise.

◆ operator->()

IRPCObject* operator-> ( )

Pointer like access to rpc object protected by *this via a shared lock.

Returns
Pointer to locked rpc object. Might be nullptr.

◆ operator=()

cLockedRPCObject& operator= ( const cLockedRPCObject other)

Copy assignment from other.

Parameters
[in]otherOther object to assign *this from