OpenRTM-aist  1.2.1
SharedMemoryPort.h
Go to the documentation of this file.
1 // -*- C++ -*-
17 #ifndef SHAREDMEMORYPORT_H
18 #define SHAREDMEMORYPORT_H
19 
20 
21 #include <rtm/Manager.h>
22 #include <rtm/idl/SharedMemorySkel.h>
23 #include <coil/SharedMemory.h>
24 
25 #define DEFAULT_DATA_SIZE 8
26 #define DEFAULT_SHARED_MEMORY_SIZE 2097152
27 
28 namespace RTC
29 {
53  : public virtual POA_OpenRTM::PortSharedMemory,
54  public virtual PortableServer::RefCountServantBase
55  {
56  public:
88  virtual ~SharedMemoryPort();
109  virtual int string_to_MemorySize(std::string size_str);
127  virtual void create_memory(::CORBA::ULongLong memory_size, const char *shm_address)
128  throw (CORBA::SystemException);
146  virtual void open_memory(::CORBA::ULongLong memory_size, const char *shm_address)
147  throw (CORBA::SystemException);
161  virtual void close_memory(::CORBA::Boolean unlink = false)
162  throw (CORBA::SystemException);
180  virtual void write(cdrMemoryStream& data);
195  virtual void read(cdrMemoryStream& data);
212  virtual void setInterface(::OpenRTM::PortSharedMemory_ptr sm)
213  throw (CORBA::SystemException);
229  virtual void setEndian(::CORBA::Boolean endian)
230  throw (CORBA::SystemException);
246  virtual ::OpenRTM::PortStatus put()
247  throw (CORBA::SystemException);
263  virtual ::OpenRTM::PortStatus get()
264  throw (CORBA::SystemException);
265 
266  virtual ::OpenRTM::PortSharedMemory_ptr getObjRef();
267 
268  protected:
269  //mutable Logger rtclog;
270  ::OpenRTM::PortSharedMemory_var m_smInterface;
271  bool m_endian;
273  //::OpenRTM::PortSharedMemory_var m_objref;
274 
275 
276  }; // class SharedMemoryPort
277 }; // namespace RTC
278 
279 #ifdef WIN32
280 #pragma warning( default : 4290 )
281 #endif
282 
283 #endif // RTC_RTOBJECT
virtual ~SharedMemoryPort()
Destructor.
RT-Component.
SharedMemoryPort()
Constructor.
virtual void open_memory(::CORBA::ULongLong memory_size, const char *shm_address)
-*- C++ -*-
virtual int string_to_MemorySize(std::string size_str)
coil::SharedMemory m_shmem
Definition: SharedMemoryPort.h:272
virtual void write(cdrMemoryStream &data)
virtual ::OpenRTM::PortStatus put()
virtual void create_memory(::CORBA::ULongLong memory_size, const char *shm_address)
virtual void setEndian(::CORBA::Boolean endian)
SharedMemory class.
Definition: SharedMemory.h:53
::OpenRTM::PortSharedMemory_var m_smInterface
Definition: SharedMemoryPort.h:270
virtual ::OpenRTM::PortSharedMemory_ptr getObjRef()
virtual void setInterface(::OpenRTM::PortSharedMemory_ptr sm)
Definition: SharedMemoryPort.h:52
bool m_endian
Definition: SharedMemoryPort.h:271
virtual void read(cdrMemoryStream &data)
virtual void close_memory(::CORBA::Boolean unlink=false)