#include <ndn-cxx/lp/packet.hpp>
|  | 
|  | Packet () | 
|  | 
|  | Packet (const Block &wire) | 
|  | 
| template<typename FIELD > | 
| Packet & | add (const typename FIELD::ValueType &value) | 
|  | add a FIELD with value  More... 
 | 
|  | 
| template<typename FIELD > | 
| Packet & | clear () | 
|  | remove all occurrences of FIELD  More... 
 | 
|  | 
| template<typename FIELD > | 
| size_t | count () const | 
|  | 
| bool | empty () const | 
|  | 
| template<typename FIELD > | 
| FIELD::ValueType | get (size_t index=0) const | 
|  | 
| template<typename FIELD > | 
| bool | has () const | 
|  | 
| template<typename FIELD > | 
| std::vector< typename FIELD::ValueType > | list () const | 
|  | 
| template<typename FIELD > | 
| Packet & | remove (size_t index=0) | 
|  | remove the index-th occurrence of FIELD  More... 
 | 
|  | 
| template<typename FIELD > | 
| Packet & | set (const typename FIELD::ValueType &value) | 
|  | remove all occurrences of FIELD, and add a FIELD with value  More... 
 | 
|  | 
| void | wireDecode (const Block &wire) | 
|  | decode packet from wire format  More... 
 | 
|  | 
| Block | wireEncode () const | 
|  | encode packet into wire format  More... 
 | 
|  | 
Definition at line 30 of file packet.hpp.
 
◆ Packet() [1/2]
      
        
          | ndn::lp::Packet::Packet | ( |  | ) |  | 
      
 
 
◆ Packet() [2/2]
  
  | 
        
          | ndn::lp::Packet::Packet | ( | const Block & | wire | ) |  |  | explicit | 
 
 
◆ add()
template<typename FIELD > 
  
  | 
        
          | Packet& ndn::lp::Packet::add | ( | const typename FIELD::ValueType & | value | ) |  |  | inline | 
 
add a FIELD with value 
- Exceptions
- 
  
    | std::invalid_argument | if field already exists and is not repeatable |  
 
Definition at line 148 of file packet.hpp.
 
 
◆ clear()
template<typename FIELD > 
  
  | 
        
          | Packet& ndn::lp::Packet::clear | ( |  | ) |  |  | inline | 
 
remove all occurrences of FIELD 
Definition at line 194 of file packet.hpp.
 
 
◆ count()
template<typename FIELD > 
  
  | 
        
          | size_t ndn::lp::Packet::count | ( |  | ) | const |  | inline | 
 
- Returns
- number of occurrences of FIELD 
Definition at line 84 of file packet.hpp.
 
 
◆ empty()
  
  | 
        
          | bool ndn::lp::Packet::empty | ( |  | ) | const |  | inline | 
 
- Return values
- 
  
    | true | packet has no field |  | false | packet has one or more fields |  
 
Definition at line 62 of file packet.hpp.
 
 
◆ get()
template<typename FIELD > 
  
  | 
        
          | FIELD::ValueType ndn::lp::Packet::get | ( | size_t | index = 0 | ) | const |  | inline | 
 
- Returns
- value of index-th occurrence of FIELD 
- Exceptions
- 
  
  
Definition at line 96 of file packet.hpp.
 
 
◆ has()
template<typename FIELD > 
  
  | 
        
          | bool ndn::lp::Packet::has | ( |  | ) | const |  | inline | 
 
- Returns
- true if FIELD occurs one or more times
This is equivalent to count() > 0 
Definition at line 74 of file packet.hpp.
 
 
◆ list()
template<typename FIELD > 
  
  | 
        
          | std::vector<typename FIELD::ValueType> ndn::lp::Packet::list | ( |  | ) | const |  | inline | 
 
- Returns
- values of all occurrences of FIELD 
Definition at line 116 of file packet.hpp.
 
 
◆ remove()
template<typename FIELD > 
  
  | 
        
          | Packet& ndn::lp::Packet::remove | ( | size_t | index = 0 | ) |  |  | inline | 
 
remove the index-th occurrence of FIELD 
- Exceptions
- 
  
  
Definition at line 173 of file packet.hpp.
 
 
◆ set()
template<typename FIELD > 
  
  | 
        
          | Packet& ndn::lp::Packet::set | ( | const typename FIELD::ValueType & | value | ) |  |  | inline | 
 
remove all occurrences of FIELD, and add a FIELD with value 
This equivalent to clear() followed by add(value) 
Definition at line 136 of file packet.hpp.
 
 
◆ wireDecode()
      
        
          | void ndn::lp::Packet::wireDecode | ( | const Block & | wire | ) |  | 
      
 
decode packet from wire format 
- Exceptions
- 
  
  
Definition at line 133 of file packet.cpp.
 
 
◆ wireEncode()
      
        
          | Block ndn::lp::Packet::wireEncode | ( |  | ) | const | 
      
 
encode packet into wire format 
Definition at line 119 of file packet.cpp.