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>
|
| RTActorFactory (std::function< RTActor *(RTController *, RTActorRef *, int)> createFunc) |
| Create a capsule factory which will use the provided function to implement capsule instance creation.
|
|
RTActor * | create (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 RTActor * | create (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.
|
|
A capsule factory where capsule instances are created by means of a provided 'create' function, and deleted using the regular delete operator.
◆ RTActorFactory()
Create a capsule factory which will use the provided function to implement capsule instance creation.
- Parameters
-
[in] | createFunc | A function which performs creation of a capsule instance |
◆ create()
Called by the TargetRTS to create a capsule instance, which later will be inserted into a capsule part.
- Parameters
-
[in] | rts | The controller that would run the new capsule instance by default |
[in] | ref | The capsule part where the created instance will later be inserted |
[in] | index | The 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] | actor | Capsule instance to be destroyed |
Implements RTActorFactoryInterface.
The documentation for this class was generated from the following file: