C++ TargetRTS
Loading...
Searching...
No Matches
Public Member Functions | Static Public Attributes | List of all members
Frame::Base Class Reference

Represents a frame port. More...

#include <RTFrame.h>

Inheritance diagram for Frame::Base:
RTProtocol

Public Member Functions

RTActorId incarnate (RTActorRef &cp)
 Incarnates a capsule by creating an instance of the capsule in an optional capsule part.
 
RTActorId incarnate (RTActorRef &cp, const RTActorClass &cap)
 Incarnates a capsule by creating an instance of the capsule in an optional capsule part.
 
RTActorId incarnate (RTActorRef &cp, const void *data, const RTObject_class *type, RTController *controller, int index)
 Incarnates a capsule by creating an instance of the capsule in an optional capsule part.
 
RTActorId incarnate (RTActorRef &cp, const RTActorClass &cap, const void *data, const RTObject_class *type, RTController *controller, int index)
 Incarnates a capsule by creating an instance of the capsule in an optional capsule part.
 
RTActorId incarnate (RTActorRef &cp, const RTDataObject &data, RTController *controller=nullptr, int index=-1)
 Incarnates a capsule by creating an instance of the capsule in an optional capsule part.
 
RTActorId incarnate (RTActorRef &cp, const RTActorClass &cap, const RTDataObject &data, RTController *controller=nullptr, int index=-1)
 Incarnates a capsule by creating an instance of the capsule in an optional capsule part.
 
RTActorId incarnate (RTActorRef &cp, const RTTypedValue &info, RTController *controller=nullptr, int index=-1)
 Incarnates a capsule by creating an instance of the capsule in an optional capsule part.
 
RTActorId incarnate (RTActorRef &cp, const RTActorClass &cap, const RTTypedValue &info, RTController *controller=nullptr, int index=-1)
 Incarnates a capsule by creating an instance of the capsule in an optional capsule part.
 
RTActorId incarnateCustom (RTActorRef &cp, RTActorFactory &factory, int index=-1)
 Incarnates a capsule by creating an instance of the capsule in an optional capsule part using a custom capsule factory for creating the capsule instance.
 
RTActorId incarnateCustom (RTActorRef &cp, RTActorFactory &&factory, int index=-1)
 
RTActorId incarnateCustom (RTActorRef &cp, const void *data, const RTObject_class *type, RTActorFactory &factory, int index=-1)
 Incarnates a capsule by creating an instance of the capsule in an optional capsule part using a custom capsule factory for creating the capsule instance.
 
RTActorId incarnateCustom (RTActorRef &cp, const void *data, const RTObject_class *type, RTActorFactory &&factory, int index=-1)
 
int destroy (RTActorId &i)
 Destroy a capsule instance.
 
int destroy (RTActorRef &cp)
 Destroy all capsule instances contained in a certain capsule part.
 
int import (const RTActorId &i, RTActorRef &cp_dest, int index=-1)
 Import a capsule instance into a plug-in capsule part.
 
int import (RTActorRef &cp_src, RTActorRef &cp_dest, int index=-1)
 Import a capsule instance into a plug-in capsule part.
 
int deport (const RTActorId &i, RTActorRef &cp)
 Remove a capsule instance from a plug-in capsule part.
 
RTActorId ** incarnationsOf (const RTActorRef &cp)
 Return all capsule instances contained in a certain capsule part.
 
RTActorId incarnationAt (const RTActorRef &cp, int index)
 Return a capsule instance contained in a certain capsule part.
 
RTActorId me (void)
 Return the capsule instance that owns the frame service port.
 
const RTActorClassmyClass (void)
 Get the type of the capsule instance that owns the frame service port.
 
const RTActorClassclassOf (const RTActorId &instance)
 Get the type of a certain capsule instance.
 
int classIsKindOf (const RTActorClass &subClass, const RTActorClass &superClass)
 Determine if a capsule is the same or inherits from another capsule.
 
const char * className (const RTActorClass &)
 Get the name of a capsule type.
 
- Public Member Functions inherited from RTProtocol
RTControllercontext (void) const
 Get the context of the capsule that owns this port.
 
