nlsr::NameLsa Class Reference

#include <lsa.hpp>

Inheritance diagram for nlsr::NameLsa:
[legend]
Collaboration diagram for nlsr::NameLsa:
[legend]

Public Types

enum  Type {
  Type::ADJACENCY, Type::COORDINATE, Type::NAME, Type::BASE,
  Type::MOCK
}
 

Public Member Functions

 NameLsa ()=default
 
 NameLsa (const ndn::Name &origR, uint32_t lsn, const ndn::time::system_clock::TimePoint &lt, NamePrefixList &npl)
 
Lsa::Type getType () const override
 
NamePrefixListgetNpl ()
 
const NamePrefixListgetNpl () const
 
void addName (const ndn::Name &name)
 
void removeName (const ndn::Name &name)
 
bool deserialize (const std::string &content) noexceptoverride
 Initializes this LSA object with content's data. More...
 
bool isEqualContent (const NameLsa &other) const
 
void writeLog () const override
 
std::string serialize () const override
 Returns the data that this name LSA has. More...
 
void setLsSeqNo (uint32_t lsn)
 
uint32_t getLsSeqNo () const
 
const ndn::Name & getOrigRouter () const
 
void setOrigRouter (const ndn::Name &org)
 
const ndn::time::system_clock::TimePoint & getExpirationTimePoint () const
 
void setExpirationTimePoint (const ndn::time::system_clock::TimePoint &lt)
 
void setExpiringEventId (ndn::scheduler::EventId eid)
 
ndn::scheduler::EventId getExpiringEventId () const
 
const ndn::Name getKey () const
 Gets the key for this LSA. More...
 

Protected Member Functions

std::string getData () const
 
std::string toString () const
 
bool deserializeCommon (boost::tokenizer< boost::char_separator< char >>::iterator &iterator)
 

Protected Attributes

ndn::Name m_origRouter
 
uint32_t m_lsSeqNo = 0
 
ndn::time::system_clock::TimePoint m_expirationTimePoint
 
ndn::scheduler::EventId m_expiringEventId
 

Friends

std::ostream & operator<< (std::ostream &os, const NameLsa &lsa)
 

Detailed Description

Definition at line 150 of file lsa.hpp.

Member Enumeration Documentation

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

Definition at line 38 of file lsa.hpp.

Constructor & Destructor Documentation

nlsr::NameLsa::NameLsa ( )
default
nlsr::NameLsa::NameLsa ( const ndn::Name &  origR,
uint32_t  lsn,
const ndn::time::system_clock::TimePoint &  lt,
NamePrefixList npl 
)

Definition at line 68 of file lsa.cpp.

Here is the call graph for this function:

Member Function Documentation

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

Definition at line 178 of file lsa.hpp.

Here is the caller graph for this function:

bool nlsr::NameLsa::deserialize ( const std::string &  content)
overridevirtualnoexcept

Initializes this LSA object with content's data.

Parameters
contentThe data (e.g. name prefixes) to initialize this LSA with.

This function initializes this object to represent the data contained in content. The format for this is the same as for getData(); getData() returns data of this format, in other words.

Implements nlsr::Lsa.

Definition at line 93 of file lsa.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

bool nlsr::Lsa::deserializeCommon ( boost::tokenizer< boost::char_separator< char >>::iterator &  iterator)
protectedinherited

Definition at line 56 of file lsa.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

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

Get data common to all LSA types.

This method should be called by all LSA classes in their serialize() method.

Definition at line 41 of file lsa.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

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

Definition at line 80 of file lsa.hpp.

Here is the caller graph for this function:

ndn::scheduler::EventId nlsr::Lsa::getExpiringEventId ( ) const
inlineinherited

Definition at line 98 of file lsa.hpp.

Here is the call graph for this function:

Here is the caller graph for this function:

const ndn::Name nlsr::Lsa::getKey ( ) const
inherited

Gets the key for this LSA.

Format is: <router name>/<LSA type>\

Definition at line 50 of file lsa.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

uint32_t nlsr::Lsa::getLsSeqNo ( ) const
inlineinherited

Definition at line 62 of file lsa.hpp.

Here is the caller graph for this function:

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

Definition at line 166 of file lsa.hpp.

Here is the caller graph for this function:

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

Definition at line 172 of file lsa.hpp.

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

Definition at line 68 of file lsa.hpp.

Here is the caller graph for this function:

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

Reimplemented from nlsr::Lsa.

Definition at line 160 of file lsa.hpp.

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

Definition at line 118 of file lsa.cpp.

Here is the call graph for this function:

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

Definition at line 184 of file lsa.hpp.

Here is the call graph for this function:

Here is the caller graph for this function:

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

Returns the data that this name LSA has.

Format is: <original router prefix>|name|<seq. no.>|<exp. time>|<prefix 1>|<prefix 2>|...|<prefix n>|

Implements nlsr::Lsa.

Definition at line 81 of file lsa.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

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

Definition at line 86 of file lsa.hpp.

Here is the caller graph for this function:

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

Definition at line 92 of file lsa.hpp.

Here is the caller graph for this function:

void nlsr::Lsa::setLsSeqNo ( uint32_t  lsn)
inlineinherited

Definition at line 56 of file lsa.hpp.

Here is the caller graph for this function:

void nlsr::Lsa::setOrigRouter ( const ndn::Name &  org)
inlineinherited

Definition at line 74 of file lsa.hpp.

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

Print data common to all LSA types.

Definition at line 350 of file lsa.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void nlsr::NameLsa::writeLog ( ) const
overridevirtual

Implements nlsr::Lsa.

Definition at line 124 of file lsa.cpp.

Here is the caller graph for this function:

Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  os,
const NameLsa lsa 
)
friend

Definition at line 308 of file lsa.cpp.

Field Documentation

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

Definition at line 146 of file lsa.hpp.

ndn::scheduler::EventId nlsr::Lsa::m_expiringEventId
protectedinherited

Definition at line 147 of file lsa.hpp.

uint32_t nlsr::Lsa::m_lsSeqNo = 0
protectedinherited

Definition at line 145 of file lsa.hpp.

ndn::Name nlsr::Lsa::m_origRouter
protectedinherited

Definition at line 144 of file lsa.hpp.