ScXMLSendElt Class Reference
State Chart XML Classes

the `<` send> SCXML element. More...

`#include <Inventor/scxml/ScXMLSendElt.h>`

Inheritance diagram for ScXMLSendElt:

## 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 runtime 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
Public Member Functions inherited from ScXMLElt
void | setXMLAttribute (const char *attribute, const char *value)
const char * | getXMLAttribute (const char *attribute) const
ScXMLElt * | clone (void) const
virtual void | setContainer (ScXMLElt *container)
ScXMLElt * | getContainer (void) const
SbBool | isContainedIn (const ScXMLElt *object) const
Public Member Functions inherited from ScXMLObject
SbBool | isOfType (SoType type) const
| Returns `TRUE` if the type of this object is either of the same type or inherited from type.

## Static Public Member Functions

static ScXMLEltReader * | getElementReader (void)
static SoType | getClassTypeId (void)
static void * | createInstance (void)
static void | initClass (void)
static void | cleanClass (void)
Static Public Member Functions inherited from ScXMLExecutableElt
static SoType | getClassTypeId (void)
static void | initClass (void)
static void | cleanClass (void)
Static Public Member Functions inherited from ScXMLElt
static SoType | getClassTypeId (void)
static void | initClass (void)
static void | cleanClass (void)
Static Public Member Functions inherited from ScXMLObject
static SoType | getClassTypeId (void)
| This static method returns the SoType object associated with objects of this class.
static void | initClass (void)
| Sets up initialization for data common to all instances of this class, like submitting necessary information to the Coin type system.
static void | cleanClass (void)
| Does the opposite of initClass, deallocates any class specific resources and resets the class to an uninitialized state with respect to the Coin type system.

## Protected Attributes

char * | event
char * | target
char * | targettype
char * | sendid
char * | delay
char * | namelist
char * | hints

## Additional Inherited Members

Static Protected Member Functions inherited from ScXMLElt
static void | registerClassType (const char *xmlns, const char *classname, SoType type)
static void | registerInvokeClassType (const char *xmlns, const char *targettype, const char *source, SoType type)
Static Protected Member Functions inherited from ScXMLObject
static void | registerClassType (const char *xmlns, const char *classname, SoType type)
static void | registerInvokeClassType (const char *xmlns, const char *targettype, const char *source, SoType type)

## 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 delay queue processing must be performed. Most Coin users do that whether 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 latter 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

## getTypeId()

SoType ScXMLSendElt::getTypeId | ( | void |  | ) | const

virtual

Returns the type identification of an object derived from a class inheriting SoBase. This is used for runtime type checking and "downward" casting.

See also
  SoBase::getTypeId() const

Implements ScXMLExecutableElt.

## handleXMLAttributes()

SbBool ScXMLSendElt::handleXMLAttributes | ( | void |  | ) |

virtual

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.

## copyContents()

void ScXMLSendElt::copyContents | ( | const ScXMLElt * | rhs | ) |

virtual

Reimplemented from ScXMLExecutableElt.

## search()

const ScXMLElt * ScXMLSendElt::search | ( | const char * | attrname,
|  | const char * | attrvalue ) const

virtual

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

Returns NULL if nothing was found.

This function needs to be reimplemented to traverse child elements.

Reimplemented from ScXMLElt.

## execute()

void ScXMLSendElt::execute | ( | ScXMLStateMachine * | statemachine | ) | const

virtual

Reimplemented from ScXMLExecutableElt.

The documentation for this class was generated from the following files:

- ScXMLSendElt.h
- ScXMLSendElt.cpp