00001 /* 00002 * 00003 * 00004 * Distributed under the OpenDDS License. 00005 * See: http://www.opendds.org/license.html 00006 */ 00007 00008 #ifndef OPENDDS_SHMEMINST_H 00009 #define OPENDDS_SHMEMINST_H 00010 00011 #include "Shmem_Export.h" 00012 #include "ShmemTransport.h" 00013 00014 #include "dds/DCPS/transport/framework/TransportInst.h" 00015 00016 OPENDDS_BEGIN_VERSIONED_NAMESPACE_DECL 00017 00018 namespace OpenDDS { 00019 namespace DCPS { 00020 00021 class OpenDDS_Shmem_Export ShmemInst : public TransportInst { 00022 public: 00023 00024 virtual int load(ACE_Configuration_Heap& cf, 00025 ACE_Configuration_Section_Key& sect); 00026 00027 virtual OPENDDS_STRING dump_to_str() const; 00028 00029 /// Size (in bytes) of the single shared-memory pool allocated by this 00030 /// transport instance. Defaults to 16 megabytes. 00031 size_t pool_size_; 00032 00033 /// Size (in bytes) of the control area allocated for each data link. 00034 /// This allocation comes out of the shared-memory pool defined by pool_size_. 00035 /// Defaults to 4 kilobytes. 00036 size_t datalink_control_size_; 00037 00038 bool is_reliable() const { return true; } 00039 00040 virtual size_t populate_locator(OpenDDS::DCPS::TransportLocator& trans_info) const; 00041 00042 const std::string& hostname() const { return hostname_; } 00043 const std::string& poolname() const { return poolname_; } 00044 00045 private: 00046 friend class ShmemType; 00047 template <typename T, typename U> 00048 friend RcHandle<T> OpenDDS::DCPS::make_rch(U const&); 00049 explicit ShmemInst(const std::string& name); 00050 00051 TransportImpl_rch new_impl(); 00052 std::string hostname_; 00053 std::string poolname_; 00054 }; 00055 00056 } // namespace DCPS 00057 } // namespace OpenDDS 00058 00059 OPENDDS_END_VERSIONED_NAMESPACE_DECL 00060 00061 #endif /* OPENDDS_SHMEMINST_H */ 00062