#include <Signature.h>

Public Member Functions | |
| virtual const DataVariant & | getData (const std::string &name) const =0 |
| template<typename T> | |
| void | setData (const std::string &name, const T &data) |
| virtual void | adoptData (const std::string &name, DataVariant &data)=0 |
| virtual const Units * | getUnits (const std::string &name) const =0 |
| virtual std::set< std::string > | getDataNames () const =0 |
| virtual std::set< std::string > | getUnitNames () const =0 |
Static Public Member Functions | |
| static const std::string & | signalDataChanged () |
Protected Member Functions | |
| virtual | ~Signature () |
A signature is an object that essentially consists of a map of data sets, along with a map of optional Units objects. Each data set is referred to as a component of the signature. The unique name associated with each data set is called its component name and is the key for the map of data sets. The optional Units object associated with a data set is stored in a map using the data set component name as the key.
This subclass of Subject will notify upon the following conditions:
Definition at line 37 of file Signature.h.
| virtual Signature::~Signature | ( | ) | [protected, virtual] |
This should be destroyed by calling ModelServices::destroyElement.
Definition at line 169 of file Signature.h.
| static const std::string& Signature::signalDataChanged | ( | ) | [static] |
Emitted with any<std::pair<string,DataVariant> > when an attribute is added or changed.
Definition at line 43 of file Signature.h.
| virtual const DataVariant& Signature::getData | ( | const std::string & | name | ) | const [pure virtual] |
Gets a data set from the signature.
This method returns a data set from the signature in the form of a DataVariant.
| name | The name of the data set, as provided when the data set was added to the Signature. |
| void Signature::setData | ( | const std::string & | name, | |
| const T & | data | |||
| ) |
Adds a data set to the signature.
This method adds a data set to the signature. A deep copy of the value will be performed. If a data set already exists in the Signature with the name specified, it will be replaced with the new value.
This method is preferred to adoptData() unless you are passing an already constructed DataVariant in which case, adoptData() will be faster because it avoids a deep copy.
| name | The name of the data set to be added to the signature. | |
| data | The data set to be added to the Signature. For example: |
bool populateSignature(Signature *pSig, const vector<double> &wavelengths, const vector<double> &reflectances) { if (pSig == NULL) return false; pSig->setData("wavelengths", wavelengths); pSig->setData("reflectances", reflectances); return true; }
Definition at line 99 of file Signature.h.
| virtual void Signature::adoptData | ( | const std::string & | name, | |
| DataVariant & | data | |||
| ) | [pure virtual] |
Adds a data set to the signature.
This method adds a data set to the signature. A deep copy of the value will be performed. If a data set already exists in the Signature with the name specified, it will be replaced with the new value.
This method should not be used; generally setData() is preferred. This method and setData() have identical performance characteristics and setData() is easier to call. This method is faster than setData() though if you have an already constructed DataVariant and is preferred to setData() in this case.
| name | The name of the data set to be added to the signature. | |
| data | The data set to be added to the Signature. On return, this will contain the value previously stored. If the value did not previously exist, then this will contain an invalid DataVariant. |
| virtual const Units* Signature::getUnits | ( | const std::string & | name | ) | const [pure virtual] |
A convenience method that returns the Units object returned from calling SignatureDataDescriptor::getUnits.
| name | The component name of the Units object to get from the signature. |
NULL will be returned if no Units object exists with the specified name.| virtual std::set<std::string> Signature::getDataNames | ( | ) | const [pure virtual] |
| virtual std::set<std::string> Signature::getUnitNames | ( | ) | const [pure virtual] |