int getId (void) const
 Get the id of the port.
 
const RTPortDescriptorgetInfo (void) const
 Get information about a port.
 
const char * getName (void) const
 Get the name of the port.
 
RTActorgetOwner (void) const
 Get the owner capsule to which the port belongs.
 
int size (void) const
 Get the size of the port.
 
int resize (int new_size)
 Set a new size (i.e.
 
int registerSAP (const char *service)
 Register an unwired port (SAP) with the layer service (as a "client").
 
int deregisterSAP (void)
 Deregister an unwired port (SAP).
 
int registerSPP (const char *service)
 Register an unwired port (SPP) with the layer service (as the "provider").
 
int deregisterSPP (void)
 Deregister an unwired port (SPP).
 
const char * defaultLayerName (void) const
 Get the default registration name for the port.
 
int isRegistered (void) const
 Determine if the port is currently registered with the layer service or not.
 
const char * getRegisteredName (void) const
 Get the registration name of the port.
 
int registerAs (const char *service)
 Register an unwired port either as an SAP or SPP (depending on the "Publish" property of the port).
 
int deregister (void)
 Deregister an unwired port (either an SAP or SPP).
 
int isBoundAt (int index) const
 Determine if a port instance is currently connected to another port instance.
 
int isIndexTo (int index, RTActor *capsule) const
 Determine if a port instance is currently connected to a port instance owned by a certain capsule instance.
 
int indexTo (RTActor *capsule) const
 Determine if there exists a port instance currently connected to a port instance owned by a certain capsule instance.
 
int purge (void)
 Empty the defer queue of all port instances without recalling any deferred message.
 
int purgeAt (int index)
 Empty the defer queue of a specified port instance without recalling any deferred message.
 
int recall (void)
 Recall a message from the defer queue and insert it at the back of the controller's message queue (after other queued messages).
 
int recallFront (void)
 Recall a message from the defer queue and insert it at the front of the controller's message queue (before other queued messages).
 
int recallAt (int index, int front=0)
 Recall a message from the defer queue and insert it in the controller's message queue.
 
int recallAll (void)
 Recall all messages from the defer queue and insert them at the back of the controller's message queue (after other queued messages).
 
int recallAllFront (void)
 Recall all messages from the defer queue and insert them at the front of the controller's message queue (before other queued messages).
 
int recallAllAt (int index, int front=0)
 Recall all messages from the defer queue and insert them in the controller's message queue.
 
void bindingNotification (int on_off)
 Turn on or off binding notifications for this port.
 
int bindingNotificationRequested (void) const
 Determine if binding notifications are currently enabled for the port.
 
void sendTypeCheckEnable (int on_off)
 Turn on or off type checking when performing send(), invoke() or reply() on the port.
 
int sendTypeCheckEnabled (void) const
 Determine if type checking when sending events is enabled.
 
RTProtocolDescriptor::Status sendCheck (int signal, const RTObject_class *type) const
 Check if a particular event would be possible to send on this port.
 
void receiveTypeCheckEnable (int on_off)
 Turn on or off type checking when receiving an event on the port.
 
int receiveTypeCheckEnabled (void) const
 Determine if type checking when receiving events is enabled.
 
RTProtocolDescriptor::Status receiveCheck (int signal, const RTObject_class *type) const
 Check if a particular event would be possible to receive on this port.
 
int invoke (RTMessage *replyBuffer, int signal, const void *data, const RTObject_class *type, bool implicitReply)
 Invoke an event on the port.
 
int invokeAt (int index, RTMessage *replyBuffer, int signal, const void *data, const RTObject_class *type, bool implicitReply)
 Invoke an event on a replicated port at a specified index.
 
int reply (int signal, const void *data, const RTObject_class *type)
 Make a reply to respond to an invoke.
 
int send (int signal, const void *data, const RTObject_class *type, int priority, bool moveData=false)
 Send an event on the port.
 
int sendAt (int index, int signal, const void *data, const RTObject_class *type, int priority, bool moveData=false)
 Send an event on a replicated port at a specified index.
 

Static Public Attributes

static const RTProtocolDescriptor rt_class
 

Additional Inherited Members

- Protected Types inherited from RTProtocol
enum  {
  BindingNotification = 1 , RegisteredAsSAP = 2 , SendTypeCheck = 4 , ReceiveTypeCheck = 8 ,
  Resized = 16
}
 
enum  { rtiLast_RTProtocol = 0 }
 
- Protected Member Functions inherited from RTProtocol
void init (const RTPortDescriptor *)
 
int getFlags (void) const
 
void setFlag (int)
 
void resetFlag (int)
 
void bindAt (int, RTBindingEnd &, RTController *)
 
int peerAt (int, RTBindingEnd &)
 
void unbindAt (int, RTController *)
 
void notifyInit (RTController *)
 
void notifyBoundAt (int, RTController *)
 

Detailed Description

Represents a frame port.

Member Function Documentation

◆ classIsKindOf()

int Frame::Base::classIsKindOf ( const RTActorClass subClass,
const RTActorClass superClass 
)

Determine if a capsule is the same or inherits from another capsule.

Parameters
[in]subClassA capsule to compare the type of.
[in]superClassAnother capsule to compare against.
Returns
1 if subClass == superClass, or if subClass inherits from superClass. Otherwise 0 is returned.

◆ className()

const char * Frame::Base::className ( const RTActorClass )

Get the name of a capsule type.

Returns
The name of the capsule

◆ classOf()

const RTActorClass & Frame::Base::classOf ( const RTActorId instance)

Get the type of a certain capsule instance.

Parameters
[in]instanceA capsule instance
Returns
The capsule that is the type of the capsule instance, or EmptyActorClass in case an error occurs.

◆ deport()

int Frame::Base::deport ( const RTActorId i,
RTActorRef cp 
)

Remove a capsule instance from a plug-in capsule part.

Parameters
[in]iThe capsule instance to remove (deport).
[in]cpThe plug-in capsule part where the capsule instance is currently located.
Returns
1 if the capsule instance was successfully deported, 0 otherwise.

◆ destroy() [1/2]

int Frame::Base::destroy ( RTActorId i)

Destroy a capsule instance.

Parameters
[in]iThe capsule instance to destroy. It must be located in an optional capsule part within the same capsule that owns the frame service port.
Returns
1 if the capsule instance was successfully destroyed, otherwise 0.

◆ destroy() [2/2]

int Frame::Base::destroy ( RTActorRef cp)

Destroy all capsule instances contained in a certain capsule part.

Parameters
[in]cpThe capsule part. It must be optional and located within the same capsule that owns the frame service port.
Returns
The number of destroyed capsule instances. 0 is returned in case of errors.

◆ import() [1/2]

int Frame::Base::import ( const RTActorId i,
RTActorRef cp_dest,
int  index = -1 
)

Import a capsule instance into a plug-in capsule part.

Parameters
[in]iCapsule instance to import. It must be located in an optional capsule part within the same capsule that owns the frame service port.
[in]cp_destThe destination capsule part into which the capsule instance will be imported. It must be a plug-in capsule part typed by a capsule that is compatible with the type of the imported capsule instance.
[in]indexThe index within a replicated capsule part where to insert the imported capsule instance. Use -1 to insert the instance at the first free slot.
Returns
1 if the capsule instance was successfully imported, 0 otherwise.

◆ import() [2/2]

int Frame::Base::import ( RTActorRef cp_src,
RTActorRef cp_dest,
int  index = -1 
)

Import a capsule instance into a plug-in capsule part.

Parameters
[in]cp_srcAn optional capsule part that contains exactly one capsule instance that should be imported into another plug-in capsule part. The source capsule part must be located within the same capsule that owns the frame service port.
[in]cp_destThe destination capsule part into which the capsule instance will be imported. It must be a plug-in capsule part typed by a capsule that is compatible with the type of the imported capsule instance.
[in]indexThe index within a replicated capsule part where to insert the imported capsule instance. Use -1 to insert the instance at the first free slot.
Returns
1 if the capsule instance was successfully imported, 0 otherwise.

◆ incarnate() [1/8]

RTActorId Frame::Base::incarnate ( RTActorRef cp)

Incarnates a capsule by creating an instance of the capsule in an optional capsule part.

The capsule to incarnate is determined from the type of the capsule part.

Parameters
[in]cpThe capsule part where to insert the created capsule instance.
Returns
An RTActorId representing the created capsule instance.

◆ incarnate() [2/8]

RTActorId Frame::Base::incarnate ( RTActorRef cp,
const RTActorClass cap 
)

Incarnates a capsule by creating an instance of the capsule in an optional capsule part.

Parameters
[in]cpThe capsule part where to insert the created capsule instance.
[in]capThe capsule to incarnate.
Returns
An RTActorId representing the created capsule instance.

◆ incarnate() [3/8]

RTActorId Frame::Base::incarnate ( RTActorRef cp,
const RTActorClass cap,
const RTDataObject data,
RTController controller = nullptr,
int  index = -1 
)

Incarnates a capsule by creating an instance of the capsule in an optional capsule part.

Parameters
[in]cpThe capsule part where to insert the created capsule instance.
[in]capThe capsule to incarnate.
[in]dataData object to pass to the created capsule instance. The data can be accessed from the initial transition of its state machine.
[in]controllerThe controller which should run the created capsule instance. If it is NULL, the same controller that runs the container capsule instance will be used.
[in]indexThe index within a replicated capsule part where to insert the created capsule instance. Use -1 to insert the instance at the first free slot.
Returns
An RTActorId representing the created capsule instance.

◆ incarnate() [4/8]

RTActorId Frame::Base::incarnate ( RTActorRef cp,
const RTActorClass cap,
const RTTypedValue info,
RTController controller = nullptr,
int  index = -1 
)

Incarnates a capsule by creating an instance of the capsule in an optional capsule part.

Parameters
[in]cpThe capsule part where to insert the created capsule instance.
[in]capThe capsule to incarnate.
[in]infoAn RTTypedValue object which encapsules the data to pass to the created capsule instance. The data can be accessed from the initial transition of its state machine.
[in]controllerThe controller which should run the created capsule instance. If it is NULL, the same controller that runs the container capsule instance will be used.
[in]indexThe index within a replicated capsule part where to insert the created capsule instance. Use -1 to insert the instance at the first free slot.
Returns
An RTActorId representing the created capsule instance.

◆ incarnate() [5/8]

RTActorId Frame::Base::incarnate ( RTActorRef cp,
const RTActorClass cap,
const void *  data,
const RTObject_class type,
RTController controller,
int  index 
)

Incarnates a capsule by creating an instance of the capsule in an optional capsule part.

Parameters
[in]cpThe capsule part where to insert the created capsule instance.
[in]capThe capsule to incarnate.
[in]dataInitialization data to pass to the created capsule instance. It can be accessed from the initial transition of its state machine.
[in]typeType descriptor for the data object.
[in]controllerThe controller which should run the created capsule instance. If it is NULL, the same controller that runs the container capsule instance will be used.
[in]indexThe index within a replicated capsule part where to insert the created capsule instance. Use -1 to insert the instance at the first free slot.
Returns
An RTActorId representing the created capsule instance.

◆ incarnate() [6/8]

RTActorId Frame::Base::incarnate ( RTActorRef cp,
const RTDataObject data,
RTController controller = nullptr,
int  index = -1 
)

Incarnates a capsule by creating an instance of the capsule in an optional capsule part.

The capsule to incarnate is determined from the type of the capsule part.

Parameters
[in]cpThe capsule part where to insert the created capsule instance.
[in]dataData object to pass to the created capsule instance. The data can be accessed from the initial transition of its state machine.
[in]controllerThe controller which should run the created capsule instance. If it is NULL, the same controller that runs the container capsule instance will be used.
[in]indexThe index within a replicated capsule part where to insert the created capsule instance. Use -1 to insert the instance at the first free slot.
Returns
An RTActorId representing the created capsule instance.

◆ incarnate() [7/8]

RTActorId Frame::Base::incarnate ( RTActorRef cp,
const RTTypedValue info,
RTController controller = nullptr,
int  index = -1 
)

Incarnates a capsule by creating an instance of the capsule in an optional capsule part.

The capsule to incarnate is determined from the type of the capsule part.

Parameters
[in]cpThe capsule part where to insert the created capsule instance.
[in]infoAn RTTypedValue object which encapsules the data to pass to the created capsule instance. The data can be accessed from the initial transition of its state machine.
[in]controllerThe controller which should run the created capsule instance. If it is NULL, the same controller that runs the container capsule instance will be used.
[in]indexThe index within a replicated capsule part where to insert the created capsule instance. Use -1 to insert the instance at the first free slot.
Returns
An RTActorId representing the created capsule instance.

◆ incarnate() [8/8]

RTActorId Frame::Base::incarnate ( RTActorRef cp,
const void *  data,
const RTObject_class type,
RTController controller,
int  index 
)

Incarnates a capsule by creating an instance of the capsule in an optional capsule part.

The capsule to incarnate is determined from the type of the capsule part.

Parameters
[in]cpThe capsule part where to insert the created capsule instance.
[in]dataInitialization data to pass to the created capsule instance. It can be accessed from the initial transition of its state machine.
[in]typeType descriptor for the data object.
[in]controllerThe controller which should run the created capsule instance. If it is NULL, the same controller that runs the container capsule instance will be used.
[in]indexThe index within a replicated capsule part where to insert the created capsule instance. Use -1 to insert the instance at the first free slot.
Returns
An RTActorId representing the created capsule instance.

◆ incarnateCustom() [1/2]

RTActorId Frame::Base::incarnateCustom ( RTActorRef cp,
const void *  data,
const RTObject_class type,
RTActorFactory factory,
int  index = -1 
)

Incarnates a capsule by creating an instance of the capsule in an optional capsule part using a custom capsule factory for creating the capsule instance.

Use this instead of the standard incarnate function if you need to create the capsule instance in some special way, for example using another capsule constructor than the one that is used by default.

Parameters
[in]cpThe capsule part where to insert the created capsule instance.
[in]dataInitialization data to pass to the created capsule instance. It can be accessed from the initial transition of its state machine.
[in]typeType descriptor for the data object.
[in]factoryThe capsule factory which will be used for creating the capsule instance.
[in]indexThe index within a replicated capsule part where to insert the created capsule instance. Use -1 to insert the instance at the first free slot.
Returns
An RTActorId representing the created capsule instance.

◆ incarnateCustom() [2/2]

RTActorId Frame::Base::incarnateCustom ( RTActorRef cp,
RTActorFactory factory,
int  index = -1 
)

Incarnates a capsule by creating an instance of the capsule in an optional capsule part using a custom capsule factory for creating the capsule instance.

Use this instead of the standard incarnate function if you need to create the capsule instance in some special way, for example using another capsule constructor than the one that is used by default.

Parameters
[in]cpThe capsule part where to insert the created capsule instance.
[in]factoryThe capsule factory which will be used for creating the capsule instance.
[in]indexThe index within a replicated capsule part where to insert the created capsule instance. Use -1 to insert the instance at the first free slot.
Returns
An RTActorId representing the created capsule instance.

◆ incarnationAt()

RTActorId Frame::Base::incarnationAt ( const RTActorRef cp,
int  index 
)

Return a capsule instance contained in a certain capsule part.

Parameters
[in]cpA capsule part.
[in]indexThe zero-based index of the capsule instance within the capsule part.

◆ incarnationsOf()

RTActorId ** Frame::Base::incarnationsOf ( const RTActorRef cp)

Return all capsule instances contained in a certain capsule part.

Parameters
[in]cpA capsule part.
Returns
An array of pointers to the capsule instances that are contained in the capsule part. The first and last element of the array is NULL, which means that you should use 1-based indexing for accessing a specific capsule instance. Note that it is the caller's responsibility to delete the returned array. If you only want to access one capsule instance it is therefore better to use incarnationAt().

◆ me()

RTActorId Frame::Base::me ( void  )

Return the capsule instance that owns the frame service port.

Returns
The context capsule instance.

◆ myClass()

const RTActorClass & Frame::Base::myClass ( void  )

Get the type of the capsule instance that owns the frame service port.

Returns
The capsule that is the type of the context capsule instance.

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