H3D::RefCountSField< RefClass, BaseField > Class Template Reference
[Field template modifiers.]

RefCountSField is almost like any SField but it encapsulates a pointer to a RefCountedClass. More...

#include <RefCountSField.h>

List of all members.

Public Types

typedef RefClass typed_class_type
 The same as class_type, but if e.g.
typedef RefClass * typed_value_type
 The same as value_type, but if e.g.
typedef RefClass class_type
 The type of which this field contains a pointer to.
typedef RefClass * value_type
 The type of the value in this field.

Public Member Functions

 RefCountSField ()
 Constructor. Default value of value is NULL.
 RefCountSField (RefClass *_value)
 Constructor.
virtual void setValue (const AutoRef< RefClass > &n, int id=0)
 Set the value of the field.
virtual void setValue (RefClass *n, int id=0)
 Set the value of the field.
virtual RefClass * getValue (int id=0)
 Get the value of the field.

Protected Member Functions

virtual void update ()
 Make the field up to date if an event has occured.
virtual RefClass * preOnAdd (RefClass *n)
virtual RefClass * preOnRemove (RefClass *n)
virtual void onAdd (RefClass *n)
 This function will be called when the value of RefCountSField changes.
virtual void onRemove (RefClass *n)
 This function will be called when the value of RefCountSField changes.

Protected Attributes

RefCountSFieldAutoRef value
 The encapsulated value.

Friends

class RefCountSFieldAutoRefVector


Detailed Description

template<class RefClass, class BaseField = H3D::Field>
class H3D::RefCountSField< RefClass, BaseField >

RefCountSField is almost like any SField but it encapsulates a pointer to a RefCountedClass.

Reference counting on the encapsulated RefCountedClass is upheld when the value is changed in the field.


Member Typedef Documentation

template<class RefClass, class BaseField = H3D::Field>
typedef RefClass H3D::RefCountSField< RefClass, BaseField >::typed_class_type
 

The same as class_type, but if e.g.

TypedSFNode template modifier has been used the typed_class_type is the type specified to that template.

Reimplemented in H3D::TypedSFNode< NodeType >, and H3D::TypedSFNode< X3DSoundSourceNode >.

template<class RefClass, class BaseField = H3D::Field>
typedef RefClass* H3D::RefCountSField< RefClass, BaseField >::typed_value_type
 

The same as value_type, but if e.g.

TypedSFNode template modifier has been used the typed_class_type is the type specified to that template.

Reimplemented in H3D::TypedSFNode< NodeType >, and H3D::TypedSFNode< X3DSoundSourceNode >.


Member Function Documentation

template<class RefClass, class BaseField = H3D::Field>
virtual void H3D::RefCountSField< RefClass, BaseField >::onAdd RefClass *  n  )  [inline, protected, virtual]
 

This function will be called when the value of RefCountSField changes.

As soon as the value changes onRemove will be called on the old value and onAdd will be called on the new value.

Parameters:
n The new value.

Reimplemented in H3D::ImageObjectTexture::SFImageObject, H3D::TypedSFNode< NodeType >, H3D::TypedSFNodeObject< Type >, H3D::Sound::SFSoundSourceNode, H3D::TypedSFNode< X3DSoundSourceNode >, and H3D::TypedSFNodeObject< H3DImageObject >.

template<class RefClass, class BaseField = H3D::Field>
virtual void H3D::RefCountSField< RefClass, BaseField >::onRemove RefClass *  n  )  [inline, protected, virtual]
 

This function will be called when the value of RefCountSField changes.

As soon as the value changes onRemove will be called on the old value and onAdd will be called on the new value.

Parameters:
n The old value.

Reimplemented in H3D::ImageObjectTexture::SFImageObject, and H3D::Sound::SFSoundSourceNode.


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