Inherits IDataModel.
Inheritance diagram for MXADataModel:
Public Member Functions | |
virtual | ~MXADataModel () |
MXA_SHARED_POINTERS (MXADataModel) | |
MXA_TYPE_MACRO (MXADataModel) | |
float | getModelVersion () |
Returns the MXA File version that the model adheres to. | |
void | setModelVersion (float version) |
Sets the File Version of the MXA data file. | |
std::string | getModelType () |
Returns the type of file, should be MXA. | |
void | setModelType (const std::string &modelType) |
Sets the file type. Should be MHD or MXA. | |
void | setDefaultTypeAndVersion () |
Sets the model type and version to the latest supported by this API. | |
void | setDataRoot (const std::string &dataRoot) |
Sets the "Data Root". | |
std::string | getDataRoot () |
Returns the Data Root Value. | |
void | addDataDimension (IDataDimension::Pointer dimension) |
Adds a Data Dimension to the end of the Data Dimension data structure thus making the index of the added dimension the largest of all the dimensions. | |
IDataDimension::Pointer | addDataDimension (std::string name, std::string altName, int32 count, int32 startValue, int32 endValue, int32 increment, int32 uniform) |
Creates and adds a new Data Dimension to the Model. | |
int32 | insertDataDimension (IDataDimension::Pointer dimension, int32 index) |
Inserts a Data Dimension at a given index position. If Needed the internal data structure holding the Data Dimenions will be expanded by adding NULL data dimension pointers into the data structure. | |
void | squeezeDataDimensions () |
This method will remove any NULL Data Dimensions from the internal data structure that holds the list of Data Dimensions. | |
int32 | removeDataDimension (int32 index) |
Removes a data dimension by index. | |
int32 | removeDataDimension (const std::string &dimensionName) |
Removed a Data Dimension by Name. | |
int32 | moveDataDimension (int32 fromIndex, int32 toIndex) |
moves the data dimension at index 'fromIndex' to another index 'newIndex'. All Data Dimensions have new indices assigned to them after this operation. | |
int32 | swapDataDimensions (int32 index1, int32 index2) |
Swaps a pair of Data Dimensions in the index list. | |
IDataDimension::Container & | getDataDimensions () |
Returns the vector of Data Dimenions. | |
IDataDimension::Pointer | getDataDimension (int32 index) |
Returns a Data dimension object given an index. | |
IDataDimension::Pointer | getDataDimension (std::string dimName) |
Returns a Data Dimension object given the name of the data dimension. | |
int32 | getNumberOfDataDimensions () |
| |
void | addDataRecord (IDataRecord::Pointer record) |
Adds a Data Record given a DataRecord shared pointer. | |
void | addDataRecord (IDataRecord::Pointer record, IDataRecord::Pointer parent) |
Adds a Data Record to the model with the given parent record as the data records parent. | |
int32 | removeDataRecord (IDataRecord::Pointer record) |
Removes the Data Record from the Model. | |
IDataRecord::Container & | getDataRecords () |
Returns the Hierarchy of Data Records. | |
IDataRecord::Pointer | getDataRecordByNamedPath (const std::string &path, IDataRecord *parent=NULL) |
Returns a Data Record object from the given path. | |
IDataRecord::Pointer | getDataRecordByInternalPath (const std::string &path, IDataRecord *parent=NULL) |
Returns a Data Record based on an internal path representation. | |
MXATypes::MXAError | setRequiredMetaData (std::string researcherName, std::string dateCreated, std::string datasetName, std::string description, std::string distributionRights, std::string releaseNumber, std::string pedigree, std::string derivedSrcFile) |
Sets the required meta data fields. | |
MXATypes::MXAError | setRequiredMetaData (std::map< std::string, std::string > &metadata) |
Sets the Required Meta Data Fields given a std::map object. | |
int32 | setRequiredMetaData (IRequiredMetaData::Pointer metaData) |
Sets the required meta data. | |
IRequiredMetaData::Pointer | getRequiredMetaData () |
Returns the RequiredMeta Data in the provided std::map. | |
void | addUserMetaData (const std::string &attributeKey, IMXAArray::Pointer umd) |
Adds User defined Meta data to the model. | |
void | removeUserMetaData (const std::string &attributeKey) |
Removes specific user meta-data entry. | |
IMXAArray::Pointer | getUserMetaData (const std::string &attributeKey) |
Returns a specific User meta data item. | |
void | setUserMetaData (MXAAbstractAttributes &attributes) |
Sets all the user defined meta data for this model.Any previously defined meta data will be erased. | |
MXAAbstractAttributes | getUserMetaData () |
Returns the Data Structure used to hold the user defined Meta Data. | |
void | addSupportFile (ISupportFile::Pointer supportFile, bool updateIndex=false) |
Adds a SupportFile Reference to the model. | |
ISupportFile::Container | getSupportFiles () |
Returns the list of SupportFile objects from the model. | |
ISupportFile::Pointer | getSupportFile (int index) |
Returns a specific ISupportFile instance from the model or a NULL wrapped pointer in case nothing was found or index is out of bounds. | |
void | printModel (std::ostream &os, int32 indent) |
Prints the Data Model to the provided std::ostream. | |
void | printDataRecords (std::ostream &os, int32 indent) |
Prints the Data Records section of the model to the provided std::ostream. | |
void | printDataDimensions (std::ostream &os, int32 indent) |
Prints the Data Dimension section of the model to the provided std::ostream. | |
void | printRequiredMetaData (std::ostream &os, int32 indent) |
Prints the Required Meta Data section of the model to the provided std::ostream. | |
void | printUserMetaData (std::ostream &os, int32 indent) |
Prints the User Meta Data section of the model to the provided std::ostream. | |
bool | isValid (std::string &message) |
Performs some basic checks to make sure the model is valid. | |
Static Public Member Functions | |
static MXADataModel::Pointer | New (float modelVersion=0.4f, const std::string &type=MXA::MXACurrentFileType, const std::string &dataRoot="Data") |
Static method to create a new blank model. | |
static MXADataModel::Pointer | New (IDataModel::Pointer model) |
Static method to create a new by creating a deep copy of another model. | |
static MXATypes::MXAError | validateRequiredMetaData (MXARequiredMetaData &requiredMetaData, std::string &message) |
Validates that all the required Meta data is not empty. | |
Protected Member Functions | |
MXADataModel () | |
Private Member Functions | |
MXADataModel (const MXADataModel &) | |
void | operator= (const MXADataModel &) |
Private Attributes | |
float | _fileVersion |
std::string | _fileType |
std::string | _dataRoot |
IDataDimension::Container | _dataDimensions |
IDataRecord::Container | _dataRecords |
IRequiredMetaData::Pointer | _requiredMetaData |
MXAAbstractAttributes | _userMetaData |
ISupportFile::Container | _supportFiles |
MXADataModel::~MXADataModel | ( | ) | [virtual] |
MXADataModel::MXADataModel | ( | ) | [protected] |
MXADataModel::MXADataModel | ( | const MXADataModel & | ) | [private] |
MXADataModel::MXA_SHARED_POINTERS | ( | MXADataModel | ) |
MXADataModel::MXA_TYPE_MACRO | ( | MXADataModel | ) |
MXADataModel::Pointer MXADataModel::New | ( | float | modelVersion = 0.4f , |
|
const std::string & | type = MXA::MXACurrentFileType , |
|||
const std::string & | dataRoot = "Data" | |||
) | [static] |
Static method to create a new blank model.
static MXADataModel::Pointer MXADataModel::New | ( | IDataModel::Pointer | model | ) | [static] |
Static method to create a new by creating a deep copy of another model.
MXATypes::MXAError MXADataModel::validateRequiredMetaData | ( | MXARequiredMetaData & | requiredMetaData, | |
std::string & | message | |||
) | [static] |
Validates that all the required Meta data is not empty.
requiredMetaData | ||
message | String to store messages regarding missing field |
float MXADataModel::getModelVersion | ( | ) | [virtual] |
Returns the MXA File version that the model adheres to.
Implements IDataModel.
void MXADataModel::setModelVersion | ( | float | version | ) | [virtual] |
Sets the File Version of the MXA data file.
version | The API Version we are going to write |
Implements IDataModel.
std::string MXADataModel::getModelType | ( | ) | [virtual] |
Returns the type of file, should be MXA.
Implements IDataModel.
void MXADataModel::setModelType | ( | const std::string & | modelType | ) | [virtual] |
Sets the file type. Should be MHD or MXA.
modelType | The Model Type for this model. Typically it should be MXA::CurrentModelType |
Implements IDataModel.
void MXADataModel::setDefaultTypeAndVersion | ( | ) | [virtual] |
void MXADataModel::setDataRoot | ( | const std::string & | dataRoot | ) | [virtual] |
std::string MXADataModel::getDataRoot | ( | ) | [virtual] |
void MXADataModel::addDataDimension | ( | IDataDimension::Pointer | dimension | ) | [virtual] |
Adds a Data Dimension to the end of the Data Dimension data structure thus making the index of the added dimension the largest of all the dimensions.
dimension | The IDataDimension to be added to the list of dimensions. |
Implements IDataModel.
IDataDimension::Pointer MXADataModel::addDataDimension | ( | std::string | name, | |
std::string | altName, | |||
int32 | count, | |||
int32 | startValue, | |||
int32 | endValue, | |||
int32 | increment, | |||
int32 | uniform | |||
) | [virtual] |
Creates and adds a new Data Dimension to the Model.
name | The name for the Data Dimensions | |
altName | An Alternate Name for the Data Dimension | |
count | The total number of | |
startValue | The value this dimension starts at | |
endValue | The ending value (inclusive) this dimension ends at | |
increment | The value to increment the dimension when iterating | |
uniform | Are the values uniform across the start to end values |
Implements IDataModel.
int32 MXADataModel::insertDataDimension | ( | IDataDimension::Pointer | dimension, | |
int32 | index | |||
) | [virtual] |
Inserts a Data Dimension at a given index position. If Needed the internal data structure holding the Data Dimenions will be expanded by adding NULL data dimension pointers into the data structure.
dimension | The Data Dimension to Insert | |
index | The index to insert the Data Dimension at |
Implements IDataModel.
void MXADataModel::squeezeDataDimensions | ( | ) | [virtual] |
This method will remove any NULL Data Dimensions from the internal data structure that holds the list of Data Dimensions.
Implements IDataModel.
int32 MXADataModel::removeDataDimension | ( | int32 | index | ) | [virtual] |
int32 MXADataModel::removeDataDimension | ( | const std::string & | dimensionName | ) |
Removed a Data Dimension by Name.
dimensionName | The 'name' property of the Data Dimension to remove |
int32 MXADataModel::moveDataDimension | ( | int32 | fromIndex, | |
int32 | toIndex | |||
) | [virtual] |
moves the data dimension at index 'fromIndex' to another index 'newIndex'. All Data Dimensions have new indices assigned to them after this operation.
fromIndex | The current index of the data dimension to move | |
toIndex | The new index to place the data dimension at |
Implements IDataModel.
int32 MXADataModel::swapDataDimensions | ( | int32 | index1, | |
int32 | index2 | |||
) | [virtual] |
Swaps a pair of Data Dimensions in the index list.
index1 | The first Data Dimension | |
index2 | The second Data Dimension to swap with the first |
Implements IDataModel.
IDataDimension::Container & MXADataModel::getDataDimensions | ( | ) | [virtual] |
IDataDimension::Pointer MXADataModel::getDataDimension | ( | int32 | index | ) | [virtual] |
IDataDimension::Pointer MXADataModel::getDataDimension | ( | std::string | dimName | ) | [virtual] |
Returns a Data Dimension object given the name of the data dimension.
dimName |
Implements IDataModel.
int32 MXADataModel::getNumberOfDataDimensions | ( | ) | [virtual] |
void MXADataModel::addDataRecord | ( | IDataRecord::Pointer | record | ) | [virtual] |
void MXADataModel::addDataRecord | ( | IDataRecord::Pointer | record, | |
IDataRecord::Pointer | parent | |||
) | [virtual] |
Adds a Data Record to the model with the given parent record as the data records parent.
record | The data record to add to the model | |
parent | The parent of the data record |
Implements IDataModel.
int32 MXADataModel::removeDataRecord | ( | IDataRecord::Pointer | record | ) | [virtual] |
Removes the Data Record from the Model.
record | The record to remove from the Data model |
Implements IDataModel.
IDataRecord::Container & MXADataModel::getDataRecords | ( | ) | [virtual] |
IDataRecord::Pointer MXADataModel::getDataRecordByNamedPath | ( | const std::string & | path, | |
IDataRecord * | parent = NULL | |||
) | [virtual] |
Returns a Data Record object from the given path.
path | The path to the data record | |
parent | The parent data record |
Implements IDataModel.
IDataRecord::Pointer MXADataModel::getDataRecordByInternalPath | ( | const std::string & | path, | |
IDataRecord * | parent = NULL | |||
) | [virtual] |
Returns a Data Record based on an internal path representation.
path | ||
parent |
Implements IDataModel.
int32 MXADataModel::setRequiredMetaData | ( | std::string | researcherName, | |
std::string | dateCreated, | |||
std::string | datasetName, | |||
std::string | description, | |||
std::string | distributionRights, | |||
std::string | releaseNumber, | |||
std::string | pedigree, | |||
std::string | derivedSrcFile | |||
) | [virtual] |
Sets the required meta data fields.
researcherName | ||
dateCreated | ||
datasetName | ||
description | ||
distributionRights | ||
releaseNumber | ||
pedigree | ||
derivedSrcFile |
Implements IDataModel.
int32 MXADataModel::setRequiredMetaData | ( | std::map< std::string, std::string > & | metadata | ) | [virtual] |
Sets the Required Meta Data Fields given a std::map object.
metadata |
Implements IDataModel.
int32 MXADataModel::setRequiredMetaData | ( | IRequiredMetaData::Pointer | metaData | ) | [virtual] |
Sets the required meta data.
metaData | IRequiredMetaData::Pointer object |
Implements IDataModel.
IRequiredMetaData::Pointer MXADataModel::getRequiredMetaData | ( | ) | [virtual] |
Returns the RequiredMeta Data in the provided std::map.
Implements IDataModel.
void MXADataModel::addUserMetaData | ( | const std::string & | attributeKey, | |
IMXAArray::Pointer | umd | |||
) | [virtual] |
Adds User defined Meta data to the model.
attributeKey | The attribute key name | |
umd | The Key/Value pair to append to the model |
Implements IDataModel.
void MXADataModel::removeUserMetaData | ( | const std::string & | attributeKey | ) | [virtual] |
Removes specific user meta-data entry.
attributeKey | The user meta-data to remove |
Implements IDataModel.
IMXAArray::Pointer MXADataModel::getUserMetaData | ( | const std::string & | attributeKey | ) | [virtual] |
Returns a specific User meta data item.
attributeKey | The value of the attribute key |
Implements IDataModel.
void MXADataModel::setUserMetaData | ( | MXAAbstractAttributes & | attributes | ) | [virtual] |
Sets all the user defined meta data for this model.Any previously defined meta data will be erased.
attributes | Vector of MXAAbstractAttributePtr objects |
Implements IDataModel.
MXAAbstractAttributes MXADataModel::getUserMetaData | ( | ) | [virtual] |
void MXADataModel::addSupportFile | ( | ISupportFile::Pointer | supportFile, | |
bool | updateIndex = false | |||
) | [virtual] |
Adds a SupportFile Reference to the model.
supportFile | An ISupportFile object or subclass | |
updateIndex | Update the internal index of the supportFile Object after it is added to the model |
Implements IDataModel.
ISupportFile::Container MXADataModel::getSupportFiles | ( | ) | [virtual] |
Returns the list of SupportFile objects from the model.
Implements IDataModel.
ISupportFile::Pointer MXADataModel::getSupportFile | ( | int | index | ) | [virtual] |
Returns a specific ISupportFile instance from the model or a NULL wrapped pointer in case nothing was found or index is out of bounds.
index | The index (zero based) of the ISupportFile instance to return |
Implements IDataModel.
void MXADataModel::printModel | ( | std::ostream & | os, | |
int32 | indent | |||
) | [virtual] |
Prints the Data Model to the provided std::ostream.
os | ||
indent | The number of spaces to use for indenting |
Implements IDataModel.
void MXADataModel::printDataRecords | ( | std::ostream & | os, | |
int32 | indent | |||
) | [virtual] |
Prints the Data Records section of the model to the provided std::ostream.
os | ||
indent | The number of spaces to use for indenting |
Implements IDataModel.
void MXADataModel::printDataDimensions | ( | std::ostream & | os, | |
int32 | indent | |||
) | [virtual] |
Prints the Data Dimension section of the model to the provided std::ostream.
os | ||
indent | The number of spaces to use for indenting |
Implements IDataModel.
void MXADataModel::printRequiredMetaData | ( | std::ostream & | os, | |
int32 | indent | |||
) | [virtual] |
Prints the Required Meta Data section of the model to the provided std::ostream.
os | ||
indent | The number of spaces to use for indenting |
Implements IDataModel.
void MXADataModel::printUserMetaData | ( | std::ostream & | os, | |
int32 | indent | |||
) | [virtual] |
Prints the User Meta Data section of the model to the provided std::ostream.
os | ||
indent | The number of spaces to use for indenting |
Implements IDataModel.
bool MXADataModel::isValid | ( | std::string & | message | ) | [virtual] |
Performs some basic checks to make sure the model is valid.
message | String to store messages relating to errors/omissions about the model |
Implements IDataModel.
void MXADataModel::operator= | ( | const MXADataModel & | ) | [private] |
float MXADataModel::_fileVersion [private] |
std::string MXADataModel::_fileType [private] |
std::string MXADataModel::_dataRoot [private] |
IRequiredMetaData::Pointer MXADataModel::_requiredMetaData [private] |