H3D::SField< Type > Class Template Reference
[Field template modifiers.]

Template class that adds the Field mechanisms to an encapsulated value of specified type. More...

#include <SField.h>

Inheritance diagram for H3D::SField< Type >:

Inheritance graph
List of all members.

Public Types

typedef Type value_type
 The type of the value member.

Public Member Functions

 SField ()
 Constructor.
 SField (const Type &_value)
 Constructor.
virtual int setValueFromVoidPtr (void *data, unsigned int len, int id=0)
 Set the value of the field given a pointer to where the value of the field is.
virtual int getValueAsVoidPtr (void *data, unsigned int len, int id=0)
 Get the value of the data copied into a memory buffer.
virtual unsigned int valueTypeSize ()
 Returns the size in bytes of the value type the sfield encapsulates.
virtual void setValue (const Type &v, int id=0)
 Set the value of the field.
virtual const Type & getValue (int id=0)
 Get the value of the field.
virtual void setValueFromString (const string &s)
 Set the value of the field given a string.
virtual string getValueAsString (const string &separator=" ")
 Get the value of the field as a string.
virtual string getTypeName ()
 Returns a string name for this field type e.g. SFInt32.

Static Public Member Functions

static string classTypeName ()
 Returns a string name for this field type e.g. SFInt32.

Protected Member Functions

virtual void update ()
 Make the field up to date given that an event has occured.

Protected Attributes

Type value
 The encapsulated value.

Detailed Description

template<class Type>
class H3D::SField< Type >

Template class that adds the Field mechanisms to an encapsulated value of specified type.

Parameters:
Type The type of the value.


Member Function Documentation

template<class Type>
virtual int H3D::SField< Type >::getValueAsVoidPtr void *  data,
unsigned int  len,
int  id = 0
[inline, virtual]
 

Get the value of the data copied into a memory buffer.

Parameters:
data Buffer to copy the data into.
size The size of the buffer.
Returns:
If successful: The number of bytes that was copied into the Otherwise -1.

Implements H3D::SFieldClass.

template<class Type>
virtual void H3D::SField< Type >::setValueFromString const string &  s  )  [inline, virtual]
 

Set the value of the field given a string.

By default we try to parse the values according to the X3D/XML specification.

Implements H3D::ParsableField.

template<class Type>
virtual int H3D::SField< Type >::setValueFromVoidPtr void *  data,
unsigned int  len,
int  id = 0
[inline, virtual]
 

Set the value of the field given a pointer to where the value of the field is.

Parameters:
data A pointer to the data.
size The size in bytes of the value stored in data.
Returns:
0 if successful, -1 otherwise.

Implements H3D::SFieldClass.


Generated on Thu Aug 24 12:39:53 2006 for H3D API by  doxygen 1.4.5