Orocos Real-Time Toolkit  2.8.3
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"
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" )
56  if ( name == "double" )
58  //if ( name == "string" )
59  // return ti->addProtocol(ORO_MQUEUE_PROTOCOL_ID, new MQTemplateProtocol<std::string>() );
60  if ( name == "float" )
62  if ( name == "uint" )
64  if ( name == "char" )
66  //if ( name == "long" )
67  // return ti->addProtocol(ORO_MQUEUE_PROTOCOL_ID, new MQTemplateProtocol<long>() );
68  //if ( name == "PropertyBag" )
69  // return ti->addProtocol(ORO_MQUEUE_PROTOCOL_ID, new MQTemplateProtocol<PropertyBag>() );
70  if ( name == "bool" )
72  if ( name == "array" )
73  return ti->addProtocol(ORO_MQUEUE_PROTOCOL_ID, new MQSerializationProtocol< std::vector<double> >() );
74  //if ( name == "void" )
75  // return ti->addProtocol(ORO_MQUEUE_PROTOCOL_ID, new MQFallBackProtocol(false)); // warn=false
76  return false;
77  }
78 
79  std::string MQLibPlugin::getTransportName() const {
80  return "mqueue";
81  }
82 
83  std::string MQLibPlugin::getTypekitName() const {
84  return "rtt-types";
85  }
86  std::string MQLibPlugin::getName() const {
87  return "rtt-mqueue-transport";
88  }
89  }
90 }
91 
#define ORO_TYPEKIT_PLUGIN(TYPEKIT)
Once you defined your TypekitPlugin or TransportPlugin class, you can use this macro to make it avail...
STL namespace.
Convenient short notation for every sub-namespace of RTT.
For each transportable type T, specify the conversion functions.
A class for representing a user type, and which can build instances of that type. ...
Definition: TypeInfo.hpp:66
bool addProtocol(int protocol_id, TypeTransporter *tt)
Register a protocol for data transport over a network.
Definition: TypeInfo.cpp:137
Contains TaskContext, Activity, OperationCaller, Operation, Property, InputPort, OutputPort, Attribute.
Definition: Activity.cpp:51
#define ORO_MQUEUE_PROTOCOL_ID
Definition: MQLib.hpp:57
The CORBA transport plugin.
Definition: MQLib.hpp:47