nlsr::NameLsa Class Reference

Data abstraction for NameLsa NameLsa := NAME-LSA-TYPE TLV-LENGTH Lsa Name+. More...

#include <name-lsa.hpp>

+ Inheritance diagram for nlsr::NameLsa:
+ Collaboration diagram for nlsr::NameLsa:

Public Types

enum class  Type {
  ADJACENCY ,
  COORDINATE ,
  NAME ,
  BASE
}
 

Public Member Functions

 NameLsa ()=default
 
 NameLsa (const ndn::Block &block)
 
 NameLsa (const ndn::Name &originRouter, uint64_t seqNo, const ndn::time::system_clock::time_point &timepoint, const NamePrefixList &npl)
 
void addName (const ndn::Name &name)
 
const ndn::time::system_clock::time_point & getExpirationTimePoint () const
 
NamePrefixListgetNpl ()
 
const NamePrefixListgetNpl () const
 
const ndn::Name & getOriginRouter () const
 
ndn::Name getOriginRouterCopy () const
 
uint64_t getSeqNo () const
 
Lsa::Type getType () const override
 
bool isEqualContent (const NameLsa &other) const
 
void removeName (const ndn::Name &name)
 
void setExpirationTimePoint (const ndn::time::system_clock::time_point &lt)
 
void setExpiringEventId (ndn::scheduler::EventId eid)
 
void setSeqNo (uint64_t seqNo)
 
std::string toString () const override
 
std::tuple< bool, std::list< ndn::Name >, std::list< ndn::Name > > update (const std::shared_ptr< Lsa > &lsa) override
 
void wireDecode (const ndn::Block &wire)
 
const ndn::Block & wireEncode () const override
 
template<ndn::encoding::Tag TAG>
size_t wireEncode (ndn::EncodingImpl< TAG > &block) const
 

Static Public Member Functions

static constexpr Lsa::Type type ()
 

Protected Member Functions

std::string getString () const
 

Protected Attributes

ndn::time::system_clock::time_point m_expirationTimePoint
 
ndn::scheduler::ScopedEventId m_expiringEventId
 
ndn::Name m_originRouter
 
uint64_t m_seqNo = 0
 
ndn::Block m_wire
 

Detailed Description

Data abstraction for NameLsa NameLsa := NAME-LSA-TYPE TLV-LENGTH Lsa Name+.

Definition at line 35 of file name-lsa.hpp.

Member Enumeration Documentation

◆ Type

enum nlsr::Lsa::Type
stronginherited
Enumerator
ADJACENCY 
COORDINATE 
NAME 
BASE 

Definition at line 50 of file lsa.hpp.

Constructor & Destructor Documentation

◆ NameLsa() [1/3]

nlsr::NameLsa::NameLsa ( )
default

◆ NameLsa() [2/3]

nlsr::NameLsa::NameLsa ( const ndn::Name &  originRouter,
uint64_t  seqNo,
const ndn::time::system_clock::time_point &  timepoint,
const NamePrefixList npl 
)

Definition at line 27 of file name-lsa.cpp.

◆ NameLsa() [3/3]

nlsr::NameLsa::NameLsa ( const ndn::Block &  block)

Definition at line 37 of file name-lsa.cpp.

Member Function Documentation

◆ addName()

void nlsr::NameLsa::addName ( const ndn::Name &  name)
inline

Definition at line 71 of file name-lsa.hpp.

◆ getExpirationTimePoint()

const ndn::time::system_clock::time_point& nlsr::Lsa::getExpirationTimePoint ( ) const
inlineinherited

Definition at line 98 of file lsa.hpp.

◆ getNpl() [1/2]

NamePrefixList& nlsr::NameLsa::getNpl ( )
inline

Definition at line 59 of file name-lsa.hpp.

◆ getNpl() [2/2]

const NamePrefixList& nlsr::NameLsa::getNpl ( ) const
inline

Definition at line 65 of file name-lsa.hpp.

