OpenRTM-aist
2.1.0
Toggle main menu visibility
読み取り中…
検索中…
一致する文字列を見つけられません
ECFactory.h
[詳解]
1
// -*- C++ -*-
19
20
#ifndef RTC_ECFACTORY_H
21
#define RTC_ECFACTORY_H
22
23
#include <
rtm/ExecutionContextBase.h
>
24
#include <string>
25
26
namespace
RTC
27
{
28
29
using
ECNewFunc
=
ExecutionContextBase
* (*)();
30
using
ECDeleteFunc
= void (*)(
ExecutionContextBase
*);
31
51
template
<
class
T_New>
52
ExecutionContextBase
*
ECCreate
()
53
{
54
return
new
T_New();
55
}
56
76
template
<
class
T_Delete>
77
void
ECDelete
(
ExecutionContextBase
* ec)
78
{
79
delete
ec;
80
}
81
115
class
ECFactoryBase
116
{
117
public
:
133
virtual
~ECFactoryBase
() =
default
;
134
156
virtual
const
char
*
name
() = 0;
157
177
virtual
ExecutionContextBase
*
create
() = 0;
178
198
virtual
void
destroy
(
ExecutionContextBase
* comp) = 0;
199
protected
:
200
};
201
221
class
ECFactoryCXX
222
:
public
ECFactoryBase
223
{
224
public
:
248
ECFactoryCXX
(
const
char
*
name
,
249
ECNewFunc
new_func,
250
ECDeleteFunc
delete_func);
251
267
~ECFactoryCXX
()
override
;
268
288
const
char
*
name
()
override
;
289
309
ExecutionContextBase
*
create
()
override
;
310
330
void
destroy
(
ExecutionContextBase
* ec)
override
;
331
332
protected
:
340
std::string
m_name
;
341
349
ECNewFunc
m_New
;
350
358
ECDeleteFunc
m_Delete
;
359
};
360
}
// namespace RTC
361
#endif
// RTC_ECFACTORY_H
ExecutionContextBase.h
ExecutionContext base class
RTC::ECFactoryBase
ECFactoryBase 抽象クラス
Definition
ECFactory.h:116
RTC::ECFactoryBase::name
virtual const char * name()=0
生成対象ExecutionContext名称取得用純粋仮想関数
RTC::ECFactoryBase::~ECFactoryBase
virtual ~ECFactoryBase()=default
仮想デストラクタ
RTC::ECFactoryBase::create
virtual ExecutionContextBase * create()=0
ExecutionContext生成用純粋仮想関数
RTC::ECFactoryBase::destroy
virtual void destroy(ExecutionContextBase *comp)=0
ExecutionContext破棄用純粋仮想関数
RTC::ECFactoryCXX::m_New
ECNewFunc m_New
対象ExecutionContext生成用関数
Definition
ECFactory.h:349
RTC::ECFactoryCXX::create
ExecutionContextBase * create() override
生成対象ExecutionContextインスタンスを生成
RTC::ECFactoryCXX::destroy
void destroy(ExecutionContextBase *ec) override
対象ExecutionContextインスタンスを破棄
RTC::ECFactoryCXX::ECFactoryCXX
ECFactoryCXX(const char *name, ECNewFunc new_func, ECDeleteFunc delete_func)
コンストラクタ
RTC::ECFactoryCXX::m_Delete
ECDeleteFunc m_Delete
対象ExecutionContext破棄用関数
Definition
ECFactory.h:358
RTC::ECFactoryCXX::name
const char * name() override
生成対象ExecutionContext名称を取得
RTC::ECFactoryCXX::m_name
std::string m_name
生成対象ExecutionContext名称
Definition
ECFactory.h:340
RTC::ECFactoryCXX::~ECFactoryCXX
~ECFactoryCXX() override
仮想デストラクタ
RTC::ExecutionContextBase
ExecutionContext用基底クラス
Definition
ExecutionContextBase.h:366
RTC
RTコンポーネント
RTC::ECNewFunc
ExecutionContextBase *(*)() ECNewFunc
Definition
ECFactory.h:29
RTC::ECDeleteFunc
void(*)(ExecutionContextBase *) ECDeleteFunc
Definition
ECFactory.h:30
RTC::ECDelete
void ECDelete(ExecutionContextBase *ec)
ExecutionContext破棄用テンプレート関数
Definition
ECFactory.h:77
RTC::ECCreate
ExecutionContextBase * ECCreate()
ExecutionContext生成用テンプレート関数
Definition
ECFactory.h:52
構築:
1.17.0