C++ TargetRTS
Loading...
Searching...
No Matches
Public Member Functions | List of all members
RTDefaultActorFactory< CapsuleClass > Class Template Reference

A capsule factory with a default implementation for how to create and destroy capsule instances. More...

#include <RTDefaultActorFactory.h>

Inheritance diagram for RTDefaultActorFactory< CapsuleClass >:
RTActorFactoryInterface

Public Member Functions

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

template<typename CapsuleClass>
class RTDefaultActorFactory< CapsuleClass >

A capsule factory with a default implementation for how to create and destroy capsule instances.

This default implementation is the same as is used for capsule parts without any capsule factory. In generated code this class is used as base class for a custom capsule factory for a capsule part, where "create" and/or "destroy" has a user-defined implementation.

Member Function Documentation

◆ create()

template<typename CapsuleClass >
RTActor * RTDefaultActorFactory< CapsuleClass >::create ( RTController rts,
RTActorRef ref,
int  index 
)
inlineoverridevirtual

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()

template<typename CapsuleClass >
void RTDefaultActorFactory< CapsuleClass >::destroy ( RTActor actor)
inlineoverridevirtual

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: