SMTK  @SMTK_VERSION@
Simulation Modeling Tool Kit
Classes | Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | Friends | List of all members
smtk::attribute::Definition Class Reference

Stores the definition of an attribute. More...

#include <Definition.h>

Inheritance diagram for smtk::attribute::Definition:
[legend]
Collaboration diagram for smtk::attribute::Definition:
[legend]

Classes

struct  WeakDefinitionPtrCompare
 

Public Types

enum  AssociationResultType { AssociationResultType::Valid, AssociationResultType::Illegal, AssociationResultType::Conflict, AssociationResultType::Prerequisite }
 Return types for canBeAssociated method. More...
 
typedef std::set< WeakDefinitionPtr, WeakDefinitionPtrCompareWeakDefinitionSet
 
- Public Types inherited from smtk::resource::Component
typedef std::function< void(const ComponentPtr &)> Visitor
 
typedef detail::ComponentLinks Links
 
typedef detail::ComponentProperties Properties
 

Public Member Functions

 smtkTypeMacro (smtk::attribute::Definition)
 
 smtkSuperclassMacro (smtk::resource::Component)
 
 smtkSharedFromThisMacro (smtk::resource::PersistentObject)
 
const std::string & type () const
 Returns Definition's type. More...
 
std::string name () const override
 Return the name of the definition - this is the same as its type.
 
smtk::attribute::ResourcePtr attributeResource () const
 Returns the attribute resource that owns the definition.
 
const smtk::resource::ResourcePtr resource () const override
 Implementation of resource::Component::resource() method.
 
const common::UUIDid () const override
 Return a unique identifier for the definition which will be persistent across sessions.
 
bool setId (const common::UUID &myID) override
 Assign an ID to this definition. More...
 
const Tags & tags () const
 return the smtk::attribute::Tags associated with the Definition
 
const std::string & displayedTypeName () const
 
const std::string & label () const
 
void setLabel (const std::string &newLabel)
 
const smtk::attribute::DefinitionPtrbaseDefinition () const
 
bool isA (smtk::attribute::ConstDefinitionPtr def) const
 
bool isRelevant (bool includeCategories=true, bool includeReadAccess=false, unsigned int readAccessLevel=0) const
 Returns true if the definition is relevant. More...
 
int version () const
 
void setVersion (int myVersion)
 
bool isAbstract () const
 
void setIsAbstract (bool isAbstractValue)
 
const smtk::common::Categoriescategories () const
 Returns the categories (both explicitly assigned and inherited) associated to the Definition. More...
 
smtk::common::Categories::ExpressionlocalCategories ()
 Returns the category expression explicitly assigned to the Definition.
 
const smtk::common::Categories::ExpressionlocalCategories () const
 
void setLocalCategories (const smtk::common::Categories::Expression &catExp)
 Sets the local categories. More...
 
template<typename T >
void filterItemDefinitions (T &values, std::function< bool(typename T::value_type)> test)
 Given a container, filter item definitions in the definition by a lambda function. More...
 
unsigned int advanceLevel (int mode=0) const
 Get the Definition 's advance level. More...
 
void setLocalAdvanceLevel (int mode, unsigned int level)
 
void setLocalAdvanceLevel (unsigned int level)
 
unsigned int localAdvanceLevel (int mode=0) const
 
void unsetLocalAdvanceLevel (int mode=0)
 unsetLocalAdvanceLevel causes the definition to return its base definition advance level information for the specified mode when calling the advanceLevel(mode) method or 0 if there is no base definition
 
bool hasLocalAdvanceLevelInfo (int mode=0) const
 Returns true if the definition is returning its local advance level information.
 
bool isUnique () const
 Indicates if a persistent object can have multiple attributes of this type associated with it (true means it can not)
 
void setIsUnique (bool isUniqueValue)
 Setting isUnique to be true indicates that only one attribute of this defintion (or any definition derived from this) can be associated to a persistent object.
 
bool isNodal () const
 Indicates if the attribute applies to the nodes of the analysis mesh.
 
void setIsNodal (bool isNodalValue)
 
const double * notApplicableColor () const
 Color Specifications Color in the case the attribute does not exist on the model entity If the color has not been set and the def has no base definition it will return s_notApplicableBaseColor.
 
void setNotApplicableColor (double r, double g, double b, double alpha)
 
void setNotApplicableColor (const double *color)
 
