DATAKIT API  V2025.1
Dtk_KinNamedValue Class Referenceabstract

Dtk_KinNamedValue represents a named value. More...

+ Inheritance diagram for Dtk_KinNamedValue:

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)
 
Dtk_status Dump (FILE *inFile)
 Write Dump file for named value. More...
 
type_detk get_type_detk () const
 
Dtk_string getName ()
 Returns the name of the value. More...
 
virtual Dtk_Size_t GetSize () const
 
double getValue ()
 Returns the value of the name. More...
 
void setName (Dtk_string inName)
 Sets the name. More...
 
void setValue (double inValue)
 Sets the value. More...
 
Dtk_ErrorStatus Transform (const Dtk_transfo &inTransfo)
 

Static Public Member Functions

static Dtk_KinNamedValuePtr Create ()
 Base constructor. More...
 
static Dtk_KinNamedValueDtkDynamicCast (Dtk_Object *s)
 Performs a dynamic cast - doesn't need RTTI -. More...
 
static Dtk_KinNamedValuePtr release (Dtk_KinNamedValuePtr inNamedValue)
 Delete object. More...
 

Protected Types

enum  { _typeID = DTK_TYPE_KIN_NAMED_VALUE }
 

Protected Member Functions

void _copy (const Dtk_Object &s)
 
void _init ()
 
void _reset ()
 
 Dtk_KinNamedValue ()
 Default constructor. More...
 
 Dtk_KinNamedValue (const Dtk_KinNamedValue &att)
 Copy constructor. More...
 
 ~Dtk_KinNamedValue ()
 Destructor. More...
 

Protected Attributes

Dtk_string _name
 
double _valeur
 
unsigned long count_
 

Friends

class Dtk_SmartPtr< Dtk_KinNamedValue >
 

Detailed Description

Dtk_KinNamedValue represents a named value.

A named value is associated at a parameter.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
protected
Enumerator
_typeID 
177  {
179  };

Constructor & Destructor Documentation

◆ Dtk_KinNamedValue() [1/2]

Dtk_KinNamedValue::Dtk_KinNamedValue ( )
protected

Default constructor.

◆ Dtk_KinNamedValue() [2/2]

Dtk_KinNamedValue::Dtk_KinNamedValue ( const Dtk_KinNamedValue att)
protected

Copy constructor.

Parameters
attthe Dtk_KinNamedValue to be copied

◆ ~Dtk_KinNamedValue()

Dtk_KinNamedValue::~Dtk_KinNamedValue ( )
protected

Destructor.

Member Function Documentation

◆ _copy()

void Dtk_Object::_copy ( const Dtk_Object s)
protectedinherited

◆ _init()

void Dtk_Object::_init ( )
protectedinherited

◆ _reset()

void Dtk_Object::_reset ( )
protectedinherited

◆ Create()

static Dtk_KinNamedValuePtr Dtk_KinNamedValue::Create ( )
static

Base constructor.

◆ DtkDynamicCast()

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

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

210  {
211  if(s->DtkDynamicType(_typeID))
212  return static_cast<Dtk_KinNamedValue*>(s);
213  return NULL;
214  }

◆ DtkDynamicType() [1/2]

Dtk_Int32 Dtk_KinNamedValue::DtkDynamicType ( const Dtk_Int32 inId)

Retrieves the dynamic entity type.

200  {
201  if (inId == _typeID)
202  {
203  return 1;
204  }
205  return Dtk_Object::DtkDynamicType(inId);
206  }

◆ DtkDynamicType() [2/2]

◆ dump()

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

◆ Dump()

Dtk_status Dtk_KinNamedValue::Dump ( FILE *  inFile)

Write Dump file for named value.

Parameters
inFilethe output file

Sample

Dtk_string fileName = ...;
File * file = fileName.ouvrir_fichier(DTK_W);
attribut.setName(Dtk_string("sample named value"));
attribut.setValue(5.21);
attribut.Dump(file);

Result

<namedValue name="sample named value" value="5.210000"/>

◆ get_type_detk()

type_detk Dtk_KinNamedValue::get_type_detk ( ) const
Returns
The type of the entity type - DTK_TYPE_KINEMATICS -
217 { return DTK_TYPE_KIN_NAMED_VALUE; }

◆ getName()

Dtk_string Dtk_KinNamedValue::getName ( )

Returns the name of the value.

◆ GetSize()

◆ getValue()

double Dtk_KinNamedValue::getValue ( )

Returns the value of the name.

◆ release()

static Dtk_KinNamedValuePtr Dtk_KinNamedValue::release ( Dtk_KinNamedValuePtr  inNamedValue)
static

Delete object.

◆ setName()

void Dtk_KinNamedValue::setName ( Dtk_string  inName)

Sets the name.

Parameters
inNamename

◆ setValue()

void Dtk_KinNamedValue::setValue ( double  inValue)

Sets the value.

Parameters
inValueValue

◆ Transform()

Dtk_ErrorStatus Dtk_KinNamedValue::Transform ( const Dtk_transfo inTransfo)

Friends And Related Function Documentation

◆ Dtk_SmartPtr< Dtk_KinNamedValue >

friend class Dtk_SmartPtr< Dtk_KinNamedValue >
friend

Field Documentation

◆ _name

Dtk_string Dtk_KinNamedValue::_name
protected

◆ _valeur

double Dtk_KinNamedValue::_valeur
protected

◆ count_

unsigned long Dtk_Object::count_
protectedinherited
Dtk_string::ouvrir_fichier
FILE * ouvrir_fichier(const Dtk_string &droits) const
File Utility : Open a file with the given rights.
Dtk_string
This is a high level string class.
Definition: dtk_string.hpp:58
Dtk_KinNamedValue
Dtk_KinNamedValue represents a named value.
Definition: util_kinematics_dtk.hpp:173
Dtk_KinNamedValue::_typeID
@ _typeID
Definition: util_kinematics_dtk.hpp:178
Dtk_KinNamedValue::Dump
Dtk_status Dump(FILE *inFile)
Write Dump file for named value.
DTK_W
#define DTK_W
Definition: dtk_string.hpp:43
Dtk_KinNamedValue::setValue
void setValue(double inValue)
Sets the value.
DTK_TYPE_KIN_NAMED_VALUE
@ DTK_TYPE_KIN_NAMED_VALUE
Definition: define.h:545
Dtk_KinNamedValue::setName
void setName(Dtk_string inName)
Sets the name.
Dtk_Object::DtkDynamicType
virtual int DtkDynamicType(const int &inId)=0