CorbaConnection.hpp

00001 #ifndef CORBACONNECTION_HPP_
00002 #define CORBACONNECTION_HPP_
00003 
00004 #if 0
00005 //necessary to keep MSVC happy 
00006 //avoids redefinitions in winsock2.h
00007 #pragma push_macro("_WINSOCKAPI_")
00008 #ifndef _WINSOCKAPI_
00009 #define _WINSOCKAPI_
00010 #endif
00011 
00012 #include <windows.h>
00013 
00014 #pragma pop_macro("_WINSOCKAPI_")
00015 
00016 #endif
00017 
00018 #include "corba.h"
00019 #ifdef CORBA_IS_TAO
00020 #include <tao/corba.h>
00021 #include <tao/PortableServer/PortableServer.h>
00022 #else
00023 #include <omniORB4/CORBA.h>
00024 #include <omniORB4/poa.h>
00025 #endif
00026 
00027 #include "DataFlowC.h"
00028 #include "../ConnectionInterface.hpp"
00029 
00030 namespace RTT
00031 {
00032 
00033     namespace Corba
00034     {
00035 
00036         class RTT_CORBA_API CorbaConnection : public RTT::ConnectionInterface
00037         {
00038             std::string mname;
00039             AssignableExpression_var mdatachannel;
00040             BufferChannel_var mbufchannel;
00041             DataFlowInterface_var mdflow;
00046             ConnectionInterface::shared_ptr lcc;
00052             bool createConnection(PortInterface* p);
00053         public:
00054             CorbaConnection(const std::string& mname, DataFlowInterface_ptr dflow, PortableServer::POA_ptr);
00055             CorbaConnection(const std::string& mname, DataFlowInterface_ptr dflow, AssignableExpression_ptr datachannel, PortableServer::POA_ptr );
00056             CorbaConnection(const std::string& mname, DataFlowInterface_ptr dflow, BufferChannel_ptr bufchannel, PortableServer::POA_ptr);
00057             virtual ~CorbaConnection();
00058             virtual DataSourceBase::shared_ptr getDataSource() const;
00059 
00060             virtual BufferBase::shared_ptr getBuffer() const;
00061 
00062             virtual bool connect();
00063 
00064             virtual bool connected() const;
00065 
00066             virtual bool disconnect();
00067 
00068             virtual bool addPort(PortInterface* r);
00069 
00070             virtual bool removePort(PortInterface* r);
00071 
00072             virtual const RTT::TypeInfo* getTypeInfo() const;
00073 
00074             virtual int serverProtocol() const;
00075         };
00076 
00077     }
00078 
00079 }
00080 
00081 #endif /*CORBACONNECTION_HPP_*/
Generated on Thu Dec 23 13:22:36 2010 for Orocos Real-Time Toolkit by  doxygen 1.6.3