void unsetNotApplicableColor ()
 By unsetting the color it is now inherited from the def's base definition.
 
bool isNotApplicableColorSet () const
 
const double * defaultColor () const
 Default Color for attributes created from this definition - If the color has not been set and the def has no base definition it will return s_defaultBaseColor.
 
void setDefaultColor (double r, double g, double b, double alpha)
 
void setDefaultColor (const double *color)
 
void unsetDefaultColor ()
 By unsetting the color it is now inherited from the def's base definition.
 
bool isDefaultColorSet () const
 
ConstReferenceItemDefinitionPtr associationRule () const
 Return the definition's rule that governs attribute associations. More...
 
ReferenceItemDefinitionPtr localAssociationRule () const
 Return the local association rule if one is set. More...
 
ReferenceItemDefinitionPtr createLocalAssociationRule (const std::string &name=std::string())
 Create a new local association rule (if needed) and returns it. More...
 
virtual void setLocalAssociationRule (ReferenceItemDefinitionPtr)
 Set the local Association Rule for the definition that overrides the base definition rule. More...
 
smtk::model::BitFlags associationMask () const
 Returns the association mask used by the definition for model association Note that this may come from the base definition if there is no local association rule. More...
 
void setLocalAssociationMask (smtk::model::BitFlags mask)
 Sets the association mask - note that this will always create a local association rule. More...
 
void clearLocalAssociationRule ()
 Removes the local association rule. More...
 
bool associatesWithVertex () const
 Returns whether this attribute can be associated with vertices.
 
bool associatesWithEdge () const
 Returns whether this attribute can be associated with edges.
 
bool associatesWithFace () const
 Returns whether this attribute can be associated with faces.
 
bool associatesWithVolume () const
 Returns whether this attribute can be associated with volumes.
 
bool associatesWithModel () const
 Returns whether this attribute can be associated with models.
 
bool associatesWithGroup () const
 Returns whether this attribute can be associated with groups.
 
bool canBeAssociated (smtk::model::BitFlags maskType) const
 Return whether this attribute can be associated with entities that have the given flag value.
 
AssociationResultType canBeAssociated (smtk::resource::ConstPersistentObjectPtr object, AttributePtr &conflictAtt, DefinitionPtr &prerequisiteDef) const
 Tests to see if attributes based on this definition can be associated with a persistent object - see the documentation for AssociationResultType for details on return values. More...
 
bool checkAssociationRules (smtk::resource::ConstPersistentObjectPtr object) const
 Check the association rules of the definition (and the definiion it derived from) to see if the object can be associated.
 
AttributePtr checkForConflicts (smtk::resource::ConstPersistentObjectPtr object) const
 Test to see if there is a conflict between this definition and attributes already associated to the object. More...
 
DefinitionPtr checkForPrerequisites (smtk::resource::ConstPersistentObjectPtr object) const
 Test to see if there is a missing prerequisite attribute that would prevent attributes of this type from being associated to the object. More...
 
std::set< AttributePtrattributes (const smtk::resource::ConstPersistentObjectPtr &object) const
 Return all of the attributes associated with object that are derived from this definition.
 
bool conflicts (smtk::attribute::DefinitionPtr definition) const
 
std::size_t numberOfItemDefinitions () const
 
smtk::attribute::ItemDefinitionPtr itemDefinition (int ith) const
 
const std::vector< smtk::attribute::ItemDefinitionPtr > & localItemDefinitions () const
 
bool addItemDefinition (smtk::attribute::ItemDefinitionPtr cdef)
 Item definitions are the definitions of what data is stored in the attribute. More...
 
template<typename T >
smtk::internal::shared_ptr_type< T >::SharedPointerType addItemDefinition (const std::string &name)
 
bool removeItemDefinition (ItemDefinitionPtr itemDef)
 This method will only remove the specified ItemDefinition (if it exists) from the class internals. More...
 
int findItemPosition (const std::string &name) const
 Return the integer offset of the item with the given name or -1 if not found.
 
const std::string & detailedDescription () const
 
void setDetailedDescription (const std::string &text)
 
const std::string & briefDescription () const
 
void setBriefDescription (const std::string &text)
 
void buildAttribute (smtk::attribute::Attribute *attribute) const
 Build an attribute corresponding to this definition. More...
 
void setRootName (const std::string &val)
 Sets and returns the root name to be used to construct the name for an attribute. More...
 
std::string rootName () const
 
