TransportCustomizedElement.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_TRANSPORTCUSTOMIZEDELEMENT_H
00009 #define OPENDDS_DCPS_TRANSPORTCUSTOMIZEDELEMENT_H
00010 
00011 #include "dds/DCPS/dcps_export.h"
00012 #include "TransportQueueElement.h"
00013 
00014 namespace OpenDDS {
00015 namespace DCPS {
00016 
00017 class TransportSendElement;
00018 
00019 class OpenDDS_Dcps_Export TransportCustomizedElement
00020   : public TransportQueueElement {
00021 
00022 public:
00023   static TransportCustomizedElement* alloc(TransportQueueElement* orig,
00024                                            bool fragment = false,
00025                                            ACE_Allocator* allocator = 0);
00026 
00027   virtual RepoId publication_id() const;
00028   void set_publication_id(const RepoId& id);
00029 
00030   virtual const ACE_Message_Block* msg() const;
00031   void set_msg(ACE_Message_Block* m);
00032 
00033   virtual const ACE_Message_Block* msg_payload() const;
00034 
00035   virtual SequenceNumber sequence() const;
00036 
00037   virtual bool owned_by_transport() { return false; }
00038 
00039   virtual bool is_fragment() const { return fragment_; }
00040 
00041   const TransportSendElement* original_send_element() const;
00042 
00043 protected:
00044   virtual void release_element(bool dropped_by_transport);
00045 
00046   virtual bool requires_exclusive_packet() const { return exclusive_; }
00047   void set_requires_exclusive() { exclusive_ = true; }
00048 
00049   void set_fragment() { fragment_ = true; }
00050 
00051   TransportCustomizedElement(TransportQueueElement* orig,
00052                              bool fragment,
00053                              ACE_Allocator* allocator);
00054   virtual ~TransportCustomizedElement();
00055 
00056   ACE_Allocator* allocator() { return allocator_; }
00057 
00058 private:
00059   RepoId subscription_id() const;
00060 
00061   TransportQueueElement* orig_;
00062   ACE_Message_Block* msg_;
00063   ACE_Allocator* allocator_;
00064   RepoId publication_id_;
00065   bool fragment_, exclusive_;
00066 };
00067 
00068 } // namespace DCPS
00069 } // namespace OpenDDS
00070 
00071 #if defined (__ACE_INLINE__)
00072 #include "TransportCustomizedElement.inl"
00073 #endif /* __ACE_INLINE__ */
00074 
00075 #endif  /* OPENDDS_DCPS_TRANSPORTCUSTOMIZEDELEMENT_H */

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