OpenRTM
1.0.0
メインページ
ネームスペース
クラス
ファイル
ファイル一覧
ファイルメンバ
tmp
buildd
ros-hydro-openrtm-aist-1.1.0-13quantal-20150213-1351
src
lib
rtm
rtm/Factory.h
説明を見る。
1
// -*- C++ -*-
20
#ifndef RTC_FACTORY_H
21
#define RTC_FACTORY_H
22
23
#include <
coil/Properties.h
>
24
//#include <rtm/RTObject.h>
25
#include <
rtm/NumberingPolicy.h
>
26
27
28
namespace
RTC
29
{
30
class
RTObject_impl;
31
class
Manager;
32
33
typedef
RTObject_impl
* (*RtcNewFunc)(
Manager
* manager);
34
typedef
void (*
RtcDeleteFunc
)(
RTObject_impl
* rtc);
35
64
template
<
class
_New>
65
RTObject_impl
*
Create
(
Manager
* manager)
66
{
67
return
new
_New(manager);
68
}
69
91
template
<
class
_Delete>
92
void
Delete
(
RTObject_impl
* rtc)
93
{
94
delete
rtc;
95
}
96
118
class
FactoryBase
119
{
120
public
:
140
FactoryBase
(
const
coil::Properties
&
profile
);
141
155
virtual
~FactoryBase
(
void
);
156
180
virtual
RTObject_impl
*
create
(
Manager
* mgr) = 0;
181
201
virtual
void
destroy
(
RTObject_impl
* comp) = 0;
202
222
virtual
coil::Properties
&
profile
();
223
243
virtual
int
number
();
244
245
protected
:
253
coil::Properties
m_Profile
;
254
262
int
m_Number
;
263
};
264
286
class
FactoryCXX
287
:
public
FactoryBase
288
{
289
public
:
323
FactoryCXX
(
const
coil::Properties
&
profile
,
324
RtcNewFunc
new_func,
325
RtcDeleteFunc
delete_func,
326
NumberingPolicy
* policy =
new
DefaultNumberingPolicy
());
327
328
virtual
~FactoryCXX
()
329
{
330
delete
m_policy
;
331
}
332
356
virtual
RTObject_impl
*
create
(
Manager
* mgr);
357
377
virtual
void
destroy
(
RTObject_impl
* comp);
378
379
protected
:
387
RtcNewFunc
m_New
;
388
396
RtcDeleteFunc
m_Delete
;
397
405
NumberingPolicy
*
m_policy
;
406
};
407
};
408
#endif // RTC_FACTORY_H
OpenRTMに対してFri Feb 13 2015 13:57:28に生成されました。
1.8.1.2