DATAKIT API  V2025.1
Dtk_MetaData Class Referenceabstract

This is the Dtk_MetaData Class.
The Dtk_MetaDataPtr object is used to store any additional informations about Dtk_ComponentPtr or Dtk_NodePtr.
It can be either properties or parameters for example.
. More...

+ Inheritance diagram for Dtk_MetaData:

Data Structures

struct  Dtk_Handle
 

Public Types

enum  MetaDataTypeEnum {
  TypeUnknown = 0, TypeProperty, TypeFileProperty, TypeConfigurationProperty,
  TypeSheetMetal, TypeParameter, TypeMassProperty, TypeElectricalProperty,
  TypeAttributeSet, TypeUserAttribute, TypeUserExpression
}
 

Public Member Functions

Dtk_Int32 DtkDynamicType (const Dtk_Int32 &inId)
 Retrieves the dynamic entity type. More...
 
virtual int DtkDynamicType (const int &inId)=0
 
virtual void dump (FILE *file=stdout)
 
const Dtk_stringGetCategory () const
 Get the Category of the MetaData . More...
 
Dtk_string GetFormula (Dtk_string &outEstimatedValue)
 Get the Formula and its Estimated value of the MetaData . More...
 
Dtk_ErrorStatus GetFormula (Dtk_string &outFormula, Dtk_string &outEstimatedValue, Dtk_string &outTitle, Dtk_string &outResultType)
 Get the Formula Type of result and its Estimated value of the MetaData . More...
 
virtual Dtk_Size_t GetSize () const
 
const Dtk_stringGetTitle () const
 Get the Title of the MetaData . More...
 
const Dtk_stringGetType () const
 Get the Type of the MetaData . More...
 
Dtk_ErrorStatus GetUnits (Dtk_string &outUnits) const
 Get the Units of the MetaData. More...
 
const Dtk_stringGetValue () const
 Get the Value of the MetaData . More...
 
Dtk_bool IsBoolean () const
 
Dtk_bool IsDate () const
 
Dtk_bool IsFormula () const
 
Dtk_bool IsInteger () const
 
Dtk_bool IsNull () const
 
Dtk_bool IsReal () const
 
Dtk_bool IsReference () const
 
Dtk_bool IsString () const
 
const MetaDataTypeEnumMetaDataType () const
 Retrieves the Dtk_MetaDataPtr type - read only -. More...
 
 SetAsDeprecated ("2022.1", "Use GetUnits(Dtk_string& outUnits) method instead.") Dtk_string GetUnits() const
 Get the Units of the MetaData . More...
 
void SetCategory (Dtk_string in)
 Set the Category of the MetaData . More...
 
void SetFormula (Dtk_string inFormula, Dtk_string inEstimatedValue, Dtk_string inTitle, Dtk_string inResultType)
 Set the MetaData as Formula . More...
 
void SetMetaDataType (const MetaDataTypeEnum &inType)
 
void SetTitle (Dtk_string in)
 Set the Title of the MetaData . More...
 
void SetType (Dtk_string in)
 Set the Type of the MetaData . More...
 
void SetValue (Dtk_string in)
 Set the Value of the MetaData . More...
 
Dtk_PropertiesPtr ToConfigurationProperty ()
 
Dtk_PropertiesPtr ToElectricalProperty ()
 Retrieves the Dtk_MetaDataPtr as a parameter - if exists -. More...
 
Dtk_PropertiesPtr ToFileProperty ()
 
Dtk_PropertiesPtr ToMassProperty ()
 Retrieves the Dtk_MetaDataPtr as a parameter - if exists -. More...
 
Dtk_PropertiesPtr ToParameter ()
 Retrieves the Dtk_MetaDataPtr as a parameter - if exists -. More...
 
Dtk_PropertiesPtr ToProperty ()
 Retrieves the Dtk_MetaDataPtr as a property - if exists -. More...
 
Dtk_PropertiesPtr ToUserAttribute ()
 Retrieves the Dtk_MetaDataPtr as a parameter - if exists -. More...
 
Dtk_PropertiesPtr ToUserExpression ()
 Retrieves the Dtk_MetaDataPtr as a parameter - if exists -. More...
 

Static Public Member Functions