◆ getOriginRouter()

const ndn::Name& nlsr::Lsa::getOriginRouter ( ) const
inlineinherited

Definition at line 86 of file lsa.hpp.

◆ getOriginRouterCopy()

ndn::Name nlsr::Lsa::getOriginRouterCopy ( ) const
inlineinherited

Definition at line 92 of file lsa.hpp.

◆ getSeqNo()

uint64_t nlsr::Lsa::getSeqNo ( ) const
inlineinherited

Definition at line 80 of file lsa.hpp.

◆ getString()

std::string nlsr::Lsa::getString ( ) const
protectedinherited

Definition at line 144 of file lsa.cpp.

◆ getType()

Lsa::Type nlsr::NameLsa::getType ( ) const
inlineoverridevirtual

Implements nlsr::Lsa.

Definition at line 47 of file name-lsa.hpp.

◆ isEqualContent()

bool nlsr::NameLsa::isEqualContent ( const NameLsa other) const

Definition at line 116 of file name-lsa.cpp.

◆ removeName()

void nlsr::NameLsa::removeName ( const ndn::Name &  name)
inline

Definition at line 78 of file name-lsa.hpp.

◆ setExpirationTimePoint()

void nlsr::Lsa::setExpirationTimePoint ( const ndn::time::system_clock::time_point &  lt)
inlineinherited

Definition at line 104 of file lsa.hpp.

◆ setExpiringEventId()

void nlsr::Lsa::setExpiringEventId ( ndn::scheduler::EventId  eid)
inlineinherited

Definition at line 111 of file lsa.hpp.

◆ setSeqNo()

void nlsr::Lsa::setSeqNo ( uint64_t  seqNo)
inlineinherited

Definition at line 73 of file lsa.hpp.

◆ toString()

std::string nlsr::NameLsa::toString ( ) const
overridevirtual

Get data common to all LSA types for printing purposes.

Implements nlsr::Lsa.

Definition at line 122 of file name-lsa.cpp.

◆ type()

static constexpr Lsa::Type nlsr::NameLsa::type ( )
inlinestaticconstexpr

Definition at line 53 of file name-lsa.hpp.

◆ update()

std::tuple< bool, std::list< ndn::Name >, std::list< ndn::Name > > nlsr::NameLsa::update ( const std::shared_ptr< Lsa > &  lsa)
overridevirtual

Implements nlsr::Lsa.

Definition at line 136 of file name-lsa.cpp.

◆ wireDecode()

void nlsr::NameLsa::wireDecode ( const ndn::Block &  wire)

Definition at line 83 of file name-lsa.cpp.

◆ wireEncode() [1/2]

const ndn::Block & nlsr::NameLsa::wireEncode ( ) const
overridevirtual

Implements nlsr::Lsa.

Definition at line 65 of file name-lsa.cpp.

◆ wireEncode() [2/2]

template<ndn::encoding::Tag TAG>
size_t nlsr::NameLsa::wireEncode ( ndn::EncodingImpl< TAG > &  block) const

Definition at line 44 of file name-lsa.cpp.

Member Data Documentation

◆ m_expirationTimePoint

ndn::time::system_clock::time_point nlsr::Lsa::m_expirationTimePoint
protectedinherited

Definition at line 141 of file lsa.hpp.

◆ m_expiringEventId

ndn::scheduler::ScopedEventId nlsr::Lsa::m_expiringEventId
protectedinherited

Definition at line 142 of file lsa.hpp.

◆ m_originRouter

ndn::Name nlsr::Lsa::m_originRouter
protectedinherited

Definition at line 139 of file lsa.hpp.

◆ m_seqNo

uint64_t nlsr::Lsa::m_seqNo = 0
protectedinherited

Definition at line 140 of file lsa.hpp.

◆ m_wire

ndn::Block nlsr::Lsa::m_wire
mutableprotectedinherited

Definition at line 144 of file lsa.hpp.