OpenDDS::DCPS::GroupRakeData Class Reference

#include <GroupRakeData.h>

List of all members.

Public Member Functions

 GroupRakeData ()
bool insert_sample (ReceivedDataElement *sample, SubscriptionInstance *i, size_t index_in_instance)
void get_datareaders (DDS::DataReaderSeq &readers)
bool copy_to_user ()
void reset ()
RakeData get_data ()

Private Member Functions

 GroupRakeData (const GroupRakeData &)
GroupRakeDataoperator= (const GroupRakeData &)
typedef OPENDDS_MULTISET_CMP (RakeData, SortedSetCmp) SortedSet

Private Attributes

SortedSet sorted_
SortedSet::iterator current_sample_

Classes

class  SortedSetCmp


Detailed Description

Rake is an abbreviation for "read or take". This class manages the results from a read() or take() operation, which are the received_data and the info_seq sequences passed in by-reference from the user.

Definition at line 31 of file GroupRakeData.h.


Constructor & Destructor Documentation

OpenDDS::DCPS::GroupRakeData::GroupRakeData (  ) 

Definition at line 17 of file GroupRakeData.cpp.

00018 {
00019 }

OpenDDS::DCPS::GroupRakeData::GroupRakeData ( const GroupRakeData  )  [private]


Member Function Documentation

bool OpenDDS::DCPS::GroupRakeData::copy_to_user (  ) 

RakeData OpenDDS::DCPS::GroupRakeData::get_data (  ) 

Definition at line 62 of file GroupRakeData.cpp.

References current_sample_.

00063 {
00064   RakeData data = *this->current_sample_;
00065   ++this->current_sample_;
00066   return data;
00067 }

void OpenDDS::DCPS::GroupRakeData::get_datareaders ( DDS::DataReaderSeq readers  ) 

Definition at line 39 of file GroupRakeData.cpp.

References sorted_.

Referenced by OpenDDS::DCPS::SubscriberImpl::get_datareaders().

00040 {
00041   ACE_UNUSED_ARG(readers);
00042 #ifndef OPENDDS_NO_OBJECT_MODEL_PROFILE
00043   readers.length(static_cast<CORBA::ULong>(this->sorted_.size()));
00044   int i = 0;
00045   SortedSet::iterator itEnd = this->sorted_.end();
00046   for (SortedSet::iterator it = this->sorted_.begin(); it != itEnd; ++it) {
00047     readers[i++] =
00048       DDS::DataReader::_duplicate(it->si_->instance_state_.data_reader());
00049   }
00050 #endif
00051 }

bool OpenDDS::DCPS::GroupRakeData::insert_sample ( ReceivedDataElement sample,
SubscriptionInstance i,
size_t  index_in_instance 
)

Returns false if the sample will definitely not be part of the resulting dataset, however if this returns true it still may be excluded (due to sorting and max_samples).

Definition at line 22 of file GroupRakeData.cpp.

References current_sample_, OpenDDS::DCPS::ReceivedDataElement::registered_data_, and sorted_.

Referenced by OpenDDS::DCPS::DataReaderImpl::get_ordered_data().

00025 {
00026   // Ignore DISPOSE and UNREGISTER messages in case they are sent
00027   // in the group coherent changes, but it shouldn't.
00028   if (!sample->registered_data_) return false;
00029 
00030   RakeData rd = {sample, instance, index_in_instance};
00031   this->sorted_.insert(rd);
00032 
00033   this->current_sample_ = this->sorted_.begin();
00034   return true;
00035 }

typedef OpenDDS::DCPS::GroupRakeData::OPENDDS_MULTISET_CMP ( RakeData  ,
SortedSetCmp   
) [private]

GroupRakeData& OpenDDS::DCPS::GroupRakeData::operator= ( const GroupRakeData  )  [private]

void OpenDDS::DCPS::GroupRakeData::reset (  ) 

Definition at line 55 of file GroupRakeData.cpp.

References sorted_.

Referenced by OpenDDS::DCPS::DataReaderImpl::end_access().

00056 {
00057   this->sorted_.clear();
00058 }


Member Data Documentation

SortedSet::iterator OpenDDS::DCPS::GroupRakeData::current_sample_ [private]

Definition at line 78 of file GroupRakeData.h.

Referenced by get_data(), and insert_sample().

SortedSet OpenDDS::DCPS::GroupRakeData::sorted_ [private]

Definition at line 76 of file GroupRakeData.h.

Referenced by get_datareaders(), insert_sample(), and reset().


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