Orocos Real-Time Toolkit  2.8.3
TemplateConnFactory.hpp
Go to the documentation of this file.
1 #ifndef ORO_TEMPLATE_CONN_FACTORY_HPP
2 #define ORO_TEMPLATE_CONN_FACTORY_HPP
3 
4 #include <string>
5 #include "../internal/ConnFactory.hpp"
6 
7 #include "../InputPort.hpp"
8 #include "../OutputPort.hpp"
9 #include "../Logger.hpp"
10 
11 namespace RTT
12 { namespace types {
13  using internal::ConnFactory;
14 
15  template<class T>
16  class TemplateConnFactory : public ConnFactory
17  {
18  public:
19  base::InputPortInterface* inputPort(std::string const& name) const { return new InputPort<T>(name); }
20  base::OutputPortInterface* outputPort(std::string const& name) const { return new OutputPort<T>(name); }
21 
23  return ConnFactory::buildDataStorage<T>(policy);
24  }
25 
27  {
29  static_cast<RTT::InputPort<T>&>(port), new internal::SimpleConnID());
30  }
31 
33  {
35  static_cast<RTT::OutputPort<T>&>(port), new internal::SimpleConnID(), 0 );
36  }
37  };
38 }
39 }
40 
41 #endif
The base class of the InputPort.
virtual base::ChannelElementBase::shared_ptr buildChannelInput(base::OutputPortInterface &port) const =0
Creates the input endpoint (starting point) of a communication channel and adds it to an OutputPort...
A component&#39;s data input port.
Definition: InputPort.hpp:63
virtual base::ChannelElementBase::shared_ptr buildChannelOutput(base::InputPortInterface &port) const =0
Creates the output endpoint of a communication channel and adds it to an InputPort.
A connection policy object describes how a given connection should behave.
Definition: ConnPolicy.hpp:92
The base class of each OutputPort.
base::OutputPortInterface * outputPort(std::string const &name) const
base::ChannelElementBase::shared_ptr buildDataStorage(ConnPolicy const &policy) const
base::ChannelElementBase::shared_ptr buildChannelOutput(base::InputPortInterface &port) const
base::ChannelElementBase::shared_ptr buildChannelInput(base::OutputPortInterface &port) const
boost::intrusive_ptr< ChannelElementBase > shared_ptr
A simplistic id that is only same with its own clones (and clones of clones).
Definition: ConnID.hpp:69
A component&#39;s data output port.
Definition: OutputPort.hpp:70
base::InputPortInterface * inputPort(std::string const &name) const
Contains TaskContext, Activity, OperationCaller, Operation, Property, InputPort, OutputPort, Attribute.
Definition: Activity.cpp:51