static Dtk_MetaDataPtr CreateMetaData (const MetaDataTypeEnum &inEnumType, Dtk_string inTitle, Dtk_string inValue, Dtk_string inValueType=Dtk_string(L"STRING"))
 Create a Dtk_MetaDataPtr . More...
 
static Dtk_MetaDataPtr CreateMetaDataWithUnits (const MetaDataTypeEnum &inEnumType, Dtk_string inTitle, Dtk_string inValue, Dtk_string inUnits, Dtk_string inValueType=Dtk_string(L"STRING"))
 Create a Dtk_MetaDataPtr . More...
 
static Dtk_MetaDataPtr CreatePropertiesMetaData (const Dtk_PropertiesPtr &inObject)
 Create a property Dtk_MetaDataPtr from a Dtk_PropertiesPtr. More...
 
static Dtk_MetaDataDtkDynamicCast (Dtk_Object *s)
 Performs a dynamic cast - doesn't need RTTI -. More...
 
static Dtk_string MetaDataTypeEnumToString (const MetaDataTypeEnum &inEnum)
 

Protected Types

enum  { _typeID = DTK_TYPE_METADATA }
 

Protected Member Functions

void _Copy (const Dtk_MetaData &inToBeCopied)
 
void _copy (const Dtk_Object &s)
 
void _Init ()
 
void _init ()
 
void _Reset ()
 
void _reset ()
 
 Dtk_MetaData (const Dtk_MetaData &inToBeCopied)
 Copy constructor. More...
 
 Dtk_MetaData (const MetaDataTypeEnum &inType)
 
 Dtk_MetaData (Dtk_MetaData &&inToBeMoved) DTK_NOEXCEPT
 
virtual ~Dtk_MetaData ()
 Destructor. More...
 

Protected Attributes

Dtk_Handle_Private
 
unsigned long count_
 

Friends

class Dtk_SmartPtr< Dtk_MetaData >
 

Detailed Description

This is the Dtk_MetaData Class.
The Dtk_MetaDataPtr object is used to store any additional informations about Dtk_ComponentPtr or Dtk_NodePtr.
It can be either properties or parameters for example.
.

This is the Dtk_MetaDataGroup Class.
The Dtk_MetaDataGroupPtr object is used to store a group of Dtk_MetaDataPtr in a Dtk_ComponentPtr or a or Dtk_NodePtr.
The children metadata may or may not be also stored as single metadata but if it is the case, then their category should be defined with the name of their Dtk_MetaDataGroup in order to be distinguished from metadata only accessible alone.
It is defined by a name and a tab of metadatas.
.

See also
Please use the Dtk_MetaData class to handle it.
Please use the Dtk_MetaDataGroup class to handle it.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
protected
Enumerator
_typeID 

◆ MetaDataTypeEnum

Enumerator
TypeUnknown 
TypeProperty 
TypeFileProperty 
TypeConfigurationProperty 
TypeSheetMetal 
TypeParameter 
TypeMassProperty 
TypeElectricalProperty 
TypeAttributeSet 
TypeUserAttribute 
TypeUserExpression 

Constructor & Destructor Documentation

◆ Dtk_MetaData() [1/3]

Dtk_MetaData::Dtk_MetaData ( const Dtk_MetaData inToBeCopied)
protected

Copy constructor.

Parameters
inToBeCopiedObject to copy.

◆ Dtk_MetaData() [2/3]

Dtk_MetaData::Dtk_MetaData ( Dtk_MetaData &&  inToBeMoved)
protected

◆ Dtk_MetaData() [3/3]

Dtk_MetaData::Dtk_MetaData ( const MetaDataTypeEnum inType)
protected
See also
CreateMetaData
CreateParameterMetaData

◆ ~Dtk_MetaData()

virtual Dtk_MetaData::~Dtk_MetaData ( )
protectedvirtual

Destructor.

Member Function Documentation

◆ _Copy()

void Dtk_MetaData::_Copy ( const Dtk_MetaData inToBeCopied)
protected

◆ _copy()

void Dtk_Object::_copy ( const Dtk_Object s)
protectedinherited

◆ _Init()

void Dtk_MetaData::_Init ( )
protected

◆ _init()

void Dtk_Object::_init ( )
protectedinherited

◆ _Reset()

