Main Page
Related Pages
Modules
Namespaces
Classes
Files
Examples
File List
File Members
rtt
transports
mqueue
MQLib.cpp
Go to the documentation of this file.
1
/***************************************************************************
2
tag: Peter Soetens Thu Oct 22 11:59:07 CEST 2009 MQLib.cpp
3
4
MQLib.cpp - description
5
-------------------
6
begin : Thu October 22 2009
7
copyright : (C) 2009 Peter Soetens
8
email : peter@thesourcworks.com
9
10
***************************************************************************
11
* This library is free software; you can redistribute it and/or *
12
* modify it under the terms of the GNU General Public *
13
* License as published by the Free Software Foundation; *
14
* version 2 of the License. *
15
* *
16
* As a special exception, you may use this file as part of a free *
17
* software library without restriction. Specifically, if other files *
18
* instantiate templates or use macros or inline functions from this *
19
* file, or you compile this file and link it with other files to *
20
* produce an executable, this file does not by itself cause the *
21
* resulting executable to be covered by the GNU General Public *
22
* License. This exception does not however invalidate any other *
23
* reasons why the executable file might be covered by the GNU General *
24
* Public License. *
25
* *
26
* This library is distributed in the hope that it will be useful, *
27
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
28
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
29
* Lesser General Public License for more details. *
30
* *
31
* You should have received a copy of the GNU General Public *
32
* License along with this library; if not, write to the Free Software *
33
* Foundation, Inc., 59 Temple Place, *
34
* Suite 330, Boston, MA 02111-1307 USA *
35
* *
36
***************************************************************************/
37
38
39
40
#include "
MQLib.hpp
"
41
#include "
MQTemplateProtocol.hpp
"
42
#include "
MQSerializationProtocol.hpp
"
43
#include "../../types/TransportPlugin.hpp"
44
#include "../../types/TypekitPlugin.hpp"
45
#include <boost/serialization/vector.hpp>
46
47
using namespace
std
;
48
using namespace
RTT::detail
;
49
50
namespace
RTT
{
51
namespace
mqueue {
52
bool
MQLibPlugin::registerTransport(std::string name,
TypeInfo
* ti)
53
{
54
if
( name ==
"int"
)
55
return
ti->
addProtocol
(
ORO_MQUEUE_PROTOCOL_ID
,
new
MQTemplateProtocol<int>
() );
56
if
( name ==
"double"
)
57
return
ti->
addProtocol
(
ORO_MQUEUE_PROTOCOL_ID
,
new
MQTemplateProtocol<double>
() );
58
//if ( name == "string" )
59
// return ti->addProtocol(ORO_MQUEUE_PROTOCOL_ID, new MQTemplateProtocol<std::string>() );
60
if
( name ==
"float"
)
61
return
ti->
addProtocol
(
ORO_MQUEUE_PROTOCOL_ID
,
new
MQTemplateProtocol<float>
() );
62
if
( name ==
"uint"
)
63
return
ti->
addProtocol
(
ORO_MQUEUE_PROTOCOL_ID
,
new
MQTemplateProtocol<unsigned int>
() );
64
if
( name ==
"char"
)
65
return
ti->
addProtocol
(
ORO_MQUEUE_PROTOCOL_ID
,
new
MQTemplateProtocol<char>
() );
66
if
( name ==
"llong"
)
67
return
ti->
addProtocol
(
ORO_MQUEUE_PROTOCOL_ID
,
new
MQTemplateProtocol<long long>
() );
68
if
( name ==
"ullong"
)
69
return
ti->
addProtocol
(
ORO_MQUEUE_PROTOCOL_ID
,
new
MQTemplateProtocol<unsigned long long>
() );
70
//if ( name == "long" )
71
// return ti->addProtocol(ORO_MQUEUE_PROTOCOL_ID, new MQTemplateProtocol<long>() );
72
//if ( name == "PropertyBag" )
73
// return ti->addProtocol(ORO_MQUEUE_PROTOCOL_ID, new MQTemplateProtocol<PropertyBag>() );
74
if
( name ==
"bool"
)
75
return
ti->
addProtocol
(
ORO_MQUEUE_PROTOCOL_ID
,
new
MQTemplateProtocol<bool>
() );
76
if
( name ==
"array"
)
77
return
ti->
addProtocol
(
ORO_MQUEUE_PROTOCOL_ID
,
new
MQSerializationProtocol
< std::vector<double> >() );
78
//if ( name == "void" )
79
// return ti->addProtocol(ORO_MQUEUE_PROTOCOL_ID, new MQFallBackProtocol(false)); // warn=false
80
return
false
;
81
}
82
83
std::string MQLibPlugin::getTransportName()
const
{
84
return
"mqueue"
;
85
}
86
87
std::string MQLibPlugin::getTypekitName()
const
{
88
return
"rtt-types"
;
89
}
90
std::string MQLibPlugin::getName()
const
{
91
return
"rtt-mqueue-transport"
;
92
}
93
}
94
}
95
96
ORO_TYPEKIT_PLUGIN
(
RTT::mqueue::MQLibPlugin
)
ORO_TYPEKIT_PLUGIN
#define ORO_TYPEKIT_PLUGIN(TYPEKIT)
Definition:
TypekitPlugin.hpp:131
MQTemplateProtocol.hpp
MQSerializationProtocol.hpp
std
Definition:
mystd.hpp:163
RTT::detail
Definition:
rtt-base-fwd.hpp:97
RTT::mqueue::MQTemplateProtocol
Definition:
MQTemplateProtocol.hpp:61
RTT::types::TypeInfo
Definition:
TypeInfo.hpp:67
RTT::types::TypeInfo::addProtocol
bool addProtocol(int protocol_id, TypeTransporter *tt)
Definition:
TypeInfo.cpp:137
RTT::mqueue::MQSerializationProtocol
Definition:
MQSerializationProtocol.hpp:61
RTT
Contains TaskContext, Activity, OperationCaller, Operation, Property, InputPort, OutputPort, Attribute.
Definition:
Activity.cpp:53
ORO_MQUEUE_PROTOCOL_ID
#define ORO_MQUEUE_PROTOCOL_ID
Definition:
MQLib.hpp:57
RTT::mqueue::MQLibPlugin
Definition:
MQLib.hpp:47
MQLib.hpp
rtt
Author(s): RTT Developers
autogenerated on Tue Jun 25 2019 19:33:25