DataElement Class Reference

Base class for all data elements. More...

#include <DataElement.h>

Inheritance diagram for DataElement:

Inheritance graph

List of all members.

Public Member Functions

virtual DataDescriptorgetDataDescriptor ()=0
virtual const DataDescriptorgetDataDescriptor () const =0
virtual std::string getType () const =0
virtual std::string getFilename () const =0
virtual DataElementgetParent () const =0
virtual std::vector< std::string > getParentDesignator () const =0
virtual ClassificationgetClassification ()=0
virtual const ClassificationgetClassification () const =0
virtual void setClassification (const Classification *pClassification)=0
virtual void copyClassification (const DataElement *pElement)=0
virtual DynamicObjectgetMetadata ()=0
virtual const DynamicObjectgetMetadata () const =0
virtual DataElementcopy (const std::string &name, DataElement *pParent) const =0

Protected Member Functions

virtual ~DataElement ()


Detailed Description

Base class for all data elements.

The DataElement is a base class for all objects that are managed by ModelServices within the application. This class only stores anscillary data in a DataDescriptor object, where subclasses store or manage the actual raw data. An instance of this class can be created to provide an element container for custom data not provided by the subclasses.

This subclass of Subject will notify upon the following conditions:

See also:
Subject, Serializable, DataDescriptor

Definition at line 41 of file DataElement.h.


Constructor & Destructor Documentation

virtual DataElement::~DataElement (  )  [protected, virtual]

This should be destroyed by calling ModelServices::destroyElement.

Definition at line 250 of file DataElement.h.


Member Function Documentation

virtual DataDescriptor* DataElement::getDataDescriptor (  )  [pure virtual]

Returns all anscillary data for the element.

Returns:
A pointer to the DataDescriptor object containing the element anscillary data.

virtual const DataDescriptor* DataElement::getDataDescriptor (  )  const [pure virtual]

Returns read-only access to all anscillary data for the element.

Returns:
A const pointer to the DataDescriptor object containing the element anscillary data. The data represented by the returned pointer should not be modified. To modify the values, call the non-const version of getDataDescriptor().

virtual std::string DataElement::getType (  )  const [pure virtual]

Returns the identifying type for the element.

This is a convenience method that returns the element type that is stored in the DataDescriptor object.

The element type is one of the unique identifiers for a DataElement that is used to query elements in the ModelServices interface.

Returns:
The element type. The returned type will be one of the valid element type strings returned by ModelServices::getValidElementTypes(), which may not be the same type returned by getObjectType().
See also:
DataDescriptor::getType(), ModelServices::getElement()

virtual std::string DataElement::getFilename (  )  const [pure virtual]

Returns the filename where the element is saved on disk.

This is a convenience method that returns the filename that is stored in the FileDecriptor object contained in the element's DataDescriptor object.

Returns:
The element filename. An empty string is returned if the element was not originally imported from a file on disk.
See also:
FileDescriptor::getFilename()

virtual DataElement* DataElement::getParent (  )  const [pure virtual]

Returns the parent element.

This is a convenience method that returns the parent element that is stored in the DataDescriptor object. The element parent is typically the data set to which the element is associated.

The parent element is one of the unique identifiers for a DataElement that is used to query elements in the ModelServices interface.

Returns:
The element's associated parent element. NULL is returned if the element does not have a parent.
See also:
DataDescriptor::getParentElement(), ModelServices::getElement()

virtual std::vector<std::string> DataElement::getParentDesignator (  )  const [pure virtual]

Returns the parent element designator.

The parent element designator is a vector of strings such that the first string is the name of a top level element, the second is the name of a child of that element, and so on. This designator identifies the parent element.

Returns:
A parent element designator
See also:
getParent(), ModelServices::createDataDescriptor(const std::string&,const std::string&, const std::vector<std::string>&) const

virtual Classification* DataElement::getClassification (  )  [pure virtual]

Returns a pointer to the element's classification object.

The classification object documents how the data in the element is to be handled and/or restricted.

This is a convenience method that returns the classification object that is stored in the DataDescriptor object.

Returns:
A pointer to the element's classification object.
See also:
DataDescriptor::getClassification(), Classification

virtual const Classification* DataElement::getClassification (  )  const [pure virtual]

Returns read-only access to the element's classification object.

The classification object documents how the data in the element is to be handled and/or restricted.

This is a convenience method that returns the classification object that is stored in the DataDescriptor object.

Returns:
A const pointer to the element's classification object. The classification represented by the returned pointer should not be modified. To modify the values, call the non-const version of getClassification() instead.
See also:
DataDescriptor::getClassification(), Classification

virtual void DataElement::setClassification ( const Classification pClassification  )  [pure virtual]

Sets the element's classification object.

The classification object documents how the data in element is to be handled and/or restricted.

This is a convenience method that makes a deep copy of the given classification object that is stored in its DataDescriptor object, so it is the responsibility of the calling object to delete the classification object when necessary.

Parameters:
pClassification The classification for the element. A deep copy is performed so it is the responsibility of the calling object to delete the given classification object when necessary. This method does nothing if NULL is passed in.
See also:
DataDescriptor::setClassification(), Classification

virtual void DataElement::copyClassification ( const DataElement pElement  )  [pure virtual]

Copies the classification settings from a DataElement.

This is a convenience method that deep copies the Classification object that is stored in the DataDescriptor object of another DataElement into the DataDescriptor object of this DataElement. The existing classification settings for this DataElement are replaced by the settings from the passed DataElement. No attempt is made to merge the settings.

Parameters:
pElement The DataElement from which the Classification object will be copied.
See also:
DataDescriptor::getClassification(), DataDescriptor::setClassification(), Classification

virtual DynamicObject* DataElement::getMetadata (  )  [pure virtual]

Returns a pointer to the element's metadata values.

This is a convenience method that returns the metadata object that is stored in the DataDescriptor object.

Please see Special Metadata for details on special entries in the metadata that the application will attempt to use.

Returns:
A pointer to the element's metadata as a DynamicObject.
See also:
DataDescriptor::getMetadata(), DynamicObject

virtual const DynamicObject* DataElement::getMetadata (  )  const [pure virtual]

Returns read-only access to the element's metadata values.

This is a convenience method that returns the metadata object that is stored in the DataDescriptor object.

Please see Special Metadata for details on special entries in the metadata that the application will attempt to use.

Returns:
A const pointer to the element's metadata as a DynamicObject. The metadata represented by the returned pointer should not be modified. To modify the values, call the non-const version of getMetadata().
See also:
DataDescriptor::getMetadata(), DynamicObject

virtual DataElement* DataElement::copy ( const std::string &  name,
DataElement pParent 
) const [pure virtual]

Creates a new data element with the same values as this element.

The method creates a new element based on the data contained in this element, which includes a copy of all data in the data descriptor.

Parameters:
name The name for the created data element, which can be the same as this object's name if the parent is different than this object's parent.
pParent The parent element for the created data element, which can be the same as this object's parent if the name is different than this object's name.
Returns:
A pointer to the new data element. NULL is returned if the element cannot be copied or if the given parent is the same as this object's parent.


Software Development Kit - Opticks 4.9.0 Build 16218