void Dtk_MetaData::_Reset ( )
protected

◆ _reset()

void Dtk_Object::_reset ( )
protectedinherited

◆ CreateMetaData()

static Dtk_MetaDataPtr Dtk_MetaData::CreateMetaData ( const MetaDataTypeEnum inEnumType,
Dtk_string  inTitle,
Dtk_string  inValue,
Dtk_string  inValueType = Dtk_string(L"STRING") 
)
static

Create a Dtk_MetaDataPtr .

Parameters
[in]inEnumType: the type of the metadata
[in]inTitle: the title of the metadata
[in]inValue: the value of the metadata
[in]inType: the type of value (default is "STRING")
Returns
the constructed Dtk_MetaDataPtr.

◆ CreateMetaDataWithUnits()

static Dtk_MetaDataPtr Dtk_MetaData::CreateMetaDataWithUnits ( const MetaDataTypeEnum inEnumType,
Dtk_string  inTitle,
Dtk_string  inValue,
Dtk_string  inUnits,
Dtk_string  inValueType = Dtk_string(L"STRING") 
)
static

Create a Dtk_MetaDataPtr .

Parameters
[in]inEnumType: the type of the metadata
[in]inTitle: the title of the metadata
[in]inValue: the value of the metadata
[in]inUnits: the unit of the metadata
[in]inType: the type of value (default is "STRING")
Returns
the constructed Dtk_MetaDataPtr.

◆ CreatePropertiesMetaData()

static Dtk_MetaDataPtr Dtk_MetaData::CreatePropertiesMetaData ( const Dtk_PropertiesPtr inObject)
static

Create a property Dtk_MetaDataPtr from a Dtk_PropertiesPtr.

Parameters
inObjectProperty data.
Returns
the constructed Dtk_MetaDataPtr.

◆ DtkDynamicCast()

static Dtk_MetaData* Dtk_MetaData::DtkDynamicCast ( Dtk_Object s)
static

Performs a dynamic cast - doesn't need RTTI -.

114  {
115  if (s->DtkDynamicType(_typeID)) return static_cast<Dtk_MetaData*>(s);
116  return NULL;
117  }

◆ DtkDynamicType() [1/2]

Dtk_Int32 Dtk_MetaData::DtkDynamicType ( const Dtk_Int32 inId)

Retrieves the dynamic entity type.

107  {
108  if (inId == _typeID) return 1;
109  return Dtk_Object::DtkDynamicType(inId);
110  }

◆ DtkDynamicType() [2/2]

◆ dump()

virtual void Dtk_Object::dump ( FILE *  file = stdout)
virtualinherited

◆ GetCategory()

const Dtk_string& Dtk_MetaData::GetCategory ( ) const

Get the Category of the MetaData .

Returns
the Category of this MetaData .

◆ GetFormula() [1/2]

Dtk_string Dtk_MetaData::GetFormula ( Dtk_string outEstimatedValue)

Get the Formula and its Estimated value of the MetaData .

Parameters
[out]outEstimatedValue: Estimated value of formula
Returns
the Formula of this MetaData .

◆ GetFormula() [2/2]

Dtk_ErrorStatus Dtk_MetaData::GetFormula ( Dtk_string outFormula,
Dtk_string outEstimatedValue,
Dtk_string outTitle,
Dtk_string outResultType 
)

Get the Formula Type of result and its Estimated value of the MetaData .

Parameters
[out]outEstimatedValue: Estimated value of formula
[out]outType: Type of Estimated value
Returns
DtkNoError if it is a Formula , dtkErrorCorruptedEntity otherwise.

◆ GetSize()

◆ GetTitle()

const Dtk_string& Dtk_MetaData::GetTitle ( ) const

Get the Title of the MetaData .

Returns
the Title of this MetaData .

◆ GetType()

const Dtk_string& Dtk_MetaData::GetType ( ) const

Get the Type of the MetaData .

Returns
the Type of this MetaData .

◆ GetUnits()

Dtk_ErrorStatus Dtk_MetaData::GetUnits ( Dtk_string outUnits) const

Get the Units of the MetaData.

Parameters
[out]outUnits: the units string if present, empty string otherwise
Returns
dtkNoError if Units are present / dtkErrorAttributeNotFound if no Units .

