SYNOPSIS

#include <Inventor/scxml/ScXMLSendElt.h>

Inherits ScXMLExecutableElt.

Public Member Functions

virtual SoType getTypeId (void) const

Returns the type identification of an object derived from a class inheriting SoBase. This is used for run-time type checking and 'downward' casting. virtual void setEventAttribute (const char *event)

virtual const char * getEventAttribute (void) const

virtual void setTargetAttribute (const char *event)

virtual const char * getTargetAttribute (void) const

virtual void setTargetTypeAttribute (const char *event)

virtual const char * getTargetTypeAttribute (void) const

virtual void setSendIDAttribute (const char *event)

virtual const char * getSendIDAttribute (void) const

virtual void setDelayAttribute (const char *event)

virtual const char * getDelayAttribute (void) const

virtual void setNameListAttribute (const char *event)

virtual const char * getNameListAttribute (void) const

virtual void setHintsAttribute (const char *event)

virtual const char * getHintsAttribute (void) const

virtual SbBool handleXMLAttributes (void)

virtual void copyContents (const ScXMLElt *rhs)

virtual const ScXMLElt * search (const char *attrname, const char *attrvalue) const

ScXMLEvent * createEvent (ScXMLEventTarget *host) const

virtual void execute (ScXMLStateMachine *statemachine) const

Static Public Member Functions

static ScXMLEltReader * getElementReader (void)

static SoType getClassTypeId (void)

static void * createInstance (void)

static void initClass (void)

static void cleanClass (void)

Protected Attributes

char * event

char * target

char * targettype

char * sendid

char * delay

char * namelist

char * hints

Additional Inherited Members

Detailed Description

the < send> SCXML element.

The <send> element is only useful in profiles that have an implementation of the External Communication Module. Both the 'minimum' and the 'x-coin' profile have implementations, but the 'minimum' profile does not implement The Data Module, so only plain events without associated data can be sent.

The <send> element can take the following attributes:

  • event

  • target

  • targettype

  • sendid - not supported

  • delay

  • namelist

  • hints - not supported

The <send> element sends external events. State machines have typically two event queues - one internal, and one external. The internal event queue has full priority over the external event queue. State machines can send external events to itself, but it is more likely internal events are what you want. To send internal events, see the <event> element implemented in ScXMLEventElt. To send an external event to the containing state machine, do not specify the target attribute.

The event attribute specifies the event name for the event that is being sent. Event names are dot-separated names like 'error.InvalidExpr' or 'x-coin-navigation.Rotate.BEGIN', and the event names are treated case-sensitive in the current implementation of Coin SCXML. The event attribute is required.

The targettype attribute specifies the type of the target system. Other SCXML state machines have the type 'scxml'. Services related to Coin navigation systems have the targettype 'x-coin-navigation'. When sending external events to yourself, targettype can be omitted.

The target attribute is the name of the target event system. If it is not specified, it means the event will be sent to the containing state machine. Coin navigation services are typically names 'Rotate', but for other SCXML state machines, the <scxml> name attribute decides this. That name is not unique though if multiple such names have been created, so target can also be the state machine _sessionid identifier. (FIXME: check if this is implemented)

The sendid attribute is not supported.

If delay is specified, it must take the form of '{number}s' or '{number}ms' giving you the option of specifying the delay in number of seconds or milliseconds before the event should be sent. For delayed events to be sent, the Coin delayqueue processing must be performed. Most Coin users do that wether they know it or not. If delay is not specified, the event is passed to the target immediately. If a state machine is deleted, any events scheduled to be sent out in a delayed manner are going to be missing in action. The delay queue is a feature of the sending state machine, not the receiving one.

The namelist attribute specifies which data variables to include with the event for the event target. This attribute is only useful in profiles that implement the Data Module. The 'minimum' profile does not, but the 'x-coin' profile does. For the 'x-coin' profile, you can specify <data> variables by addressing them with the _data.{ID} scheme, or you can specify temporary variables, either by using the coin:temp.{ID} scheme or have the prefix implicit by just specifying the {ID}. The is the most useful method, since event targets do not want to know where in a data model a variable comes from, nor the name it had where it was contained. With temporary variables, the values can get names that are intended for the event target instead of the name used at the source.

The hints attribute is not supported.

See also:

ScXMLEventTarget, ScXMLEventElt, ScXMLDataElt, ScXMLAssignElt

Member Function Documentation

\fBSoType\fP ScXMLSendElt::getTypeId (void) const\fC [virtual]\fP

Returns the type identification of an object derived from a class inheriting SoBase. This is used for run-time type checking and 'downward' casting.

See also:

SoBase::getTypeId() const

Implements ScXMLExecutableElt.

SbBool ScXMLSendElt::handleXMLAttributes (void)\fC [virtual]\fP

This method is called when the file reader has set all the XML attributes on the object, and wants the object to handle them and report if the values were ok or if a read error should be produced.

Returns:

TRUE if the attributes are ok, and FALSE on error.

This base class implementation does nothing and just returns TRUE.

Reimplemented from ScXMLElt.

const \fBScXMLElt\fP * ScXMLSendElt::search (const char *attrname, const char *attrvalue) const\fC [virtual]\fP

This method searches the SCXML structure for an element with the given attributevalue for the given attribute.

Returns NULL if nothing was found.

This function needs to be reimplemented to traverse child elements.

Reimplemented from ScXMLElt.

Author

Generated automatically by Doxygen for Coin from the source code.