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

Read access to a data container. More...

#include <ReadAccess.h>

Public Member Functions

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

Detailed Description

Read access to a data container.

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

Constructor & Destructor Documentation

§ ReadAccess() [1/3]

stromx::runtime::ReadAccess::ReadAccess ( )
inline

Constructs an empty read access.

§ ReadAccess() [2/3]

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

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

Parameters
dataThe container which contains the data to be read.

§ ReadAccess() [3/3]

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

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

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

Member Function Documentation

§ empty()

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

Returns true if the read access is empty.

§ get() [1/2]

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

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

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

§ get() [2/2]

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

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

Exceptions
EmptyAccessIf the read access is empty.

§ release()

void stromx::runtime::ReadAccess::release ( )

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


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