◆ GetValue()

const Dtk_string& Dtk_MetaData::GetValue ( ) const

Get the Value of the MetaData .

Returns
the Value of this MetaData .

◆ IsBoolean()

Dtk_bool Dtk_MetaData::IsBoolean ( ) const

◆ IsDate()

Dtk_bool Dtk_MetaData::IsDate ( ) const

◆ IsFormula()

Dtk_bool Dtk_MetaData::IsFormula ( ) const

◆ IsInteger()

Dtk_bool Dtk_MetaData::IsInteger ( ) const

◆ IsNull()

Dtk_bool Dtk_MetaData::IsNull ( ) const

◆ IsReal()

Dtk_bool Dtk_MetaData::IsReal ( ) const

◆ IsReference()

Dtk_bool Dtk_MetaData::IsReference ( ) const

◆ IsString()

Dtk_bool Dtk_MetaData::IsString ( ) const

◆ MetaDataType()

const MetaDataTypeEnum& Dtk_MetaData::MetaDataType ( ) const

Retrieves the Dtk_MetaDataPtr type - read only -.

Returns
The Dtk_MetaDataPtr type.

◆ MetaDataTypeEnumToString()

static Dtk_string Dtk_MetaData::MetaDataTypeEnumToString ( const MetaDataTypeEnum inEnum)
static
40  {
41  switch( inEnum )
42  {
43  case TypeProperty: return L"TypeProperty";
44  case TypeFileProperty: return L"TypeFileProperty";
45  case TypeConfigurationProperty: return L"TypeConfigurationProperty";
46  case TypeSheetMetal: return L"TypeSheetMetal";
47  case TypeParameter: return L"TypeParameter";
48  case TypeMassProperty: return L"TypeMassProperty";
49  case TypeElectricalProperty: return L"TypeElectricalProperty";
50  case TypeAttributeSet: return L"TypeAttributeSet";
51  case TypeUserAttribute: return L"TypeUserAttribute";
52  case TypeUserExpression: return L"TypeUserExpression";
53  default:
54  case TypeUnknown: return L"Unknown";
55  }
56  }

◆ SetAsDeprecated()

Dtk_MetaData::SetAsDeprecated ( "2022.1"  ,
"Use GetUnits(Dtk_string& outUnits) method instead."   
) const

Get the Units of the MetaData .

Returns
the Units of this MetaData or "None" .
Deprecated:

◆ SetCategory()

void Dtk_MetaData::SetCategory ( Dtk_string  in)

Set the Category of the MetaData .

◆ SetFormula()

void Dtk_MetaData::SetFormula ( Dtk_string  inFormula,
Dtk_string  inEstimatedValue,
Dtk_string  inTitle,
Dtk_string  inResultType 
)

Set the MetaData as Formula .

Parameters
[in]inFormula: Formula
[in]inEstimatedValue: Estimated value of formula
[in]inResultType: Type of the EstimateValue
Returns
the Formula of this MetaData .

◆ SetMetaDataType()

void Dtk_MetaData::SetMetaDataType ( const MetaDataTypeEnum inType)

◆ SetTitle()

void Dtk_MetaData::SetTitle ( Dtk_string  in)

Set the Title of the MetaData .

◆ SetType()

void Dtk_MetaData::SetType ( Dtk_string  in)

Set the Type of the MetaData .

◆ SetValue()

void Dtk_MetaData::SetValue ( Dtk_string  in)

Set the Value of the MetaData .

◆ ToConfigurationProperty()

Dtk_PropertiesPtr Dtk_MetaData::ToConfigurationProperty ( )

◆ ToElectricalProperty()

Dtk_PropertiesPtr Dtk_MetaData::ToElectricalProperty ( )

Retrieves the Dtk_MetaDataPtr as a parameter - if exists -.

Returns
The Dtk_MetaDataPtr as a Dtk_PropertiesPtr if exists. Null Dtk_PropertiesPtr else.
Remarks
This method is used to retrieve the parameter
informations - if MetaDataType() method returns TypeElectricalProperty -.

◆ ToFileProperty()

Dtk_PropertiesPtr Dtk_MetaData::ToFileProperty ( )

◆ ToMassProperty()

Dtk_PropertiesPtr Dtk_MetaData::ToMassProperty ( )

