DataVariantAnyData Class Reference

A custom data container for an Any element that contains a DataVariant. More...

#include <DataVariantAnyData.h>

Inheritance diagram for DataVariantAnyData:

Inheritance graph

List of all members.

Public Member Functions

 DataVariantAnyData ()
template<typename T>
 DataVariantAnyData (const T &value)
 ~DataVariantAnyData ()
AnyDatacopy () const
bool serialize (SessionItemSerializer &serializer) const
bool deserialize (SessionItemDeserializer &deserializer)
void setAttribute (const DataVariant &data)
DataVariantgetAttribute ()
const DataVariantgetAttribute () const


Detailed Description

A custom data container for an Any element that contains a DataVariant.

This subclass of AnyData is provided as a convenience for data that can be stored in a DataVariant.

Definition at line 27 of file DataVariantAnyData.h.


Constructor & Destructor Documentation

DataVariantAnyData::DataVariantAnyData (  ) 

Creates the custom data object.

This constructor creates an empty data object with an empty DataVariant. It can be called directly by plug-ins to create the custom data object to set into an Any element provided that the plug-in module will remain loaded for the lifetime of the element. Plug-ins should create this object from the ObjectFactory if the plug-in module will be unloaded before the Any element is destroyed.

Definition at line 40 of file DataVariantAnyData.h.

template<typename T>
DataVariantAnyData::DataVariantAnyData ( const T &  value  ) 

Creates and initializes the custom data object.

This constructor creates a data object and initializes the internal DataVariant with the given value. It can be called directly by plug-ins to create the custom data object to set into an Any element provided that the plug-in module will remain loaded for the lifetime of the element. Plug-ins must create an empty object from the ObjectFactory if the plug-in module will be unloaded before the Any element is destroyed.

Parameters:
value The data value with which the internal DataVariant is initialized.
See also:
setAttribute()

Definition at line 61 of file DataVariantAnyData.h.

DataVariantAnyData::~DataVariantAnyData (  ) 

Destroys the custom data object.

The destructor is called by the Any element when the element is destroyed. The internal DataVariant is deleted, thereby deleting the data it contains.

See also:
DataVariant::~DataVariant()

Definition at line 75 of file DataVariantAnyData.h.


Member Function Documentation

AnyData* DataVariantAnyData::copy (  )  const [virtual]

Creates a copy of the custom data.

This method is called when the Any::copy() method is called to copy the data element. The default implementation of this method creates a new DataVariantAnyData and sets the new internal DataVariant equal to this DataVariant.

Returns:
A pointer to a new DataVariantAnyData object containing a copy of this data.
See also:
DataVariant::operator=(const DataVariant&)

Reimplemented from AnyData.

Definition at line 92 of file DataVariantAnyData.h.

bool DataVariantAnyData::serialize ( SessionItemSerializer serializer  )  const [virtual]

Saves the DataVariant as part of a full session save.

Parameters:
serializer The object to use to save the DataVariant as part of the current session.
Returns:
Returns true if the DataVariant was successfully saved and false otherwise.

Reimplemented from AnyData.

Definition at line 110 of file DataVariantAnyData.h.

bool DataVariantAnyData::deserialize ( SessionItemDeserializer deserializer  )  [virtual]

Restores the DataVariant from a saved session.

Parameters:
deserializer The object to use to restore the DataVariant from a saved session.
Returns:
Returns true if the DataVariant was successfully restored and false otherwise.

Reimplemented from AnyData.

Definition at line 131 of file DataVariantAnyData.h.

void DataVariantAnyData::setAttribute ( const DataVariant data  ) 

Sets the custom data to set into an Any element.

Parameters:
data The custom data.

Definition at line 150 of file DataVariantAnyData.h.

DataVariant& DataVariantAnyData::getAttribute (  ) 

Returns the custom data to set into an Any element.

Returns:
A reference to the data variant storing the custom data. The data can be modified directly.

Definition at line 161 of file DataVariantAnyData.h.

const DataVariant& DataVariantAnyData::getAttribute (  )  const

Returns read-only access to the custom data to set into an Any element.

Returns:
A const reference to the data variant storing the custom data. The data represented by the returned reference should not be modified. To modify the values, call the non-const version of getAttribute().

Definition at line 174 of file DataVariantAnyData.h.


Software Development Kit - Opticks 4.9.0 Build 16218