Archon::X3D::FieldBase Struct Reference

Virtual base class for all field definitions. More...

#include <archon/x3d/server/type.H>

Inheritance diagram for Archon::X3D::FieldBase:

Inheritance graph
[legend]
Collaboration diagram for Archon::X3D::FieldBase:

Collaboration graph
[legend]
List of all members.

Public Member Functions

unsigned long getId () const
string getName () const
const FieldTypegetType () const
bool getIsEventTarget () const
bool getIsEventSource () const
virtual Ref< ValueBaseget (const NodeBase *) const =0
virtual void set (NodeBase *, const Event *, bool cascade) const =0
 IF cascade IS FALSE:.
virtual bool changedSince (const NodeBase *n, const Time &) const =0
 Is this field or any field of child nodes of this field changed? Child nodes of course are only relevant for node fields.
virtual bool addRoute (NodeBase *, const RouteTail *) const =0
 Add a route to this field through EventSource::addRoute.
virtual void delRoute (NodeBase *, const RouteTail *) const =0
 Remove a route from this field through EventSource::delRoute.
virtual bool delRouteMatch (NodeBase *, const RouteTail *) const =0
 Remove a matching route from this field through EventSource::delRouteMAtch.
virtual ~FieldBase ()
 Must be called with a scenegraph read lock.

Static Public Member Functions

static const FieldBasefetch (unsigned long fieldId, const NodeBase *n=0)
 Fetch the X3D field associated with the specified field ID.

Protected Member Functions

 FieldBase (string name, const FieldType *, bool isEventTarget, bool isEventSource)
 FieldBase ()
 Since this is a virtual base class, abstract subclasses will never call a constructor in this class.
virtual void forwardClear (NodeBase *) const =0

Protected Attributes

bool isEventTarget
bool isEventSource
unsigned long id
string name
const FieldTypetype

Detailed Description

Virtual base class for all field definitions.

This includes the field wrappers that refer to real class level variables as well as the custom fields that can be contained in Script node instanses (the user specified ones).

See also:
CustomFieldBase

Definition at line 95 of file type.H.


Constructor & Destructor Documentation

Archon::X3D::FieldBase::FieldBase  )  [inline, protected]
 

Since this is a virtual base class, abstract subclasses will never call a constructor in this class.

Still, if we only provided the a constructor taking arguments then the abstract subclasses would be forced to call it and invent dummy values for the arguments, and completely in vain since the code will never be executed, Thast why we provide this one. DONT EVER USE IT!

Definition at line 194 of file type.H.


Member Function Documentation

virtual bool Archon::X3D::FieldBase::addRoute NodeBase ,
const RouteTail
const [pure virtual]
 

Add a route to this field through EventSource::addRoute.

See also:
EventSource::addRoute
Note:
This method should only be called from descendants of RouteTail.

Implemented in Archon::X3D::CustomFieldBase, Archon::X3D::StaticField< N, T >, Archon::X3D::StaticField< N, vector< Ref< C > > >, Archon::X3D::StaticField< N, vector< T > >, and Archon::X3D::StaticField< N, Ref< C > >.

virtual bool Archon::X3D::FieldBase::changedSince const NodeBase n,
const Time
const [pure virtual]
 

Is this field or any field of child nodes of this field changed? Child nodes of course are only relevant for node fields.

Must be called with a scenegraph read lock.

Implemented in Archon::X3D::SimpleCustomField< T >, Archon::X3D::SimpleSeqCustomField< T >, Archon::X3D::NodeCustomField< C >, Archon::X3D::NodeSequenceCustomField< C >, Archon::X3D::SimpleField< N, T >, Archon::X3D::NodeField< N, C >, Archon::X3D::NodeSequenceField< N, C >, and Archon::X3D::SimpleField< N, vector< T > >.

Referenced by Archon::X3D::Viewer::ShapeCache::updateCalllist().

virtual void Archon::X3D::FieldBase::delRoute NodeBase ,
const RouteTail
const [pure virtual]
 

