stromx  0.8.0
Public Member Functions | List of all members
stromx::runtime::WriteAccess Class Reference

Write access to a data container. More...

#include <WriteAccess.h>

Public Member Functions

 WriteAccess ()
 
 WriteAccess (const DataContainer &data)
 
 WriteAccess (const DataContainer &data, const unsigned int timeout)
 
bool empty () const
 
template<typename data_t >
data_t & get () const
 
Dataget () const
 
void release ()
 

Detailed Description

Write access to a data container.

A read access allows to read and change the content of a data container which contains data of the type data_t.

Constructor & Destructor Documentation

§ WriteAccess() [1/3]

stromx::runtime::WriteAccess::WriteAccess ( )
inline

Constructs an empty write access.

§ WriteAccess() [2/3]

stromx::runtime::WriteAccess::WriteAccess ( const DataContainer data)
explicit

Constructs a write access from a data container. This functions waits until write access is possible, i.e. until no other read or write access to data exists.

Parameters
dataThe container which contains the data to be accessed.
Exceptions
WrongArgumentThe container is read-only.

§ WriteAccess() [3/3]

stromx::runtime::WriteAccess::WriteAccess ( const DataContainer data,
const unsigned int  timeout 
)

Constructs a write access from a data container. This functions waits until write access is possible, i.e. until no other read or write access to data exists.

Parameters
dataThe container which contains the data to be accessed.
timeoutThe maximal time to wait in milliseconds.
Exceptions
TimeoutIf no read access could be obtained during the timeout.
WrongArgumentThe container is read-only.

Member Function Documentation

§ empty()

bool stromx::runtime::WriteAccess::empty ( ) const
inline

Returns true if the write access is empty.

§ get() [1/2]

template<typename data_t >
data_t& stromx::runtime::WriteAccess::get ( ) const
inline

Returns a casted reference to the content of the data container.

Exceptions
AccessEmptyIf the read access is empty.
BadCastIf the data can not be casted to data_t.

§ get() [2/2]

Data & stromx::runtime::WriteAccess::get ( ) const

Returns a reference to the content of the data container.

Exceptions
AccessEmptyIf the read access is empty.

§ release()

void stromx::runtime::WriteAccess::release ( )

Releases the write access. The access is empty after calling this function.


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