C++ TargetRTS
Loading...
Searching...
No Matches
RTActorFactory.h
1/*
2 * Licensed Materials - Property of HCL and/or IBM
3 * Copyright HCL Technologies Ltd. 2016, 2021. All Rights Reserved.
4 * Copyright IBM Corporation 1999, 2016. All Rights Reserved.
5 *
6 * U.S. Government Users Restricted Rights - Use, duplication or
7 * disclosure restricted by GSA ADP Schedule.
8 */
9
10#ifndef __RTActorFactory_h__
11#define __RTActorFactory_h__
12
13
14#include <RTConfig.h>
15
16class RTController;
17class RTActorRef;
18class RTActor;
19
20#include "RTActorFactoryInterface.h"
21
25#if RTUseCPP11
26#include <functional>
28 RTActorFactory() = delete;
29 std::function<RTActor* (RTController *, RTActorRef *, int)> creator;
30public:
35 RTActorFactory(std::function<RTActor* (RTController *, RTActorRef *, int)> createFunc);
36#else
37 /* An old C++ compiler can compile this code, but not use RTActorFactory */
39public:
41#endif
42 RTActor* create(RTController *rts, RTActorRef *ref, int index) override;
43
44 void destroy(RTActor* actor) override;
45
46};
47
48#endif // __RTActorFactory_h__
A capsule factory where capsule instances are created by means of a provided 'create' function,...
Definition: RTActorFactory.h:27
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 par...
void destroy(RTActor *actor) override
Called by the TargetRTS to destroy a capsule instance.
RTActorFactory(std::function< RTActor *(RTController *, RTActorRef *, int)> createFunc)
Create a capsule factory which will use the provided function to implement capsule instance creation.
Interface of a capsule factory responsible for creating and destroying capsule instances in a capsule...
Definition: RTActorFactoryInterface.h:15
An instance of this class represents a capsule instance.
Definition: RTActor.h:44
Represents a capsule part.
Definition: RTActorRef.h:39
A controller manages a group of capsule instances that all run in the same physical thread (i....
Definition: RTController.h:54