00001
00002
00003
00004
00005
00006
00007
00008 #include "DCPS/DdsDcps_pch.h"
00009 #include "CopyChainVisitor.h"
00010 #include "TransportQueueElement.h"
00011
00012 #if !defined (__ACE_INLINE__)
00013 #include "CopyChainVisitor.inl"
00014 #endif
00015
00016 OpenDDS::DCPS::CopyChainVisitor::~CopyChainVisitor()
00017 {
00018 DBG_ENTRY_LVL("CopyChainVisitor","~CopyChainVisitor",6);
00019 }
00020
00021 int
00022 OpenDDS::DCPS::CopyChainVisitor::visit_element(TransportQueueElement* element)
00023 {
00024 DBG_ENTRY_LVL("CopyChainVisitor","visit_element",6);
00025
00026
00027
00028 TransportRetainedElement* copiedElement = 0;
00029 ACE_NEW_MALLOC_NORETURN(
00030 copiedElement,
00031 (TransportRetainedElement*)this->allocator_->malloc(),
00032 TransportRetainedElement(
00033 element->msg(),
00034 element->publication_id(),
00035 this->allocator_,
00036 this->mb_allocator_,
00037 this->db_allocator_
00038 )
00039 );
00040 if( copiedElement) {
00041
00042 this->target_.put( copiedElement);
00043
00044
00045 return 1;
00046
00047 } else {
00048 ACE_ERROR((LM_ERROR,
00049 ACE_TEXT("(%P|%t) ERROR: CopyChainVisitor::visit_element - ")
00050 ACE_TEXT("failed to allocate a new TransportRetainedElement.")
00051 ));
00052 this->status_ = -1;
00053
00054
00055 return 0;
00056 }
00057
00058
00059 }
00060