C++ TargetRTS
Loading...
Searching...
No Matches
Public Member Functions | List of all members
RTActorFactory Class Referencefinal

A capsule factory where capsule instances are created by means of a provided 'create' function, and deleted using the regular delete operator. More...

#include <RTActorFactory.h>

Inheritance diagram for RTActorFactory:
RTActorFactoryInterface

Public Member Functions

 RTActorFactory (std::function< RTActor *(RTController *, RTActorRef *, int)> createFunc)
 Create a capsule factory which will use the provided function to implement capsule instance creation.
 
RTActorcreate (RTController *rts, RTActorRef *ref, int index) override
 Called by the TargetRTS to create a capsule instance, which later will be inserted into a capsule part.
 
void destroy (RTActor *actor) override
 Called by the TargetRTS to destroy a capsule instance.
 
virtual RTActorcreate (RTController *rts, RTActorRef *ref, int index)=0
 Called by the TargetRTS to create a capsule instance, which later will be inserted into a capsule part.
 
virtual void destroy (RTActor *actor)=0
 Called by the TargetRTS to destroy a capsule instance.
 

Detailed Description

A capsule factory where capsule instances are created by means of a provided 'create' function, and deleted using the regular delete operator.

Constructor & Destructor Documentation

◆ RTActorFactory()

RTActorFactory::RTActorFactory ( std::function< RTActor *(RTController *, RTActorRef *, int)>  createFunc)

Create a capsule factory which will use the provided function to implement capsule instance creation.

Parameters
[in]createFuncA function which performs creation of a capsule instance

Member Function Documentation

◆ create()

RTActor * RTActorFactory::create ( RTController rts,
RTActorRef ref,
int  index 
)
overridevirtual

Called by the TargetRTS to create a capsule instance, which later will be inserted into a capsule part.

Parameters
[in]rtsThe controller that would run the new capsule instance by default
[in]refThe capsule part where the created instance will later be inserted
[in]indexThe index within the capsule part where the instance will later be inserted
Returns
The created capsule instance, ready to be inserted into the capsule part. If nullptr is returned the TargetRTS will use the capsule's RTActorCreator for creating the instance.

Implements RTActorFactoryInterface.

◆ destroy()

void RTActorFactory::destroy ( RTActor actor)
overridevirtual

Called by the TargetRTS to destroy a capsule instance.

Parameters
[in]actorCapsule instance to be destroyed

Implements RTActorFactoryInterface.


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