00001
00002
00003
00004
00005
00006
00007
00008 #ifndef OPENDDS_DCPS_TRANSPORTSENDCONTROLELEMENT_H
00009 #define OPENDDS_DCPS_TRANSPORTSENDCONTROLELEMENT_H
00010
00011 #include "dds/DCPS/dcps_export.h"
00012 #include "dds/DCPS/GuidUtils.h"
00013 #include "dds/DCPS/DataSampleHeader.h"
00014 #include "TransportDefs.h"
00015 #include "TransportQueueElement.h"
00016
00017 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
00018 class ACE_Message_Block;
00019 ACE_END_VERSIONED_NAMESPACE_DECL
00020
00021 namespace OpenDDS {
00022 namespace DCPS {
00023
00024 class TransportSendListener;
00025
00026 class TransportSendControlElement;
00027
00028 typedef Cached_Allocator_With_Overflow<TransportSendControlElement, ACE_SYNCH_NULL_MUTEX>
00029 TransportSendControlElementAllocator;
00030
00031 class OpenDDS_Dcps_Export TransportSendControlElement : public TransportQueueElement {
00032 public:
00033
00034 TransportSendControlElement(int initial_count,
00035 const RepoId& publisher_id,
00036 TransportSendListener* listener,
00037 const DataSampleHeader& header,
00038 ACE_Message_Block* msg_block,
00039 TransportSendControlElementAllocator* allocator = 0);
00040
00041 TransportSendControlElement(int initial_count,
00042 const DataSampleElement* dcps_elem,
00043 TransportSendControlElementAllocator* allocator);
00044
00045 static TransportSendControlElement* alloc(int initial_count,
00046 const RepoId& publisher_id,
00047 TransportSendListener* listener,
00048 const DataSampleHeader& header,
00049 ACE_Message_Block* message,
00050 TransportSendControlElementAllocator* allocator);
00051
00052 static TransportSendControlElement* alloc(int initial_count,
00053 const DataSampleElement* dcps_elem,
00054 TransportSendControlElementAllocator* allocator);
00055
00056 virtual ~TransportSendControlElement();
00057
00058
00059 virtual bool requires_exclusive_packet() const;
00060
00061
00062 virtual RepoId publication_id() const;
00063
00064
00065 virtual const ACE_Message_Block* msg() const;
00066
00067 const DataSampleHeader& header() const { return this->header_; }
00068
00069
00070
00071
00072 const TransportSendListener* listener() const { return listener_; }
00073
00074 virtual const ACE_Message_Block* msg_payload() const;
00075
00076 virtual SequenceNumber sequence() const;
00077
00078
00079 virtual bool is_control(RepoId pub_id) const;
00080 virtual bool owned_by_transport ();
00081
00082 protected:
00083
00084 virtual void release_element(bool dropped_by_transport);
00085
00086 private:
00087
00088
00089 RepoId publisher_id_;
00090
00091
00092 TransportSendListener* listener_;
00093
00094
00095 DataSampleHeader header_;
00096
00097
00098 ACE_Message_Block* msg_;
00099
00100
00101 const DataSampleElement* const dcps_elem_;
00102
00103
00104
00105 TransportSendControlElementAllocator* allocator_;
00106 };
00107
00108 }
00109 }
00110
00111 #if defined (__ACE_INLINE__)
00112 #include "TransportSendControlElement.inl"
00113 #endif
00114
00115 #endif