void resetItemOffset ()
 This method resets the definition item offset - this is used by the resource when a definition is modified.
 
std::size_t itemOffset () const
 
void setIncludeIndex (std::size_t index)
 These methods are use primarily by I/O operations. More...
 
std::size_t includeIndex () const
 
void addExclusion (smtk::attribute::DefinitionPtr def)
 Since Exclusion Constraints are symmetric this method will also insert this "definiton" into def.
 
void removeExclusion (smtk::attribute::DefinitionPtr def)
 Since Exclusion Constriants are symmetric this method will also remove this "definition" from def.
 
const WeakDefinitionSet exclusions () const
 
std::vector< std::string > excludedTypeNames () const
 Return a list of sorted type names that exlude this type of attribute.
 
void addPrerequisite (smtk::attribute::DefinitionPtr def)
 
bool isUsedAsAPrerequisite () const
 Returns true if the definition is used as a prerequisite.
 
void removePrerequisite (smtk::attribute::DefinitionPtr def)
 
const WeakDefinitionSet prerequisites () const
 
std::vector< std::string > prerequisiteTypeNames () const
 Return a sort of list of type names that are prerequisite to the type of attribute.
 
smtk::attribute::ConstDefinitionPtr hasPrerequisite (smtk::attribute::ConstDefinitionPtr def) const
 Return nullptr if def is not a prerequisite of this Definition else return the prerequisite definition that def is derived from.
 
bool hasPrerequisites () const
 Returns true if the definition has prerequisites (which can be inherited)
 
const std::string & units () const
 Return the units associated to the definition. More...
 
const std::string & localUnits () const
 Return the units locally set on the definition.
 
bool setLocalUnits (const std::string &newUnits, bool force=false)
 Locally set the units on the definition. More...
 
const std::shared_ptr< units::System > & unitSystem () const
 Gets the system of units used by this definition.
 
const std::shared_ptr< units::System > & unitsSystem () const
 
const Tagtag (const std::string &name) const
 Return a pointer to a smtk::attribute::Tag with a given name. If the Tag does not exist, return a null pointer.
 
Tagtag (const std::string &name)
 Return a pointer to a smtk::attribute::Tag with a given name. If the Tag does not exist, return a null pointer.
 
bool addTag (const Tag &tag)
 Add/Remove a smtk::attribute::Tag from a Definition.
 
bool removeTag (const std::string &name)
 Add/Remove a smtk::attribute::Tag from a Definition.
 
smtk::common::Categories::CombinationMode categoryInheritanceMode () const
 Determines how the Definition should combine its local category Set with the category constraints being inherited from it's Base Definition (if one exists)
 
void setCategoryInheritanceMode (smtk::common::Categories::CombinationMode mode)
 Determines how the Definition should combine its local category Set with the category constraints being inherited from it's Base Definition (if one exists)
 
bool ignoreCategories () const
 Indicates that the Definition's validity (and relevancy) does not depends on the Resource's set of active categories. More...
 
void setIgnoreCategories (bool val)
 Indicates that the Definition's validity (and relevancy) does not depends on the Resource's set of active categories. More...
 
- Public Member Functions inherited from smtk::resource::Component
 smtkTypeMacro (smtk::resource::Component)
 
 smtkSuperclassMacro (smtk::resource::PersistentObject)
 
 smtkSharedFromThisMacro (smtk::resource::PersistentObject)
 
ResourceparentResource () const override
 Return a raw (not shared) pointer to the resource that owns this component. More...
 
template<typename ResourceType >
ResourceType * parentResourceAs () const
 This variant of parentResource casts the result to the given ResourceType.
 
Linkslinks () override
 Return the links that connect this component to external resources/components.
 
const Linkslinks () const override
 
Propertiesproperties () override
 Return properties defined on this component.
 
const Propertiesproperties () const override
 
- Public Member Functions inherited from smtk::resource::PersistentObject
 smtkTypeMacroBase (smtk::resource::PersistentObject)
 
template<typename T >
T::Ptr as ()
 Attempt to cast this object to a subclass.
 
template<typename T >
T::ConstPtr as () const
 Attempt to cast this object to a subclass.
 

Protected Member Functions

 Definition (const std::string &myType, smtk::attribute::DefinitionPtr myBaseDef, smtk::attribute::ResourcePtr myResource, const smtk::common::UUID &myId)
 AttributeDefinitions can only be created by an attribute resource.
 
