00001
00002
00003
00004
00005
00006
00007
00008 #ifndef DCPS_RTPSSAMPLEHEADER_H
00009 #define DCPS_RTPSSAMPLEHEADER_H
00010
00011 #include "Rtps_Udp_Export.h"
00012
00013 #include "ace/Basic_Types.h"
00014 #include "dds/DCPS/RTPS/RtpsCoreC.h"
00015 #include "dds/DCPS/transport/framework/TransportSendControlElement.h"
00016 #include "dds/DCPS/transport/framework/TransportSendListener.h"
00017
00018 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
00019 class ACE_Message_Block;
00020 ACE_END_VERSIONED_NAMESPACE_DECL
00021
00022 namespace OpenDDS {
00023 namespace DCPS {
00024
00025 class ReceivedDataSample;
00026 class DataSampleElement;
00027 class DisjointSequence;
00028
00029
00030 class OpenDDS_Rtps_Udp_Export RtpsSampleHeader {
00031 public:
00032
00033
00034
00035
00036
00037 static size_t max_marshaled_size() { return 4; }
00038
00039
00040
00041
00042 static bool partial(const ACE_Message_Block&) { return false; }
00043
00044
00045
00046
00047 static SequenceRange split(const ACE_Message_Block& orig, size_t size,
00048 ACE_Message_Block*& head,
00049 ACE_Message_Block*& tail);
00050
00051 RtpsSampleHeader();
00052 explicit RtpsSampleHeader(ACE_Message_Block& mb);
00053 RtpsSampleHeader& operator=(ACE_Message_Block& mn);
00054
00055 void pdu_remaining(size_t size);
00056 size_t marshaled_size();
00057 ACE_UINT32 message_length();
00058
00059 bool valid() const;
00060
00061 bool into_received_data_sample(ReceivedDataSample& rds);
00062
00063 bool more_fragments() const;
00064
00065 RTPS::Submessage submessage_;
00066
00067 private:
00068 void init(ACE_Message_Block& mb);
00069
00070 bool valid_, frag_;
00071 size_t marshaled_size_, message_length_;
00072
00073 public:
00074
00075
00076
00077
00078 static void populate_data_sample_submessages(RTPS::SubmessageSeq& subm,
00079 const DataSampleElement& dsle,
00080 bool requires_inline_qos);
00081 static void populate_data_control_submessages(RTPS::SubmessageSeq& subm,
00082 const TransportSendControlElement& tsce,
00083 bool requires_inline_qos);
00084 static void populate_inline_qos(const TransportSendListener::InlineQosData& qos_data,
00085 RTPS::ParameterList& plist);
00086 static bool control_message_supported(char message_id);
00087
00088
00089
00090
00091
00092
00093
00094 static const ACE_CDR::UShort FRAG_SIZE = 1024;
00095
00096 private:
00097 static void process_iqos(DataSampleHeader& opendds,
00098 const OpenDDS::RTPS::ParameterList& iqos);
00099 };
00100
00101 }
00102 }
00103
00104 #ifdef __ACE_INLINE__
00105 #include "RtpsSampleHeader.inl"
00106 #endif
00107
00108 #endif