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 ()
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)
ShmemTransportnew_impl (const TransportInst_rch &inst)

Private Attributes

std::string hostname_
std::string poolname_

Friends

class ShmemType

Detailed Description

Definition at line 19 of file ShmemInst.h.


Constructor & Destructor Documentation

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

Definition at line 21 of file ShmemInst.cpp.

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

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


Member Function Documentation

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

Reimplemented from OpenDDS::DCPS::TransportInst.

Definition at line 52 of file ShmemInst.cpp.

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

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

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

Definition at line 40 of file ShmemInst.h.

00040 { 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 36 of file ShmemInst.h.

00036 { 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 40 of file ShmemInst.cpp.

References datalink_control_size_, GET_CONFIG_VALUE, load, and pool_size_.

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

ShmemTransport * OpenDDS::DCPS::ShmemInst::new_impl ( const TransportInst_rch inst  )  [private]

Definition at line 34 of file ShmemInst.cpp.

00035 {
00036   return new ShmemTransport(inst);
00037 }

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

Definition at line 41 of file ShmemInst.h.

00041 { return poolname_; }

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 63 of file ShmemInst.cpp.

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

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


Friends And Related Function Documentation

friend class ShmemType [friend]

Definition at line 44 of file ShmemInst.h.


Member Data Documentation

size_t OpenDDS::DCPS::ShmemInst::datalink_control_size_

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 34 of file ShmemInst.h.

Referenced by dump_to_str(), load(), and OpenDDS::DCPS::ShmemSendStrategy::start_i().

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

Definition at line 48 of file ShmemInst.h.

Referenced by populate_locator().

size_t OpenDDS::DCPS::ShmemInst::pool_size_

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

Definition at line 29 of file ShmemInst.h.

Referenced by dump_to_str(), and load().

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

Definition at line 49 of file ShmemInst.h.

Referenced by populate_locator(), and ShmemInst().


The documentation for this class was generated from the following files:
Generated on Fri Feb 12 20:06:37 2016 for OpenDDS by  doxygen 1.4.7