Result Metadata

Overview

The ResultMetadata class manages metadata associated with result datasets or states. This class stores descriptive information about results such as size parameters, data types, entity types, names, and attributes that provide context for the result data.

The methods associated with a ResultMetadata object are the following.

Once instanced, define the basic metadata using setSize(), setType(), and setName(). Additional attributes can be added using the various AddAttribute functions and retrieved using the corresponding GetAttributeValue functions.

The size parameters include the length of the result, number of rows, and number of columns. The type parameters specify the data type (scalar, vector, tensor, etc.), parent entity type, and child entity type.

Attributes store additional metadata as key-value pairs where keys are strings and values can be integers, floats, doubles, or strings.

Class Members Descriptions

The currently available ResultMetadata enumerations and functions are described in detail in this section.

class ResultMetadata

Result Metadata management.

Public Functions

ErrorCode getErrorCode()

Return the current ErrorCode of the ResultMetadata object.

Returns: ErrorCode - The current error code, or NONE if no error.
Status setSize(long long length, int rowsCount, int columnsCount)

Set the size of a result.

Parameters:
  • length – Length of the result
  • rowsCount – Number of rows in the result
  • columnsCount – Number of columns in the result
Returns:

Status

Status setType(DataLayout type, EntityType entityType, EntityType subEntityType)

Specify type of parent and child entities and data type.

Errors
  • ENUM is generated if an improper entityType, subEntityType combination.

Parameters:
Returns:

Status

Status setName(const char *name)

Set the name of a result.

Parameters:name – Name of the result
Returns:Status
Status inquire(char name[], long long *lrec, int *nrow, int *ncol, DataLayout *type)

Inquire of defined name, lrec, nrow, ncol and type as output arguments.

Errors
NULLOBJECT is generated if any output argument is NULL.

Parameters:
  • name[out] Name of the result
  • lrec[out] Length of the result
  • nrow[out] Number of rows in the result
  • ncol[out] Number of columns in the result
  • type[out] DataLayout type
Returns:

Status

Status addAttributeInteger(const char *name, int value)

Add an integer attribute to a result.

Errors
  • OPERATION is generated if the attribute could not be added.

Parameters:
  • name – Name of the attribute
  • value – Value of the attribute
Returns:

Status

Status addAttributeFloat(const char *name, float value)

Add a float attribute to a result.

Errors
  • OPERATION is generated if the attribute could not be added.

Parameters:
  • name – Name of the attribute
  • value – Value of the attribute
Returns:

Status

Status addAttributeDouble(const char *name, double value)

Add a double attribute to a result.

Errors
  • OPERATION is generated if the attribute could not be added.

Parameters:
  • name – Name of the attribute
  • value – Value of the attribute
Returns:

Status

Status addAttributeString(const char *name, const char *value)

Add a string attribute to a result.

Errors
  • OPERATION is generated if the attribute could not be added.

Parameters:
  • name – Name of the attribute
  • value – Value of the attribute
Returns:

Status

Status getAttributeValueInteger(const char *name, int *value)

Get the value of an integer attribute. If the attribute does not exist, the value is set to INT_MAX.

Parameters:
  • name – Name of the attribute
  • value[out] Pointer to store the value of the attribute
Returns:

Status

Status getAttributeValueFloat(const char *name, float *value)

Get the value of a float attribute. If the attribute does not exist, the value is set to FLT_MAX.

Parameters:
  • name – Name of the attribute
  • value[out] Pointer to store the value of the attribute
Returns:

Status

Status getAttributeValueDouble(const char *name, double *value)

Get the value of a double attribute. If the attribute does not exist, the value is set to DBL_MAX.

Parameters:
  • name – Name of the attribute
  • value[out] Pointer to store the value of the attribute
Returns:

Status

Status getAttributeValueString(const char *name, char *value)

Get the value of a string attribute. If the attribute does not exist, the value is set to an empty string.

Parameters:
  • name – Name of the attribute
  • value[out] Pointer to store the value of the attribute
Returns:

Status

Status setResultType(ResultType resultType)

Set the result type of the metadata.

Parameters:resultType ResultType
Returns:Status
Status getDimensions(char dimensions[])

Get the physical dimensions string of the metadata based on the result type.

Errors
NULLOBJECT is generated if dimensions is NULL.

Parameters:dimensions[out] Array to store the dimensions string
Returns:Status
Status getEntityType(EntityType *entityType, EntityType *subEntityType)

Get the entity type and sub-entity type of a result metadata object.

Parameters:
  • entityType[out] EntityType Entity type of the result metadata
  • subEntityType[out] EntityType Sub-entity type of the result metadata
Returns:

Status

Status printAttributes()

Print names and values of attributes of a result metadata object.

Returns:Status
Status getAttributesNames(ListPtr<char> &attributesNames)

Retrieve the names of the attributes from a ResultMetadata object.

Parameters:attributesNames[out] Pointer to List of attributes names
Returns:Status