Line data Source code
1 : /* 2 : * 3 : * 4 : * Distributed under the OpenDDS License. 5 : * See: http://www.opendds.org/license.html 6 : */ 7 : 8 : OPENDDS_BEGIN_VERSIONED_NAMESPACE_DECL 9 : 10 : namespace OpenDDS { 11 : namespace DCPS { 12 : 13 : ACE_INLINE 14 : RtpsSampleHeader::RtpsSampleHeader() 15 : : valid_(false) 16 : , frag_(false) 17 : , data_(false) 18 : , serialized_size_(0) 19 : , message_length_(0) 20 : { 21 : } 22 : 23 : ACE_INLINE 24 4 : RtpsSampleHeader::RtpsSampleHeader(ACE_Message_Block& mb) 25 4 : : valid_(false) 26 4 : , frag_(false) 27 4 : , data_(false) 28 4 : , serialized_size_(0) 29 4 : , message_length_(0) 30 : { 31 4 : init(mb); 32 4 : } 33 : 34 : ACE_INLINE RtpsSampleHeader& 35 4 : RtpsSampleHeader::operator=(ACE_Message_Block& mb) 36 : { 37 4 : valid_ = false; 38 4 : frag_ = false; 39 4 : data_ = false; 40 : // message_length_ should not be reset here 41 : // serialized_size_ doesn't need to be reset, init() will set it (if valid_) 42 4 : init(mb); 43 4 : return *this; 44 : } 45 : 46 : ACE_INLINE bool 47 8 : RtpsSampleHeader::valid() const 48 : { 49 8 : return valid_; 50 : } 51 : 52 : ACE_INLINE void 53 : RtpsSampleHeader::pdu_remaining(size_t size) 54 : { 55 : message_length_ = size; 56 : } 57 : 58 : ACE_INLINE size_t 59 : RtpsSampleHeader::get_serialized_size() 60 : { 61 : return serialized_size_; 62 : } 63 : 64 : ACE_INLINE ACE_UINT32 65 0 : RtpsSampleHeader::message_length() 66 : { 67 0 : return static_cast<ACE_UINT32>(message_length_); 68 : } 69 : 70 : ACE_INLINE bool 71 : RtpsSampleHeader::more_fragments() const 72 : { 73 : return frag_; 74 : } 75 : 76 : ACE_INLINE bool 77 : RtpsSampleHeader::control_message_supported(char message_id) 78 : { 79 : switch (message_id) { 80 : case INSTANCE_REGISTRATION: 81 : case UNREGISTER_INSTANCE: 82 : case DISPOSE_INSTANCE: 83 : case DISPOSE_UNREGISTER_INSTANCE: 84 : return true; 85 : default: 86 : return false; 87 : } 88 : } 89 : 90 : } 91 : } 92 : 93 : OPENDDS_END_VERSIONED_NAMESPACE_DECL