Remove a route from this field through EventSource::delRoute.

See also:
EventSource::delRoute
Note:
This method should only be called from descendants of RouteTail.

Implemented in Archon::X3D::CustomFieldBase, Archon::X3D::StaticField< N, T >, Archon::X3D::StaticField< N, vector< Ref< C > > >, Archon::X3D::StaticField< N, vector< T > >, and Archon::X3D::StaticField< N, Ref< C > >.

Referenced by Archon::X3D::Route::refDispose(), and Archon::X3D::SAI::ExternalRoute::refDispose().

virtual bool Archon::X3D::FieldBase::delRouteMatch NodeBase ,
const RouteTail
const [pure virtual]
 

Remove a matching route from this field through EventSource::delRouteMAtch.

See also:
EventSource::delRouteMatch
Note:
This method should only be called from descendants of RouteTail.

Implemented in Archon::X3D::CustomFieldBase, Archon::X3D::StaticField< N, T >, Archon::X3D::StaticField< N, vector< Ref< C > > >, Archon::X3D::StaticField< N, vector< T > >, and Archon::X3D::StaticField< N, Ref< C > >.

Referenced by Archon::X3D::SAI::ExternalRoute::del().

const FieldBase * Archon::X3D::FieldBase::fetch unsigned long  fieldId,
const NodeBase n = 0
[static]
 

Fetch the X3D field associated with the specified field ID.

See also:
getId
Parameters:
n Must be specified if you want to be able to retrieve custum fields.

Definition at line 162 of file type.C.

References Archon::Utilities::Ref< T >::get(), Archon::X3D::CustomFieldNode::getCustomField(), Archon::X3D::NodeType::getImmediateField(), Archon::X3D::NodeType::getIndex(), Archon::X3D::NodeType::getNumberOfImmediateFields(), Archon::X3D::NodeBase::getType(), and Archon::X3D::NodeType::maxIndexBits.

Referenced by Archon::X3D::SAI::Session::addRoute(), Archon::X3D::SAI::Session::delRoute(), Archon::X3D::SAI::Session::getFieldAccessType(), Archon::X3D::SAI::Session::getFieldName(), Archon::X3D::SAI::Session::getFieldType(), Archon::X3D::SAI::Session::getFieldValue(), Archon::X3D::SAI::Session::getFieldValueAt(), Archon::X3D::SAI::Session::registerFieldInterest(), Archon::X3D::SAI::Session::setFieldValue(), Archon::X3D::SAI::Session::setFieldValueAdd(), Archon::X3D::SAI::Session::setFieldValueAt(), Archon::X3D::SAI::Session::setFieldValueDel(), and Archon::X3D::SAI::Session::unRegisterFieldInterest().

virtual void Archon::X3D::FieldBase::set NodeBase ,
const Event ,
bool  cascade
const [pure virtual]
 

IF cascade IS FALSE:.

Assign the specified event value to this field, but do not cascade the event on through the associated routes.

Must be called with a lock on the node and the node must not be realized.

IF cascade IS TRUE:

Assign the specified event value to this field, and cascade the event on through all associated routes.

Must be called with a scenegraph write lock, and never with a lock on any node. Also, this method may never be called for an un-realized node.

Implemented in Archon::X3D::SimpleCustomField< T >, Archon::X3D::SimpleSeqCustomField< T >, Archon::X3D::NodeCustomField< C >, Archon::X3D::NodeSequenceCustomField< C >, Archon::X3D::SimpleField< N, T >, Archon::X3D::NodeField< N, C >, Archon::X3D::NodeSequenceField< N, C >, and Archon::X3D::SimpleField< N, vector< T > >.

Referenced by Archon::X3D::UrlObject::addUri(), and Archon::X3D::Route::cascadeEvent().


The documentation for this struct was generated from the following files:
Generated on Sun Jul 30 23:01:22 2006 for Archon by  doxygen 1.4.4