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

Reference to a data object. More...

#include <DataRef.h>

Inheritance diagram for stromx::runtime::DataRef:
stromx::runtime::DataInterface

Public Member Functions

 DataRef ()
 
 DataRef (Data *data)
 
 DataRef (const Data &data)
 
 operator Data & ()
 
bool isNull () const
 
const std::tr1::shared_ptr< Data > & ptr () const
 
virtual const Versionversion () const
 
virtual const std::string & type () const
 
virtual const std::string & package () const
 
virtual const VariantHandlevariant () const
 
bool isVariant (const VariantInterface &v) const
 
virtual Dataclone () const
 
virtual void serialize (OutputProvider &out) const
 
virtual void deserialize (InputProvider &in, const Version &version)
 
- Public Member Functions inherited from stromx::runtime::DataInterface
bool isVariant (const VariantInterface &v) const
 

Detailed Description

Reference to a data object.

Data references hold a smart pointer to a data object. They can be copied and passed by value without copying the data object. Instances of this class are automatically casted to Data & references. If all copies of a data reference are out of scope the encapsulated data object is automatically deleted.

Constructor & Destructor Documentation

§ DataRef() [1/3]

stromx::runtime::DataRef::DataRef ( )
inline

Constructs an null data reference. For a null reference the behavior of all member functions with exceptoin of isNull() is undefined.

§ DataRef() [2/3]

stromx::runtime::DataRef::DataRef ( Data data)
explicit

Constructs a data reference from a pointer to a data object. The reference takes ownership of data.

§ DataRef() [3/3]

stromx::runtime::DataRef::DataRef ( const Data data)

Clones the object data and constructs a reference to the clone.

Member Function Documentation

§ clone()

Data * stromx::runtime::DataRef::clone ( ) const
virtual

Returns a copy of the data object, i.e. a object of the same type is allocated and the data of the original object is copied to the new object. A pointer to the new object is returned.

Implements stromx::runtime::DataInterface.

§ deserialize()

void stromx::runtime::DataRef::deserialize ( InputProvider in,
const Version version 
)
virtual

Deserializes a data object.

Parameters
outThe input which the data obtained from.
versionThe version of the data class which serialized the input.

Implements stromx::runtime::DataInterface.

§ isNull()

bool stromx::runtime::DataRef::isNull ( ) const
inline

Returns true if the data reference is a null reference, i.e. it was not initialized by a pointer to an object. Null references can not

§ operator Data &()

stromx::runtime::DataRef::operator Data & ( )
inline

Casts a data reference to Data &.

§ package()

const std::string & stromx::runtime::DataRef::package ( ) const
virtual

Returns the package of the class of this data object.

Implements stromx::runtime::DataInterface.

§ ptr()

const std::tr1::shared_ptr<Data>& stromx::runtime::DataRef::ptr ( ) const
inline

Returns the shared pointer which holds the data object internally.

§ serialize()

void stromx::runtime::DataRef::serialize ( OutputProvider out) const
virtual

Serializes this data object.

Parameters
outThe output which the data is sent to.

Implements stromx::runtime::DataInterface.

§ type()

const std::string & stromx::runtime::DataRef::type ( ) const
virtual

Returns the name of the class of this data object.

Implements stromx::runtime::DataInterface.

§ variant()

const VariantHandle & stromx::runtime::DataRef::variant ( ) const
virtual

Returns the data variant of this data object.

Implements stromx::runtime::DataInterface.

§ version()

const Version & stromx::runtime::DataRef::version ( ) const
virtual

Returns the version of the class of this data object.

Implements stromx::runtime::DataInterface.


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