OpenDDS::DCPS::ShmemInst Class Reference

#include <ShmemInst.h>

Inheritance diagram for OpenDDS::DCPS::ShmemInst:
Inheritance graph
[legend]
Collaboration diagram for OpenDDS::DCPS::ShmemInst:
Collaboration graph
[legend]

List of all members.

Public Member Functions

virtual int load (ACE_Configuration_Heap &cf, ACE_Configuration_Section_Key &sect)
virtual OPENDDS_STRING dump_to_str () const
bool is_reliable () const
 Does the transport as configured support RELIABLE_RELIABILITY_QOS?
virtual size_t populate_locator (OpenDDS::DCPS::TransportLocator &trans_info) const
 Populate a transport locator sequence. Return the number of "locators.".
const std::string & hostname () const
const std::string & poolname () const

Public Attributes

size_t pool_size_
size_t datalink_control_size_

Private Member Functions

 ShmemInst (const std::string &name)
TransportImpl_rch new_impl ()

Private Attributes

std::string hostname_
std::string poolname_

Friends

class ShmemType
template<typename T , typename U >
RcHandle< T > OpenDDS::DCPS::make_rch (U const &)

Detailed Description

Definition at line 21 of file ShmemInst.h.


Constructor & Destructor Documentation

OpenDDS::DCPS::ShmemInst::ShmemInst ( const std::string &  name  )  [explicit, private]

Definition at line 24 of file ShmemInst.cpp.

References ACE_OS::getpid(), OpenDDS::DCPS::TransportInst::name(), and poolname_.

00025   : TransportInst("shmem", name)
00026   , pool_size_(16 * 1024 * 1024)
00027   , datalink_control_size_(4 * 1024)
00028   , hostname_(get_fully_qualified_hostname())
00029 {
00030   std::ostringstream pool;
00031   pool << "OpenDDS-" << ACE_OS::getpid() << '-' << this->name();
00032   poolname_ = pool.str();
00033 
00034 }

Here is the call graph for this function:


Member Function Documentation

OPENDDS_STRING OpenDDS::DCPS::ShmemInst::dump_to_str (  )  const [virtual]

Reimplemented from OpenDDS::DCPS::TransportInst.

Definition at line 55 of file ShmemInst.cpp.

References datalink_control_size_, OpenDDS::DCPS::TransportInst::formatNameForDump(), OPENDDS_STRING, and pool_size_.

00056 {
00057   std::ostringstream os;
00058   os << TransportInst::dump_to_str() << std::endl;
00059   os << formatNameForDump("pool_size") << pool_size_ << "\n"
00060      << formatNameForDump("datalink_control_size") << datalink_control_size_
00061      << std::endl;
00062   return OPENDDS_STRING(os.str());
00063 }

Here is the call graph for this function:

const std::string& OpenDDS::DCPS::ShmemInst::hostname (  )  const [inline]

Definition at line 42 of file ShmemInst.h.

00042 { return hostname_; }

bool OpenDDS::DCPS::ShmemInst::is_reliable (  )  const [inline, virtual]

Does the transport as configured support RELIABLE_RELIABILITY_QOS?

Implements OpenDDS::DCPS::TransportInst.

Definition at line 38 of file ShmemInst.h.

00038 { return true; }

int OpenDDS::DCPS::ShmemInst::load ( ACE_Configuration_Heap cf,
ACE_Configuration_Section_Key sect 
) [virtual]

Overwrite the default configurations with the configuration from the given section in the ACE_Configuration_Heap object.

Reimplemented from OpenDDS::DCPS::TransportInst.

Definition at line 43 of file ShmemInst.cpp.

References ACE_TEXT(), datalink_control_size_, GET_CONFIG_VALUE, and pool_size_.

00045 {
00046   TransportInst::load(cf, sect);
00047 
00048   GET_CONFIG_VALUE(cf, sect, ACE_TEXT("pool_size"), pool_size_, size_t)
00049   GET_CONFIG_VALUE(cf, sect, ACE_TEXT("datalink_control_size"),
00050                    datalink_control_size_, size_t)
00051   return 0;
00052 }

Here is the call graph for this function:

TransportImpl_rch OpenDDS::DCPS::ShmemInst::new_impl (  )  [private, virtual]

Implements OpenDDS::DCPS::TransportInst.

Definition at line 37 of file ShmemInst.cpp.

References OpenDDS::DCPS::ref().

00038 {
00039   return make_rch<ShmemTransport>(ref(*this));
00040 }

Here is the call graph for this function:

const std::string& OpenDDS::DCPS::ShmemInst::poolname (  )  const [inline]

Definition at line 43 of file ShmemInst.h.

Referenced by OpenDDS::DCPS::ShmemTransport::address(), and OpenDDS::DCPS::ShmemTransport::configure_i().

00043 { return poolname_; }

Here is the caller graph for this function:

size_t OpenDDS::DCPS::ShmemInst::populate_locator ( OpenDDS::DCPS::TransportLocator trans_info  )  const [virtual]

Populate a transport locator sequence. Return the number of "locators.".

Implements OpenDDS::DCPS::TransportInst.

Definition at line 66 of file ShmemInst.cpp.

References OpenDDS::DCPS::TransportLocator::data, hostname_, len, poolname_, and OpenDDS::DCPS::TransportLocator::transport_type.

Referenced by OpenDDS::DCPS::ShmemTransport::connection_info_i().

00067 {
00068   info.transport_type = "shmem";
00069 
00070   const size_t len = hostname_.size() + 1 /* null */ + poolname_.size();
00071   info.data.length(static_cast<CORBA::ULong>(len));
00072 
00073   CORBA::Octet* buff = info.data.get_buffer();
00074   std::memcpy(buff, hostname_.c_str(), hostname_.size());
00075   buff += hostname_.size();
00076 
00077   *(buff++) = 0;
00078   std::memcpy(buff, poolname_.c_str(), poolname_.size());
00079 
00080   return 1;
00081 }

Here is the caller graph for this function:


Friends And Related Function Documentation

template<typename T , typename U >
RcHandle<T> OpenDDS::DCPS::make_rch ( U const &   )  [friend]
friend class ShmemType [friend]

Definition at line 46 of file ShmemInst.h.


Member Data Documentation

Size (in bytes) of the control area allocated for each data link. This allocation comes out of the shared-memory pool defined by pool_size_. Defaults to 4 kilobytes.

Definition at line 36 of file ShmemInst.h.

Referenced by dump_to_str(), and load().

std::string OpenDDS::DCPS::ShmemInst::hostname_ [private]

Definition at line 52 of file ShmemInst.h.

Referenced by populate_locator().

Size (in bytes) of the single shared-memory pool allocated by this transport instance. Defaults to 16 megabytes.

Definition at line 31 of file ShmemInst.h.

Referenced by OpenDDS::DCPS::ShmemTransport::configure_i(), dump_to_str(), and load().

std::string OpenDDS::DCPS::ShmemInst::poolname_ [private]

Definition at line 53 of file ShmemInst.h.

Referenced by populate_locator(), and ShmemInst().


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Generated on 10 Aug 2018 for OpenDDS by  doxygen 1.6.1