H3D::RefCountMField< RefClass > Class Template Reference
[Field template modifiers.]

RefCountMField is almost like any MField but it encapsulates a vector of RefCoundtedClass pointers. More...

#include <RefCountMField.h>

Inheritance diagram for H3D::RefCountMField< RefClass >:

Inheritance graph
List of all members.

Public Types

typedef MFieldBase< RefClass *,
FieldInternals::MFNodeAutoRefVector<
RefClass >, Field
BaseFieldType

Public Member Functions

 H3D_VALUE_EXCEPTION (typename BaseFieldType::size_type, InvalidIndex)
 Thrown if the index given to getValueByIndex() is outside the boundaries.
 RefCountMField ()
 Default constructor. Creates an empty RefCountMField.
 RefCountMField (typename FieldInternals::MFNodeAutoRefVector< RefClass >::size_type sz)
 Creates an RefCountMField with space reserved for size nodes.
virtual const NodeVectorgetValue (int id=0)
 Get the value of the MField.
virtual RefClass * getValueByIndex (typename BaseFieldType::size_type i, int id=0)
 Get the value of the MField.
void setValue (typename FieldInternals::MFNodeAutoRefVector< RefClass >::size_type i, const typename FieldInternals::MFNodeAutoRefVector< RefClass >::value_type &v, int id=0)
 TEMPORARILY REMOVED: causes INTERNAL_COMPILER_ERROR Get the value of an element of the MField.
virtual void setValue (const AutoRefVector< RefClass > &v, int id=0)
 Set the value of the field.
virtual void setValue (const vector< RefClass * > &v, int id=0)
 Set the value of the field.
virtual void swap (vector< RefClass * > &v, int id=0)
 Swaps the contents of two vectors.
virtual void erase (RefClass *a, int id=0)
 Erase the first element equal to a.
virtual string getTypeName ()
 Returns a string name for this field type i.e. SFNode.

Static Public Member Functions

static string classTypeName ()
 Returns a string name for this field type i.e. SFNode.

Protected Member Functions

virtual void update ()
 Make the field up to date given that 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 values of SFNode changes.
virtual void onRemove (RefClass *n)
 This function will be called when values of SFNode changes.

Friends

class FieldInternals::MFNodeAutoRefVector< RefClass >

Detailed Description

template<class RefClass>
class H3D::RefCountMField< RefClass >

RefCountMField is almost like any MField but it encapsulates a vector of RefCoundtedClass pointers.

Reference counting on the encapsulated RefCountedClass instances are upheld when changes to the values are made.


Member Function Documentation

template<class RefClass>
virtual void H3D::RefCountMField< RefClass >::onAdd RefClass *  n  )  [inline, protected, virtual]
 

This function will be called when values of SFNode changes.

As soon as a Node is added onAdd will be called on the added value.

Parameters:
n The added value.

Reimplemented in H3D::Contour2D::AddTheChildren, H3D::Contour2D::CheckTheChildren, H3D::TypedMFNode< NodeType >, H3D::TypedMFNodeObject< Type >, H3D::NurbsTrimmedSurface::AddContour, and H3D::NurbsTrimmedSurface::CheckContour.

template<class RefClass>
virtual void H3D::RefCountMField< RefClass >::onRemove RefClass *  n  )  [inline, protected, virtual]
 

This function will be called when values of SFNode changes.

As soon as a Node is removed onRemove will be called on the removed value.

Parameters:
n The removed value.

Reimplemented in H3D::Contour2D::RemoveTheChildren, H3D::Contour2D::CheckTheChildren, H3D::NurbsTrimmedSurface::RemoveContour, and H3D::NurbsTrimmedSurface::CheckContour.

template<class RefClass>
virtual void H3D::RefCountMField< RefClass >::setValue const vector< RefClass * > &  v,
int  id = 0
[inline, virtual]
 

Set the value of the field.

Parameters:
The new value.

template<class RefClass>
virtual void H3D::RefCountMField< RefClass >::setValue const AutoRefVector< RefClass > &  v,
int  id = 0
[inline, virtual]
 

Set the value of the field.

Parameters:
The new value.

template<class RefClass>
void H3D::RefCountMField< RefClass >::setValue typename FieldInternals::MFNodeAutoRefVector< RefClass >::size_type  i,
const typename FieldInternals::MFNodeAutoRefVector< RefClass >::value_type v,
int  id = 0
[inline]
 

TEMPORARILY REMOVED: causes INTERNAL_COMPILER_ERROR Get the value of an element of the MField.

Parameters:
i The index of the element.
inline virtual const Type &getValue( size_type i );


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