Accessing the status value from within the actor

Category |  Purpose |  Intended Audience |  Applicable to |  Description |  Limitations |  See also


Category:

Top

Micro-RTS


Applicable to:

Top

ObjecTime 4.4


Purpose:

Top

To inform users of some useful debugging mechanisms


Intended Audience:

Top

All microRTS developers


Description:

Top

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:

Top

None


See also:

Top


 

Copyright © 1999, ObjecTime Limited.