OpenRTM
1.0.0
Main Page
Namespaces
Classes
Files
File List
File Members
tmp
binarydeb
ros-indigo-openrtm-aist-1.1.0
src
lib
rtm
ECFactory.h
Go to the documentation of this file.
1
// -*- C++ -*-
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
typedef
ExecutionContextBase
* (*ECNewFunc)();
30
typedef
void (*
ECDeleteFunc
)(
ExecutionContextBase
* ec);
31
51
template
<
class
_New>
52
ExecutionContextBase
*
ECCreate
()
53
{
54
return
new
_New();
55
}
56
76
template
<
class
_Delete>
77
void
ECDelete
(
ExecutionContextBase
* ec)
78
{
79
delete
ec;
80
}
81
115
class
ECFactoryBase
116
{
117
public
:
133
virtual
~ECFactoryBase
(
void
){};
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
(
void
);
268
288
virtual
const
char
*
name
();
289
309
virtual
ExecutionContextBase
*
create
();
310
330
virtual
void
destroy
(
ExecutionContextBase
* comp);
331
332
protected
:
340
std::string
m_name
;
341
349
ECNewFunc
m_New
;
350
358
ECDeleteFunc
m_Delete
;
359
};
360
};
361
#endif // RTC_ECFACTORY_H
Generated on Mon Mar 13 2017 01:58:13 for OpenRTM by
1.8.4