TransportControlElement.h

Go to the documentation of this file.
00001 /*
00002  *
00003  *
00004  * Distributed under the OpenDDS License.
00005  * See: http://www.opendds.org/license.html
00006  */
00007 
00008 #ifndef OPENDDS_DCPS_TRANSPORTGDCONTROLELEMENT_H
00009 #define OPENDDS_DCPS_TRANSPORTGDCONTROLELEMENT_H
00010 
00011 #include "dds/DCPS/dcps_export.h"
00012 #include "dds/DCPS/GuidUtils.h"
00013 #include "TransportDefs.h"
00014 #include "TransportQueueElement.h"
00015 
00016 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
00017 class ACE_Message_Block;
00018 ACE_END_VERSIONED_NAMESPACE_DECL
00019 
00020 namespace OpenDDS {
00021 namespace DCPS {
00022 
00023 class OpenDDS_Dcps_Export TransportControlElement
00024   : public TransportQueueElement {
00025 public:
00026 
00027   /**
00028    * msg_block - chain of ACE_Message_Blocks containing the control
00029    *             sample held by this queue element, if any.
00030    * pub_id    - publication Id value of the originating publication, if
00031    *             any.
00032    * owner     - indicates that this element has been obtained from the
00033    *             heap and can be discarded to it.  If an object of this
00034    *             type is created on the stack, this *must* be set to
00035    *             false.
00036    */
00037   TransportControlElement(const ACE_Message_Block* msg_block,
00038                           const RepoId& pub_id = GUID_UNKNOWN,
00039                           bool owner = true);
00040 
00041   virtual ~TransportControlElement();
00042 
00043   virtual bool owned_by_transport();
00044 
00045 protected:
00046 
00047   virtual bool requires_exclusive_packet() const;
00048 
00049   virtual RepoId publication_id() const;
00050 
00051   virtual const ACE_Message_Block* msg() const;
00052 
00053   virtual const ACE_Message_Block* msg_payload() const;
00054 
00055   virtual void release_element(bool dropped_by_transport);
00056 
00057   virtual void data_delivered();
00058 
00059 private:
00060 
00061   /// The control message.
00062   ACE_Message_Block* msg_;
00063 
00064   /// Ownership flag.
00065   bool owner_;
00066 };
00067 
00068 } // namespace DCPS
00069 } // namespace OpenDDS
00070 
00071 #if defined (__ACE_INLINE__)
00072 #include "TransportControlElement.inl"
00073 #endif /* __ACE_INLINE__ */
00074 
00075 #endif  /* OPENDDS_DCPS_TRANSPORTGDCONTROLELEMENT_H */

Generated on Fri Feb 12 20:05:28 2016 for OpenDDS by  doxygen 1.4.7