#include <Any.h>

Public Member Functions | |
| virtual void | setData (AnyData *pData)=0 |
| virtual AnyData * | getData ()=0 |
| virtual const AnyData * | getData () const =0 |
Protected Member Functions | |
| virtual | ~Any () |
The Any element provides storage for custom data types that are not inherently recognized by the data model. The element provides the means to set and get the custom data stored in the element via the AnyData class which serves as a common base class for all custom data objects.
The application provides one concrete subclass, DataVariantAnyData, that stores a single DataVariant value. If the plug-in module creating the DataVariantAnyData object will remain loaded for the lifetime of the Any element, the plug-in can create the object directly on the heap. If the plug-in module will be unloaded before the Any element is destroyed, the plug-in must create the DataVariantAnyData object from the ObjectFactory, which ensures that the Any element containing the object will be able to successfully delete it when the element is destroyed.
A plug-in can also create a subclass of AnyData to store custom data that cannot be set into a DataVariant, but the module containing that plug-in must remain loaded so that the Any element will be able to successfully delete the custom data when the element is destroyed.
This subclass of Subject will notify upon the following conditions:
Definition at line 47 of file Any.h.
| virtual Any::~Any | ( | ) | [protected, virtual] |
This should be destroyed by calling ModelServices::destroyElement().
| virtual void Any::setData | ( | AnyData * | pData | ) | [pure virtual] |
Sets the custom data managed by this element.
Ownership of the data is transferred to the element, so the calling object is not responsible for deleting the data. The element will delete the data when the element is destroyed.
| pData | A pointer to the custom data object. |
| virtual AnyData* Any::getData | ( | ) | [pure virtual] |
Returns a pointer to the custom data.
The calling object must cast the data to the proper pointer type to further manipulate it.
| virtual const AnyData* Any::getData | ( | ) | const [pure virtual] |
Returns read-only access to the custom data.
The calling object must cast the data to the proper pointer type to further access it.