Accessing the status value from within the actor |
Category: |
Micro-RTS
Applicable to: |
ObjecTime 4.4
Purpose: |
To inform users of some useful debugging mechanisms
Intended Audience: |
All microRTS developers
Description: |
Some of the MicroRTS ROOM services return a status value or minimally set a MicroRTS context (task) error code (similar to that of errno). If a service indicates that it was not successful, then there are three ways that this error code can be accessed from within an actor (e.g. a transition):
Consider a send on a port, where a 0 return value means that the send was not successful and that the port is actually not bound:
int successful = port.send( someSig ); if ( ! successful ) a) context()->perror( "MyActor::MyTransition " ); -- this will print to stdout "MyActor::MyTransition : Port not connected." b) char *errorString = context()->strerror(); -- this will return a char * pointing to "Port not connected." c) OTRTS::rtsErrors errorCode = getError(); -- this sets errorCode to the error code itself (noConnect, see $OBJECTIME_HOME/C++/TargetRTS/include/otkernel.h)
Limitations: |
None
See also: |
Copyright © 1999, ObjecTime Limited. |