void clearResource ()
 
void applyCategories (smtk::common::Categories::Stack inherited)
 apply the local categories of the definition and its items. More...
 
void updateDerivedDefinitions ()
 This method updates derived definitions when this definition's items have been changed.
 
virtual void applyAdvanceLevels (const unsigned int &readLevelFromParent, const unsigned int &writeLevelFromParent)
 update the advance level information of the definition and its items. More...
 
void setItemDefinitionUnitSystem (const smtk::attribute::ItemDefinitionPtr &itemDef) const
 
void setItemDefinitionUnitsSystem (const smtk::attribute::ItemDefinitionPtr &itemDef) const
 

Protected Attributes

smtk::attribute::WeakResourcePtr m_resource
 
smtk::common::UUID m_id
 
int m_version
 
bool m_isAbstract
 
smtk::attribute::DefinitionPtr m_baseDefinition
 
std::string m_type
 
std::string m_label
 
bool m_isNodal
 
common::Categories::Expression m_localCategories
 
common::Categories m_categories
 
bool m_hasLocalAdvanceLevelInfo [2]
 
unsigned int m_localAdvanceLevel [2]
 
unsigned int m_advanceLevel [2]
 
WeakDefinitionSet m_exclusionDefs
 
WeakDefinitionSet m_prerequisiteDefs
 
size_t m_prerequisiteUsageCount
 Used to keep track of how many definitions are using this one as a prerequisite.
 
std::vector< smtk::attribute::ItemDefinitionPtrm_itemDefs
 
std::map< std::string, int > m_itemDefPositions
 
bool m_isUnique
 Is Unique indicates if more than one attribute of this type can be assigned to a model entity - this constraint is implimented by using adding the definition itself into its exclusion list.
 
bool m_isRequired
 
bool m_isNotApplicableColorSet
 
bool m_isDefaultColorSet
 
bool m_ignoreCategories = false
 
smtk::attribute::ReferenceItemDefinitionPtr m_acceptsRules
 
std::string m_detailedDescription
 
std::string m_briefDescription
 
std::size_t m_baseItemOffset
 Used by the find method to calculate an item's position.
 
std::string m_rootName
 
Tags m_tags
 
std::size_t m_includeIndex
 
smtk::common::Categories::CombinationMode m_combinationMode
 
std::string m_localUnits
 

Friends

class smtk::attribute::Resource
 

Detailed Description

Stores the definition of an attribute.

Stores all of the necessary information for a definition of a single attribute. Instances of a definition should be created through Resource::createAttribute().

Member Enumeration Documentation

◆ AssociationResultType

Return types for canBeAssociated method.

Enumerator
Valid 

Association is allowed.

Illegal 

Association with the given component type is disallowed.

Conflict 

An association with a mutually exclusive attribute already exists.

Prerequisite 

A prerequisite association does not yet exist.

Member Function Documentation

◆ addItemDefinition()

bool Definition::addItemDefinition ( smtk::attribute::ItemDefinitionPtr  cdef)

Item definitions are the definitions of what data is stored in the attribute.

For example, an IntItemDefinition would store an integer value.

◆ advanceLevel()

unsigned int Definition::advanceLevel ( int  mode = 0) const

Get the Definition 's advance level.

if mode is 1 then the write access level is returned; else the read access level is returned The information can either be specificied directly to the definition using setLocalAdvanceLevel() or from the definition's base definition. If the definition does not have either a local advance level or a base definition, then 0 is returned. NOTE: This information is used in GUI only

◆ applyAdvanceLevels()

void Definition::applyAdvanceLevels ( const unsigned int &  readLevelFromParent,
const unsigned int &  writeLevelFromParent 
)
protectedvirtual

update the advance level information of the definition and its items.

readLevelFromParent and writeLevelFromParent are the advance level information coming from the Definition's Base Definition. The Definition's advance level member are set to these values if the Definition does not have local versions set.

◆ applyCategories()

void Definition::applyCategories ( smtk::common::Categories::Stack  inherited)
protected

apply the local categories of the definition and its items.

inherited is an initial set passed down from the definition's base.

◆ associationMask()

smtk::model::BitFlags Definition::associationMask ( ) const

Returns the association mask used by the definition for model association Note that this may come from the base definition if there is no local association rule.

Return the mask specifying which types of model entities this attribute can be associated with.

As with the associationRule() method, the mask can be inherited from the Base Definition if it is not set locally

