00001 /* 00002 * 00003 * 00004 * Distributed under the OpenDDS License. 00005 * See: http://www.opendds.org/license.html 00006 */ 00007 00008 #ifndef OPENDDS_SHMEMSENDSTRATEGY_H 00009 #define OPENDDS_SHMEMSENDSTRATEGY_H 00010 00011 #include "Shmem_Export.h" 00012 00013 #include "dds/DCPS/transport/framework/TransportSendStrategy.h" 00014 00015 #include "ace/OS_NS_Thread.h" 00016 00017 #include <string> 00018 00019 OPENDDS_BEGIN_VERSIONED_NAMESPACE_DECL 00020 00021 namespace OpenDDS { 00022 namespace DCPS { 00023 00024 class ShmemDataLink; 00025 class ShmemInst; 00026 struct ShmemData; 00027 typedef RcHandle<ShmemInst> ShmemInst_rch; 00028 00029 class OpenDDS_Shmem_Export ShmemSendStrategy 00030 : public TransportSendStrategy { 00031 public: 00032 ShmemSendStrategy(ShmemDataLink* link); 00033 00034 virtual bool start_i(); 00035 virtual void stop_i(); 00036 00037 protected: 00038 virtual ssize_t send_bytes_i(const iovec iov[], int n); 00039 00040 private: 00041 ShmemDataLink* link_; 00042 std::string bound_name_; 00043 ACE_sema_t peer_semaphore_; 00044 ShmemData* current_data_; 00045 const size_t datalink_control_size_; 00046 }; 00047 00048 } // namespace DCPS 00049 } // namespace OpenDDS 00050 00051 OPENDDS_END_VERSIONED_NAMESPACE_DECL 00052 00053 #endif /* OPENDDS_SHMEMSENDSTRATEGY_H */