#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) throw (CORBA::SystemException) |
virtual CORBA::ULong | max_left () throw (CORBA::SystemException, CosTrading::UnknownMaxLeft) |
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 37 of file Offer_Iterators.cpp.
00038 : TAO_Offer_Iterator (pfilter) 00039 { 00040 } |
|
Definition at line 42 of file Offer_Iterators.cpp.
00043 { 00044 } |
|
|
|
Add an offer the iterator should iterate over.
Implements TAO_Offer_Iterator. Definition at line 47 of file Offer_Iterators.cpp. References CosTrading::OfferId, and CORBA::string_free().
00049 { 00050 this->offers_.enqueue_tail ((CosTrading::Offer*) offer); 00051 CORBA::string_free (offer_id); 00052 } |
|
Return the number of items left in the iterator.
Implements TAO_Offer_Iterator. Definition at line 55 of file Offer_Iterators.cpp.
00058 { 00059 return static_cast<CORBA::ULong> (this->offers_.size ()); 00060 } |
|
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 63 of file Offer_Iterators.cpp. References CosTrading::OfferSeq.
00067 { 00068 offers = new CosTrading::OfferSeq; 00069 00070 CORBA::ULong sequence_size = static_cast<CORBA::ULong> (this->offers_.size ()); 00071 CORBA::ULong offers_in_sequence = (n < sequence_size) ? n : sequence_size; 00072 offers->length (offers_in_sequence); 00073 00074 // populate the sequence. 00075 for (CORBA::ULong i = 0; i < offers_in_sequence; i++) 00076 { 00077 00078 CosTrading::Offer *source = 0; 00079 this->offers_.dequeue_head (source); 00080 this->pfilter_.filter_offer (source, offers[i]); 00081 } 00082 00083 return offers_in_sequence != 0; 00084 } |
|
|
|
Structure that stores pointers to offers to iterate over. Definition at line 156 of file Offer_Iterators.h. |