◆ associationRule()

ConstReferenceItemDefinitionPtr Definition::associationRule ( ) const

Return the definition's rule that governs attribute associations.

A ReferenceItemDefinition is used to store information about the allowable associations that may be made between attributes specified by this definition and model entities.

The definition's list of acceptable resources/components serves as a mask for allowable associations while the definition's minimum and maximum number of associations can be used to indicate whether an association is required, optional, and/or extensible.

A Definition can inherit the association rule from its Base Definition when it does not have a local association rule specified.

◆ buildAttribute()

void Definition::buildAttribute ( smtk::attribute::Attribute attribute) const

Build an attribute corresponding to this definition.

If the attribute already has items, clear them out.

◆ canBeAssociated()

Definition::AssociationResultType Definition::canBeAssociated ( smtk::resource::ConstPersistentObjectPtr  object,
AttributePtr conflictAtt,
DefinitionPtr prerequisiteDef 
) const

Tests to see if attributes based on this definition can be associated with a persistent object - see the documentation for AssociationResultType for details on return values.

Return whether this attribute can be associated with the given object.

If a conflict is found, conflictAtt is set to the conflicting attribute If a prerequisite is missing, prerequisiteDef is set to the missing requirement NOTE - testing is completed once a problem has been detected. There maybe be other issues preventing association so this method may need be called multiple times

This method first tests to see if the attribute can be associated with the object based on the attribute definition's association rules. If the object fails the check AssociationResultType::Illegal is returned. Else the attribute definition's exclusion rules are checked. If it fails this test, Definition::AssociationResultType::Conflict is returned along with the conflicting attributes. Finally, the attribute definition's prerequisite rules are tested. If it fails this test, Definition::AssociationResultType::Prerequisite is returned along with the missing prerequiste attribute definition. If all checks pass, Definition::AssociationResultType::Valid is returned.

Note that testing is stop when the first issue is found so there may be additional issues beyond the one reported. For example, there may be multiple conflicts and/or missing prerequisites

◆ categories()

const smtk::common::Categories& smtk::attribute::Definition::categories ( ) const
inline

Returns the categories (both explicitly assigned and inherited) associated to the Definition.

The categories that the attribute applies to. Typically a category will be a simulation type like heat transfer, fluid flow, etc.

◆ checkForConflicts()

AttributePtr Definition::checkForConflicts ( smtk::resource::ConstPersistentObjectPtr  object) const

Test to see if there is a conflict between this definition and attributes already associated to the object.

Returns the conflicting attribute if there is a conflict

◆ checkForPrerequisites()

DefinitionPtr Definition::checkForPrerequisites ( smtk::resource::ConstPersistentObjectPtr  object) const

Test to see if there is a missing prerequisite attribute that would prevent attributes of this type from being associated to the object.

Returns the missing prerequisite definition

◆ clearLocalAssociationRule()

void Definition::clearLocalAssociationRule ( )

Removes the local association rule.

Reoved the local assocaition rule on the definition.

The Definition will now inherit its association rule from its Base Definition.

◆ createLocalAssociationRule()

ReferenceItemDefinitionPtr Definition::createLocalAssociationRule ( const std::string &  name = std::string())

Create a new local association rule (if needed) and returns it.

Create the definition's local association rule that governs attribute associations.

If a non-empty name is provided and there is no pre-existing association rule, the newly-created instance will be given the name.

A Definition's local association rule overrides the rule it inherits from its Base Definition. This creates a local association rule (if one does not already exist) and returns it. The default is to create an empty association rule (nothing can be associated).

◆ filterItemDefinitions()

template<typename T >
void smtk::attribute::Definition::filterItemDefinitions ( T &  values,
std::function< bool(typename T::value_type)>  test 
)

Given a container, filter item definitions in the definition by a lambda function.

Parameters
valuesa container which holds definitions
testa lambda function which would be applied on children item definitions Example filter double and int item definitions [](Item::Ptr item) { return item->type() == DOUBLE || item->type() == INT; } Example filter modelEntity item definitions [](ModelEntity::Ptr item) { return true; }

◆ ignoreCategories()

bool smtk::attribute::Definition::ignoreCategories ( ) const
inline

Indicates that the Definition's validity (and relevancy) does not depends on the Resource's set of active categories.

This is very useful for modeling information such as Analysis Definitions since they set active categories but don't use categories themselves.

◆ isRelevant()

