TAO_Query_Only_Offer_Iterator Class Reference

#include <Offer_Iterators.h>

Inheritance diagram for TAO_Query_Only_Offer_Iterator:

Inheritance graph
[legend]
Collaboration diagram for TAO_Query_Only_Offer_Iterator:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 TAO_Query_Only_Offer_Iterator (const TAO_Property_Filter &pfilter)
virtual ~TAO_Query_Only_Offer_Iterator (void)
virtual CORBA::Boolean next_n (CORBA::ULong n, CosTrading::OfferSeq_out offers)
virtual CORBA::ULong max_left (void)
 Return the number of items left in the iterator.

void add_offer (CosTrading::OfferId offer_id, const CosTrading::Offer *offer)
 Add an offer the iterator should iterate over.


Private Member Functions

 TAO_Query_Only_Offer_Iterator (const TAO_Query_Only_Offer_Iterator &)
TAO_Query_Only_Offer_Iteratoroperator= (const TAO_Query_Only_Offer_Iterator &)

Private Attributes

ACE_Unbounded_Queue< CosTrading::Offer * > offers_

Constructor & Destructor Documentation

TAO_Query_Only_Offer_Iterator::TAO_Query_Only_Offer_Iterator const TAO_Property_Filter pfilter  ) 
 

Definition at line 33 of file Offer_Iterators.cpp.

00034   : TAO_Offer_Iterator (pfilter)
00035 {
00036 }

TAO_Query_Only_Offer_Iterator::~TAO_Query_Only_Offer_Iterator void   )  [virtual]
 

Definition at line 38 of file Offer_Iterators.cpp.

00039 {
00040 }

TAO_Query_Only_Offer_Iterator::TAO_Query_Only_Offer_Iterator const TAO_Query_Only_Offer_Iterator  )  [private]
 


Member Function Documentation

void TAO_Query_Only_Offer_Iterator::add_offer CosTrading::OfferId  offer_id,
const CosTrading::Offer offer
[virtual]
 

Add an offer the iterator should iterate over.

Implements TAO_Offer_Iterator.

Definition at line 43 of file Offer_Iterators.cpp.

References CosTrading::OfferId, and CORBA::string_free().

00045 {
00046   this->offers_.enqueue_tail ((CosTrading::Offer*) offer);
00047   CORBA::string_free (offer_id);
00048 }

CORBA::ULong TAO_Query_Only_Offer_Iterator::max_left void   )  [virtual]
 

Return the number of items left in the iterator.

Implements TAO_Offer_Iterator.

Definition at line 51 of file Offer_Iterators.cpp.

00052 {
00053   return static_cast<CORBA::ULong> (this->offers_.size ());
00054 }

CORBA::Boolean TAO_Query_Only_Offer_Iterator::next_n CORBA::ULong  n,
CosTrading::OfferSeq_out  offers
[virtual]
 

Deposit at maximum n offers into the return sequence and return 1, or return 0 if the iterator is done and no offers are returned.

Implements TAO_Offer_Iterator.

Definition at line 57 of file Offer_Iterators.cpp.

References TAO_Property_Filter::filter_offer(), and CosTrading::OfferSeq.

00059 {
00060   offers = new CosTrading::OfferSeq;
00061 
00062   CORBA::ULong sequence_size = static_cast<CORBA::ULong> (this->offers_.size ());
00063   CORBA::ULong offers_in_sequence = (n < sequence_size) ? n : sequence_size;
00064   offers->length (offers_in_sequence);
00065 
00066   // populate the sequence.
00067   for (CORBA::ULong i = 0; i < offers_in_sequence; i++)
00068     {
00069 
00070       CosTrading::Offer *source = 0;
00071       this->offers_.dequeue_head (source);
00072       this->pfilter_.filter_offer (source, offers[i]);
00073     }
00074 
00075   return offers_in_sequence != 0;
00076 }

TAO_Query_Only_Offer_Iterator& TAO_Query_Only_Offer_Iterator::operator= const TAO_Query_Only_Offer_Iterator  )  [private]
 


Member Data Documentation

ACE_Unbounded_Queue<CosTrading::Offer *> TAO_Query_Only_Offer_Iterator::offers_ [private]
 

Structure that stores pointers to offers to iterate over.

Definition at line 149 of file Offer_Iterators.h.


The documentation for this class was generated from the following files:
Generated on Sun Jan 27 16:19:56 2008 for TAO_CosTrader by doxygen 1.3.6