OpenDDS::FaceTSS::Entities::DDSTypedAdapter< Msg > Class Template Reference

#include <FaceTSS.h>

Inheritance diagram for OpenDDS::FaceTSS::Entities::DDSTypedAdapter< Msg >:

Inheritance graph
[legend]
Collaboration diagram for OpenDDS::FaceTSS::Entities::DDSTypedAdapter< Msg >:

Collaboration graph
[legend]
List of all members.

Public Types

typedef DCPS::DDSTraits< Msg
>::DataReaderType 
DataReader

Public Member Functions

 DDSTypedAdapter (FaceReceiver &rcvr)
 ~DDSTypedAdapter ()
virtual FACE::RETURN_CODE_TYPE messages_waiting (FACE::WAITING_RANGE_TYPE &num_waiting)

Detailed Description

template<typename Msg>
class OpenDDS::FaceTSS::Entities::DDSTypedAdapter< Msg >

Definition at line 56 of file FaceTSS.h.


Member Typedef Documentation

template<typename Msg>
typedef DCPS::DDSTraits<Msg>::DataReaderType OpenDDS::FaceTSS::Entities::DDSTypedAdapter< Msg >::DataReader

Definition at line 61 of file FaceTSS.h.


Constructor & Destructor Documentation

template<typename Msg>
OpenDDS::FaceTSS::Entities::DDSTypedAdapter< Msg >::DDSTypedAdapter ( FaceReceiver rcvr  ) 

Definition at line 94 of file FaceTSS.h.

00095   : FaceReceiver()
00096 {
00097   dr = rcvr.dr;
00098   last_msg_header = rcvr.last_msg_header;
00099   last_msg_tid = rcvr.last_msg_tid;
00100   sum_recvd_msgs_latency = rcvr.sum_recvd_msgs_latency;
00101   total_msgs_recvd = rcvr.total_msgs_recvd;
00102 }

template<typename Msg>
OpenDDS::FaceTSS::Entities::DDSTypedAdapter< Msg >::~DDSTypedAdapter (  ) 

Definition at line 105 of file FaceTSS.h.

00106 {
00107 }


Member Function Documentation

template<typename Msg>
FACE::RETURN_CODE_TYPE OpenDDS::FaceTSS::Entities::DDSTypedAdapter< Msg >::messages_waiting ( FACE::WAITING_RANGE_TYPE &  num_waiting  )  [virtual]

Reimplemented from OpenDDS::FaceTSS::Entities::FaceReceiver.

Definition at line 110 of file FaceTSS.h.

References DDS::ALIVE_INSTANCE_STATE, DDS::ANY_SAMPLE_STATE, DDS::ANY_VIEW_STATE, OpenDDS::FaceTSS::Entities::FaceReceiver::dr, DDS::LENGTH_UNLIMITED, DDS::RETCODE_NO_DATA, and DDS::RETCODE_OK.

00111 {
00112   const typename DataReader::_var_type typedReader =
00113     DataReader::_narrow(dr);
00114   if (!typedReader) {
00115     return FACE::INVALID_PARAM;
00116   }
00117   const DDS::ReadCondition_var rc =
00118       typedReader->create_readcondition(DDS::ANY_SAMPLE_STATE,
00119                                 DDS::ANY_VIEW_STATE,
00120                                 DDS::ALIVE_INSTANCE_STATE);
00121 
00122   DDS::ReturnCode_t ret;
00123   typename DCPS::DDSTraits<Msg>::MessageSequenceType seq;
00124   DDS::SampleInfoSeq sinfo;
00125   FACE::WAITING_RANGE_TYPE valid_waiting = 0;
00126   ret = typedReader->read_w_condition(seq, sinfo, DDS::LENGTH_UNLIMITED, rc);
00127   if (ret == DDS::RETCODE_OK) {
00128     for (CORBA::ULong i = 0; i < seq.length(); ++i) {
00129       if (sinfo[i].valid_data) {
00130         ++valid_waiting;
00131       }
00132     }
00133     num_waiting = valid_waiting;
00134     return FACE::RC_NO_ERROR;
00135   } else if (ret == DDS::RETCODE_NO_DATA) {
00136     num_waiting = 0;
00137     return FACE::RC_NO_ERROR;
00138   }
00139   return FACE::NOT_AVAILABLE;
00140 }


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