DATAKIT API  V2025.1
Dtk_MetaDataWithUnit Class Referenceabstract
+ Inheritance diagram for Dtk_MetaDataWithUnit:

Public Types

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

Public Member Functions

 Dtk_MetaDataWithUnit (const MetaDataTypeEnum &inEnumType, Dtk_string inType, Dtk_string inTitle, Dtk_string inValue, Dtk_string inUnit)
 
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_string GetUnits ()
 
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...
 
virtual ~Dtk_MetaDataWithUnit ()
 

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_MetaDataWithUnitDtkDynamicCast (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 }
 
enum  { _typeID = DTK_TYPE_METADATAWITHUNIT }
 

Protected Member Functions

void _Copy (const Dtk_MetaData &inToBeCopied)
 
void _copy (const Dtk_Object &s)
 
void _init ()
 
void _reset ()
 

Protected Attributes

Dtk_Handle_Private
 
Dtk_string _Units
 
unsigned long count_
 

Friends

class Dtk_SmartPtr< Dtk_MetaDataWithUnit >
 

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
protectedinherited
Enumerator
_typeID 

◆ anonymous enum

anonymous enum
protected
Enumerator
_typeID 

◆ MetaDataTypeEnum

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

Constructor & Destructor Documentation

◆ Dtk_MetaDataWithUnit()

Dtk_MetaDataWithUnit::Dtk_MetaDataWithUnit ( const MetaDataTypeEnum inEnumType,
Dtk_string  inType,
Dtk_string  inTitle,
Dtk_string  inValue,
Dtk_string  inUnit 
)

◆ ~Dtk_MetaDataWithUnit()

virtual Dtk_MetaDataWithUnit::~Dtk_MetaDataWithUnit ( )
virtual

Member Function Documentation

◆ _Copy()

void Dtk_MetaData::_Copy ( const Dtk_MetaData inToBeCopied)
protectedinherited

◆ _copy()

void Dtk_Object::_copy ( const Dtk_Object s)
protectedinherited

◆ _init()

void Dtk_Object::_init ( )
protectedinherited

◆ _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") 
)
staticinherited

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") 
)
staticinherited

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)
staticinherited

Create a property Dtk_MetaDataPtr from a Dtk_PropertiesPtr.

Parameters
inObjectProperty data.
Returns
the constructed Dtk_MetaDataPtr.

◆ DtkDynamicCast()

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

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

288  {
289  if (s->DtkDynamicType(_typeID)) return static_cast<Dtk_MetaDataWithUnit*>(s);
290  return NULL;
291  }

◆ DtkDynamicType() [1/2]

Dtk_Int32 Dtk_MetaDataWithUnit::DtkDynamicType ( const Dtk_Int32 inId)

Retrieves the dynamic entity type.

281  {
282  if (inId == _typeID) return 1;
283  return Dtk_MetaData::DtkDynamicType(inId);
284  }

◆ DtkDynamicType() [2/2]

◆ dump()

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

◆ GetCategory()

const Dtk_string& Dtk_MetaData::GetCategory ( ) const
inherited

Get the Category of the MetaData .

Returns
the Category of this MetaData .

◆ GetFormula() [1/2]

Dtk_string Dtk_MetaData::GetFormula ( Dtk_string outEstimatedValue)
inherited

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 
)
inherited

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
inherited

Get the Title of the MetaData .

Returns
the Title of this MetaData .

◆ GetType()

const Dtk_string& Dtk_MetaData::GetType ( ) const
inherited

Get the Type of the MetaData .

Returns
the Type of this MetaData .

◆ GetUnits() [1/2]

Dtk_string Dtk_MetaDataWithUnit::GetUnits ( )

◆ GetUnits() [2/2]

Dtk_ErrorStatus Dtk_MetaData::GetUnits ( Dtk_string outUnits) const
inherited

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
inherited

Get the Value of the MetaData .

Returns
the Value of this MetaData .

◆ IsBoolean()

Dtk_bool Dtk_MetaData::IsBoolean ( ) const
inherited

◆ IsDate()

Dtk_bool Dtk_MetaData::IsDate ( ) const
inherited

◆ IsFormula()

Dtk_bool Dtk_MetaData::IsFormula ( ) const
inherited

◆ IsInteger()

Dtk_bool Dtk_MetaData::IsInteger ( ) const
inherited

◆ IsNull()

Dtk_bool Dtk_MetaData::IsNull ( ) const
inherited

◆ IsReal()

Dtk_bool Dtk_MetaData::IsReal ( ) const
inherited

◆ IsReference()

Dtk_bool Dtk_MetaData::IsReference ( ) const
inherited

◆ IsString()

Dtk_bool Dtk_MetaData::IsString ( ) const
inherited

◆ MetaDataType()

const MetaDataTypeEnum& Dtk_MetaData::MetaDataType ( ) const
inherited

Retrieves the Dtk_MetaDataPtr type - read only -.

Returns
The Dtk_MetaDataPtr type.

◆ MetaDataTypeEnumToString()

static Dtk_string Dtk_MetaData::MetaDataTypeEnumToString ( const MetaDataTypeEnum inEnum)
staticinherited
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
inherited

Get the Units of the MetaData .

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

◆ SetCategory()

void Dtk_MetaData::SetCategory ( Dtk_string  in)
inherited

Set the Category of the MetaData .

◆ SetFormula()

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

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)
inherited

◆ SetTitle()

void Dtk_MetaData::SetTitle ( Dtk_string  in)
inherited

Set the Title of the MetaData .

◆ SetType()

void Dtk_MetaData::SetType ( Dtk_string  in)
inherited

Set the Type of the MetaData .

◆ SetValue()

void Dtk_MetaData::SetValue ( Dtk_string  in)
inherited

Set the Value of the MetaData .

◆ ToConfigurationProperty()

Dtk_PropertiesPtr Dtk_MetaData::ToConfigurationProperty ( )
inherited

◆ ToElectricalProperty()

Dtk_PropertiesPtr Dtk_MetaData::ToElectricalProperty ( )
inherited

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 ( )
inherited

◆ ToMassProperty()

Dtk_PropertiesPtr Dtk_MetaData::ToMassProperty ( )
inherited

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 ( )
inherited

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 ( )
inherited

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 ( )
inherited

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 ( )
inherited

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_MetaDataWithUnit >

friend class Dtk_SmartPtr< Dtk_MetaDataWithUnit >
friend

Field Documentation

◆ _Private

Dtk_Handle* Dtk_MetaData::_Private
protectedinherited

◆ _Units

Dtk_string Dtk_MetaDataWithUnit::_Units
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_MetaDataWithUnit
Definition: dtk_metadata.hpp:263
DTK_TYPE_METADATA
@ DTK_TYPE_METADATA
Definition: define.h:516
Dtk_MetaDataWithUnit::_typeID
@ _typeID
Definition: dtk_metadata.hpp:270
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_MetaData::DtkDynamicType
Dtk_Int32 DtkDynamicType(const Dtk_Int32 &inId)
Retrieves the dynamic entity type.
Definition: dtk_metadata.hpp:106
Dtk_Object::DtkDynamicType
virtual int DtkDynamicType(const int &inId)=0
Dtk_MetaData::TypeMassProperty
@ TypeMassProperty
Definition: dtk_metadata.hpp:33
Dtk_MetaData::_typeID
@ _typeID
Definition: dtk_metadata.hpp:58
DTK_TYPE_METADATAWITHUNIT
@ DTK_TYPE_METADATAWITHUNIT
Definition: define.h:518