Retrieves the Dtk_MetaDataPtr as a parameter - if exists -.

Returns
The Dtk_MetaDataPtr as a Dtk_PropertiesPtr if exists. Null Dtk_PropertiesPtr else.
Remarks
This method is used to retrieve the parameter
informations - if MetaDataType() method returns ToMassProperty -.

◆ ToParameter()

Dtk_PropertiesPtr Dtk_MetaData::ToParameter ( )

Retrieves the Dtk_MetaDataPtr as a parameter - if exists -.

Returns
The Dtk_MetaDataPtr as a Dtk_PropertiesPtr if exists. Null Dtk_PropertiesPtr else.
Remarks
This method is used to retrieve the parameter
informations - if MetaDataType() method returns TypeParameter -.

◆ ToProperty()

Dtk_PropertiesPtr Dtk_MetaData::ToProperty ( )

Retrieves the Dtk_MetaDataPtr as a property - if exists -.

Returns
The Dtk_MetaDataPtr as a Dtk_PropertiesPtr if exists. Null Dtk_PropertiesPtr else.
Remarks
This method is used to retrieve the property
informations - if MetaDataType() method returns TypeProperty -.

◆ ToUserAttribute()

Dtk_PropertiesPtr Dtk_MetaData::ToUserAttribute ( )

Retrieves the Dtk_MetaDataPtr as a parameter - if exists -.

Returns
The Dtk_MetaDataPtr as a Dtk_PropertiesPtr if exists. Null Dtk_PropertiesPtr else.
Remarks
This method is used to retrieve the parameter
informations - if MetaDataType() method returns TypeUserAttribute -.

◆ ToUserExpression()

Dtk_PropertiesPtr Dtk_MetaData::ToUserExpression ( )

Retrieves the Dtk_MetaDataPtr as a parameter - if exists -.

Returns
The Dtk_MetaDataPtr as a Dtk_PropertiesPtr if exists. Null Dtk_PropertiesPtr else.
Remarks
This method is used to retrieve the parameter
informations - if MetaDataType() method returns TypeUserExpression -.

Friends And Related Function Documentation

◆ Dtk_SmartPtr< Dtk_MetaData >

friend class Dtk_SmartPtr< Dtk_MetaData >
friend

Field Documentation

◆ _Private

Dtk_Handle* Dtk_MetaData::_Private
protected

◆ count_

unsigned long Dtk_Object::count_
protectedinherited
Dtk_MetaData::TypeElectricalProperty
@ TypeElectricalProperty
Definition: dtk_metadata.hpp:34
Dtk_MetaData::TypeUserAttribute
@ TypeUserAttribute
Definition: dtk_metadata.hpp:36
Dtk_MetaData::TypeFileProperty
@ TypeFileProperty
Definition: dtk_metadata.hpp:29
Dtk_MetaData::TypeUserExpression
@ TypeUserExpression
Definition: dtk_metadata.hpp:37
DTK_TYPE_METADATA
@ DTK_TYPE_METADATA
Definition: define.h:516
Dtk_MetaData::TypeConfigurationProperty
@ TypeConfigurationProperty
Definition: dtk_metadata.hpp:30
Dtk_MetaData::TypeProperty
@ TypeProperty
Definition: dtk_metadata.hpp:28
Dtk_MetaData::TypeSheetMetal
@ TypeSheetMetal
Definition: dtk_metadata.hpp:31
Dtk_MetaData::TypeUnknown
@ TypeUnknown
Definition: dtk_metadata.hpp:27
Dtk_MetaData::TypeParameter
@ TypeParameter
Definition: dtk_metadata.hpp:32
Dtk_MetaData::TypeAttributeSet
@ TypeAttributeSet
Definition: dtk_metadata.hpp:35
Dtk_Object::DtkDynamicType
virtual int DtkDynamicType(const int &inId)=0
Dtk_MetaData
This is the Dtk_MetaData Class. The Dtk_MetaDataPtr object is used to store any additional informatio...
Definition: dtk_metadata.hpp:23
Dtk_MetaData::TypeMassProperty
@ TypeMassProperty
Definition: dtk_metadata.hpp:33
Dtk_MetaData::_typeID
@ _typeID
Definition: dtk_metadata.hpp:58