AnyData Class Reference

Container for custom data stored in an Any element. More...

#include <AnyData.h>

Inheritance diagram for AnyData:

Inheritance graph

List of all members.

Public Member Functions

virtual ~AnyData ()
virtual AnyDatacopy () const
virtual bool serialize (SessionItemSerializer &serializer) const
virtual bool deserialize (SessionItemDeserializer &deserializer)

Protected Member Functions

 AnyData ()


Detailed Description

Container for custom data stored in an Any element.

This class serves as a common base class for custom data classes to be set into an Any element. The constructor is protected since this base class does not contain any actual data and should not be instantiated.

Definition at line 23 of file AnyData.h.


Constructor & Destructor Documentation

virtual AnyData::~AnyData (  )  [virtual]

Destroys the custom data object.

The destructor is called by the Any element when the element is destroyed. Subclasses should perform any necessary cleanup in their own destructor.

Definition at line 33 of file AnyData.h.

AnyData::AnyData (  )  [protected]

Creates the custom data object.

The constructor is protected since this base class does not contain any actual data and should not be instantiated.

Definition at line 97 of file AnyData.h.


Member Function Documentation

virtual AnyData* AnyData::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 returns NULL so subclasses should override this method to create a new instance of the object and copy the actual data. Each subclass can define whether it performs a deep copy or a shallow copy.

Returns:
A pointer to a new data object containing a copy of this data. The default implementation returns NULL. If NULL is returned, the Any::copy() method will also return NULL.

Reimplemented in DataVariantAnyData.

Definition at line 50 of file AnyData.h.

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

Serializes the AnyData during save session.

This is equivalent to SessionItem::serialize() for AnyData objects.

Parameters:
serializer The object to use to save the item as part of the current ` session.
Returns:
The default implementation simply returns true.
See also:
SessionItem::serialize()

Reimplemented in DataVariantAnyData.

Definition at line 68 of file AnyData.h.

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

Deserializes the AnyData during restore session.

This is equivalent to SessionItem::deserialize() for AnyData objects.

Parameters:
deserializer The object to use to restore the item from a saved session.
Returns:
The default implementation simply returns true.
See also:
SessionItem::deserialize()

Reimplemented in DataVariantAnyData.

Definition at line 85 of file AnyData.h.


Software Development Kit - Opticks 4.9.0 Build 16218