48 DEPRECATED(
"int setValueFromVoidPtr( const void *data, unsigned int size, int id = 0 )", )
50 virtual
int setValueFromVoidPtr(
void *data,
unsigned int size,
52 return setValueFromVoidPtr( (
const void*)data, size,
id );
86 template<
class Type >
89 AnyNumber< SField< Type> > >,
114 setValue( *(
static_cast< const Type *
>( data ) ),
id );
132 *
static_cast< Type *
>( data ) =
getValue(
id );
142 inline virtual void setValue(
const Type &v,
int id = 0 );
144 inline void setValueIfChanged(
const Type &v,
int id = 0 );
153 this->
setValue( X3D::X3DStringToValue< Type >( s ) );
180 template<
class Type >
183 Console(LogLevel::Debug) <<
"SField< " <<
typeid( Type ).name()
184 <<
" >(" << this->name <<
")::update()" << endl;
189 (this->
event.ptr)->
getValue( this->owner->id );
195 template<
class Type >
198 Console(1) <<
"SField< " <<
typeid( Type ).name()
199 <<
" >(" << this->name <<
")::setValue()" << endl;
202 this->checkAccessTypeSet(
id );
206 this->
event.ptr = NULL;
214 template<
class Type >
217 Console(LogLevel::Debug) <<
"SField< " <<
typeid( Type ).name()
218 <<
" >(" << this->name <<
")::setValue()" << endl;
221 this->checkAccessTypeSet(
id );
228 this->
event.ptr = NULL;
234 template<
class Type >
237 Console(LogLevel::Debug) <<
"SField< " <<
typeid( Type ).name()
238 <<
" >(" << this->name <<
")::getValue()" << endl;
241 this->checkAccessTypeGet(
id );
Contains the TypedField template class.
This file contains functions for convertion from a string to a value of an X3D field type.
string name
The name of the field.
Definition: Field.h:312
Base class for all fields created with the SField template.
Definition: SField.h:41
virtual unsigned int valueTypeSize()=0
Returns the size in bytes of the value type the sfield encapsulates.
virtual ~SFieldClass()
Virtual destructor.
Definition: SField.h:44
virtual int getValueAsVoidPtr(void *data, unsigned int size, int id=0)=0
Get the value of the data copied into a memory buffer.
virtual int setValueFromVoidPtr(const void *data, unsigned int size, int id=0)=0
Set the value of the field given a pointer to where the value of the field is.
Template class that adds the Field mechanisms to an encapsulated value of specified type.
Definition: SField.h:90
virtual void setValue(const Type &v, int id=0)
Set the value of the field.
Definition: SField.h:215
virtual void update()
Make the field up to date given that an event has occured.
Definition: SField.h:181
Type value_type
The type of the value member.
Definition: SField.h:93
virtual const Type & getValue(int id=0)
Get the value of the field.
Definition: SField.h:235
virtual unsigned int valueTypeSize()
Returns the size in bytes of the value type the sfield encapsulates.
Definition: SField.h:137
virtual string getTypeName()
Returns a string name for this field type e.g. SFInt32.
Definition: SField.h:164
virtual void setValueFromString(const string &s)
Set the value of the field given a string.
Definition: SField.h:152
virtual int setValueFromVoidPtr(const 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.
Definition: SField.h:110
SField()
Constructor.
Definition: SField.h:96
SField(const Type &_value)
Constructor.
Definition: SField.h:99
virtual string getValueAsString(const string &=" ")
Get the value of the field as a string.
Definition: SField.h:157
Type value
The encapsulated value.
Definition: SField.h:176
virtual int getValueAsVoidPtr(void *data, unsigned int len, int id=0)
Get the value of the data copied into a memory buffer.
Definition: SField.h:126
static string classTypeName()
Returns a string name for this field type e.g. SFInt32.
Definition: SField.h:169
A template modifier class for adding type checking on the routes to any Field class.
Definition: TypedField.h:84
Type getValue(const char *s, const char *&rest)
Function that reads characters from a char * and converts them to a given type.
Definition: X3DFieldConversion.h:134
H3D API namespace.
Definition: Anchor.h:38