#include <dtn/Header.h>


Public Member Functions | |
| PayloadHeader () | |
| Default constructor. | |
| PayloadHeader (const ByteString &pld, unsigned char flags=0) | |
| Payload constructor. | |
| PayloadHeader (const PayloadHeader &hdr) | |
| Copy constructor. | |
| virtual | ~PayloadHeader () |
| Virtual destructor. | |
| ByteString::size_type | offset () const |
| The offset in the header at which the application data begins. | |
| ByteString | payload () const |
| The application data for a Bundle. | |
Actual application data is contained in this header type. The specification states that at most one such header may be included in any bundle.
Definition at line 335 of file Header.h.
| PayloadHeader::PayloadHeader | ( | const ByteString & | pld, | |
| unsigned char | flags = 0 | |||
| ) |
Payload constructor.
| pld | The application data payload for the bundle | |
| flags | The header's BundleHeaderFlags |
flags, which means that this version of the constructor can look identical to the base-class string constructor. However, this version will treat the string as application data. If you have a complete payload header specified as a string, you should use the RegularHeader or Header string constructors, not this constructor. Definition at line 475 of file Header.cc.
References DTN::RegularHeader::kPayloadHeader, DTN::RegularHeader::length(), DTN::Header::m_data, and DTN::SDNV::val().
| ByteString::size_type DTN::PayloadHeader::offset | ( | ) | const [inline] |
The offset in the header at which the application data begins.
If the raw header is retrieved via the data() method, the value returned by this method is the first index at which the data resides. This provides an efficient mechanism for retrieving the payload, and should be preferred to the payload() method if data copying is not required.
| ByteString PayloadHeader::payload | ( | ) | const |
The application data for a Bundle.
This method makes a copy of the substring beginning at offset(). In fact, it makes two copies, one for the temporary used in the call to substr(), and the other for the returned object. You should use this method only if you actually need a copy of the payload data. Otherwise, use the data() and offset() methods.
Definition at line 495 of file Header.cc.
References DTN::Header::m_data.
1.5.4