bool Definition::isRelevant ( bool  includeCategories = true,
bool  includeReadAccess = false,
unsigned int  readAccessLevel = 0 
) const

Returns true if the definition is relevant.

If includeCatagories is true and the definition does not pass it's category checks with respects to the resource's active category settings then return false, If includeReadAccess is true, and if all of the item definitions in the attribute have their advanceLevel > readAccessLevel then return false. Else return true.

◆ localAssociationRule()

ReferenceItemDefinitionPtr Definition::localAssociationRule ( ) const

Return the local association rule if one is set.

Return the definition's local association rule that governs attribute associations.

A Definition's local association rule overrides the rule it inherits from its Base Definition. This method can return a nullptr. Note that the ReferenceDefinition returned is not constant. Modifying it will change the Definition's association behavior.

◆ removeItemDefinition()

bool Definition::removeItemDefinition ( ItemDefinitionPtr  itemDef)

This method will only remove the specified ItemDefinition (if it exists) from the class internals.

Only ItemDefinitions local to this Definition can be removed. Remove inherited ItemDefinitinos directy from the inherited type.

Warning: It is up to the caller to ensure integrity of the attribute::Resource instance (e.g. Attribute instances of this Definition type need to be cleansed from the Resource).

◆ setId()

bool Definition::setId ( const common::UUID myID)
overridevirtual

Assign an ID to this definition.

This not supported for definitions. The Id is set in the constructor and should never be changed.

Implements smtk::resource::PersistentObject.

◆ setIgnoreCategories()

void smtk::attribute::Definition::setIgnoreCategories ( bool  val)
inline

Indicates that the Definition's validity (and relevancy) does not depends on the Resource's set of active categories.

This is very useful for modeling information such as Analysis Definitions since they set active categories but don't use categories themselves.

◆ setIncludeIndex()

void smtk::attribute::Definition::setIncludeIndex ( std::size_t  index)
inline

These methods are use primarily by I/O operations.

The include ID corresponds to the include directory information store in the attribute reosurce and is used when writing out the resource to use include files

◆ setLocalAssociationMask()

void Definition::setLocalAssociationMask ( smtk::model::BitFlags  mask)

Sets the association mask - note that this will always create a local association rule.

Set the mask specifying which types of model entities this attribute can be associated with.

Note that this will create a local association rule if the Definition did not already have one specified

◆ setLocalAssociationRule()

void Definition::setLocalAssociationRule ( ReferenceItemDefinitionPtr  rule)
virtual

Set the local Association Rule for the definition that overrides the base definition rule.

Set the rule that decides which model entities may be associated with instances of this definition.

This will override the association rule the definition inherits from the Definition's Base Definition.

◆ setLocalCategories()

void smtk::attribute::Definition::setLocalCategories ( const smtk::common::Categories::Expression catExp)
inline

Sets the local categories.

This method is intended for use by Python applications, because Python code cannot manipulate the reference returned by the localCategories() method.

◆ setLocalUnits()

bool Definition::setLocalUnits ( const std::string &  newUnits,
bool  force = false 
)

Locally set the units on the definition.

This will fail and return false under the following circumstances:

  1. There is no units system associated with the definition, the definition has a base definition whose units() are not empty, and newUnits is not the same as those returned from its base definition
  2. newUnits are not supported by the associated units system
  3. Its base definition's units are not "*" or there is no way to convert between the units associated with its base definition and newUnits

◆ setRootName()

void smtk::attribute::Definition::setRootName ( const std::string &  val)
inline

Sets and returns the root name to be used to construct the name for an attribute.

This is used by the attribute resource when creating an attribute without specifying a name - by default it is set to be the type name of the definition

◆ type()

const std::string& smtk::attribute::Definition::type ( ) const
inline

Returns Definition's type.

The type is an additional identifier that can be used to access the attribute definition through the Resource. It should never change.

◆ units()

const std::string & Definition::units ( ) const

Return the units associated to the definition.

Returns the units that have been locally set on the definition, else if the definition has a base definition, then its base definition's units are returned.

This means that the information that the attributes, generated from the definition, represents conceptually has units but unlike attribute Items, does not have a numerical value associated with it. For example an attribute may be used to indicate that a numerical field being output by a simulation represents a temperature whose units should be in Kelvin.

Note A definition's units method returning "*" indicates that its attributes or derived definitions can be assigned any supported units


The documentation for this class was generated from the following files: