#include <Offer_Iterators.h>
Inheritance diagram for TAO_Query_Only_Offer_Iterator:
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_Iterator & | operator= (const TAO_Query_Only_Offer_Iterator &) |
Private Attributes | |
ACE_Unbounded_Queue< CosTrading::Offer * > | offers_ |
|
Definition at line 33 of file Offer_Iterators.cpp.
00034 : TAO_Offer_Iterator (pfilter) 00035 { 00036 } |
|
Definition at line 38 of file Offer_Iterators.cpp.
00039 { 00040 } |
|
|
|
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 } |
|
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 } |
|
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 } |
|
|
|
Structure that stores pointers to offers to iterate over. Definition at line 149 of file Offer_Iterators.h. |