14 #if !defined (__ACE_INLINE__) 31 ,
head_(unsent_head_block)
32 , header_block_(header_block)
36 , replaced_element_mb_allocator_(mb_allocator)
37 , replaced_element_db_allocator_(db_allocator)
38 , remove_all_(remove_all)
40 DBG_ENTRY_LVL(
"PacketRemoveVisitor",
"PacketRemoveVisitor", 6);
45 DBG_ENTRY_LVL(
"PacketRemoveVisitor",
"~PacketRemoveVisitor", 6);
54 "Obtain the element_blocks using element->msg()\n"));
57 "The element is [%0x]\n",
71 "element_blocks == [%0x]\n", element_blocks));
82 "this->current_block_ == 0. Visiting first element.\n"));
93 "No blocks to iterate through, ending visitation.\n"));
108 "this->current_block_ != 0. Visiting element other than " 109 "the first element.\n"));
121 "Set previous_block_ to the current_block_ [%0x]\n",
131 "Moved previous_block_ to its cont() block [%0x]\n",
142 "Set current_block_ to the previous_block_->cont() [%0x]\n",
147 "Does the current element match the sample to be replaced?\n"));
153 "YES - The element matches the sample\n"));
180 "Set original_blocks to this->current_block_ [%0x]\n",
191 "Set remaining_chain to this->current_block_->cont() [%0x]\n",
195 "Set original_blocks->cont(0)\n"));
199 original_blocks->
cont(0);
201 unsigned int num_elem_blocks_sent = 0;
204 "Set num_elem_blocks_sent to 0\n"));
211 "Set original_blocks_tail to original_blocks [%0x]\n",
212 original_blocks_tail));
219 "Set contrib_block to element_blocks [%0x]\n",
225 while (contrib_block != 0) {
226 if (contrib_block->
base() == original_blocks->
base()) {
228 "contrib_block->base() == original_blocks->base()\n"));
236 contrib_block = contrib_block->
cont();
238 "Move contrib_block to contrib_block->cont() [%0x]\n",
240 ++num_elem_blocks_sent;
242 "num_elem_blocks_sent incremented to %d\n",
243 num_elem_blocks_sent));
249 if (contrib_block == 0) {
251 "(%P|%t) ERROR: Element queue and unsent message block " 252 "chain is out-of-sync. source_block == 0.\n"));
271 while (contrib_block->
cont() != 0) {
280 if (remaining_chain == 0) {
282 "(%P|%t) ERROR: Element queue and unsent message block " 283 "chain is out-of-synch. remaining_chain == 0.\n"));
291 "Extracted additional_block from remaining_chain [%0x]\n",
294 remaining_chain = remaining_chain->
cont();
296 "Move remaining_chain to remaining_chain->cont() [%0x]\n",
299 additional_block->
cont(0);
301 "Set additional_block->cont(0)\n"));
304 original_blocks_tail->
cont(additional_block);
306 "original_blocks_tail->cont(additional_block)\n"));
308 original_blocks_tail = additional_block;
310 "Set original_blocks_tail to additional_block [%0x]\n",
311 original_blocks_tail));
314 contrib_block = contrib_block->
cont();
316 "Move contrib_block to contrib_block->cont() [%0x]\n",
361 "Create the new TransportReplacedElement using the " 372 "The new TransportReplacedElement is [%0x]\n",
381 "Set replacement_element_blocks to the replacement element's " 383 replacement_element_blocks));
386 for (
unsigned int i = 0; i < num_elem_blocks_sent; i++) {
387 replacement_element_blocks = replacement_element_blocks->
cont();
390 "Moved replacement_element_blocks to its cont() block " 392 replacement_element_blocks));
400 "Set replacement_blocks to duplicate of " 401 "replacement_element_blocks [%0x]\n",
402 replacement_blocks));
408 size_t rd_offset = original_blocks->
rd_ptr() - original_blocks->
base();
412 "Call replacement_blocks->rd_ptr(rd_offset) with " 413 "rd_offset == [%d]\n",
415 replacement_blocks->
rd_ptr(rd_offset);
422 "Set replacement_blocks_tail to replacement_blocks " 424 replacement_blocks_tail));
426 while (replacement_blocks_tail->
cont() != 0) {
427 replacement_blocks_tail = replacement_blocks_tail->
cont();
429 "Moved replacement_blocks_tail to its cont() block " 431 replacement_blocks_tail));
436 replacement_blocks_tail->
cont(remaining_chain);
439 "Stitched replacement_blocks_tail to remaining_chain.\n"));
443 this->
head_ = replacement_blocks;
445 "Replacing blocks at head of unsent packet chain.\n"));
451 "Replacing blocks not at head of unsent packet chain.\n"));
455 "Release the original_blocks.\n"));
459 deleter(original_blocks);
462 "Tell original element that data_dropped().\n"));
475 "Return 0 to halt visitation.\n"));
484 "Return 1 to continue visitation.\n"));
virtual int visit_element_ref(TransportQueueElement *&element)
ACE_Message_Block *& head_
The head block of the chain of unsent blocks in the packet.
DataBlockAllocator & replaced_element_db_allocator_
Cached allocator for DataSampleHeader data block.
bool data_dropped(bool dropped_by_transport=false)
ACE_Message_Block & head_
ACE_Message_Block * header_block_
const TransportQueueElement::MatchCriteria & match_
The sample that needs to be removed.
char * rd_ptr(void) const
virtual bool is_retained_replaced() const
virtual ~PacketRemoveVisitor()
PacketRemoveVisitor(const TransportQueueElement::MatchCriteria &match, ACE_Message_Block *&unsent_head_block, ACE_Message_Block *header_block, MessageBlockAllocator &mb_allocator, DataBlockAllocator &db_allocator, bool remove_all=false)
virtual bool matches(const TransportQueueElement &candidate) const =0
A fixed-size allocator that caches items for quicker access but if the pool is exhausted it will use ...
ACE_Message_Block * cont(void) const
virtual ACE_Message_Block * duplicate(void) const
ACE_Message_Block * current_block_
MessageBlockAllocator & replaced_element_mb_allocator_
Cached allocator for DataSampleHeader message block.
ACE_Message_Block * previous_block_
#define DBG_ENTRY_LVL(CNAME, MNAME, DBG_LVL)
virtual bool unique() const =0
#define OPENDDS_END_VERSIONED_NAMESPACE_DECL
The Internal API and Implementation of OpenDDS.
RemoveResult status_
Holds the status of our visit.
Base wrapper class around a data/control sample to be sent.
virtual const ACE_Message_Block * msg() const =0
The marshalled sample (sample header + sample data)