IoTivity C++ SDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
OIC::Service::RCSResourceObject::LockGuard Class Reference

The class provides a convenient RAII-style mechanism for the attributes of a RCSResourceObject. More...

Public Member Functions

 LockGuard (const RCSResourceObject &rcsResourceObject)
 
 LockGuard (const RCSResourceObject::Ptr)
 
 LockGuard (const RCSResourceObject &object, AutoNotifyPolicy autoNotifyPolicy)
 Constructs a LockGuard with auto notify policy. More...
 
 LockGuard (const RCSResourceObject::Ptr, AutoNotifyPolicy)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. More...
 
 ~LockGuard () noexcept(false)
 
 LockGuard (const LockGuard &)=delete
 
 LockGuard (LockGuard &&)=delete
 
LockGuardoperator= (const LockGuard &)=delete
 
LockGuardoperator= (LockGuard &&)=delete
 

Detailed Description

The class provides a convenient RAII-style mechanism for the attributes of a RCSResourceObject.

When a LockGuard is created, it attempts to lock the attributes of the RCSResourceObject it is given. When control leaves the scope in which the LockGuard object was created, the LockGuard is destructed and the attributes is unlocked.

Additionally when it is destructed and only when destructed not by stack unwinding caused by an exception, it tries to notify depending on AutoNotifyPolicy.

Note
The destrcutor can throw an exception if auto notify failed.

Constructor & Destructor Documentation

OIC::Service::RCSResourceObject::LockGuard::LockGuard ( const RCSResourceObject rcsResourceObject)
OIC::Service::RCSResourceObject::LockGuard::LockGuard ( const RCSResourceObject::Ptr  )
OIC::Service::RCSResourceObject::LockGuard::LockGuard ( const RCSResourceObject object,
AutoNotifyPolicy  autoNotifyPolicy 
)

Constructs a LockGuard with auto notify policy.

Parameters
objectan object to be locked
autoNotifyPolicythe policy to indicate how auto notification is handled when the LockGuard is destructed.
OIC::Service::RCSResourceObject::LockGuard::LockGuard ( const RCSResourceObject::Ptr  ,
AutoNotifyPolicy   
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

OIC::Service::RCSResourceObject::LockGuard::~LockGuard ( )
noexcept
Exceptions
RCSPlatformExceptionIf auto notify operation failed.
Note
The exception will never be thrown while stack unwinding.
OIC::Service::RCSResourceObject::LockGuard::LockGuard ( const LockGuard )
delete
OIC::Service::RCSResourceObject::LockGuard::LockGuard ( LockGuard &&  )
delete

Member Function Documentation

LockGuard& OIC::Service::RCSResourceObject::LockGuard::operator= ( const LockGuard )
delete
LockGuard& OIC::Service::RCSResourceObject::LockGuard::operator= ( LockGuard &&  )
delete

The documentation for this class was generated from the following file: