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 ()
 
 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 (const ndn::EventId leei)
 
ndn::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
 
ndn::time::system_clock::TimePoint m_expirationTimePoint
 
ndn::EventId m_expiringEventId
 

Friends

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

Detailed Description

Definition at line 158 of file lsa.hpp.

Member Enumeration Documentation

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

Definition at line 41 of file lsa.hpp.

Constructor & Destructor Documentation

nlsr::NameLsa::NameLsa ( )
inline

Definition at line 161 of file lsa.hpp.

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 188 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 88 of file lsa.hpp.

Here is the caller graph for this function:

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

Definition at line 106 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 70 of file lsa.hpp.

Here is the caller graph for this function:

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

Definition at line 176 of file lsa.hpp.

Here is the caller graph for this function:

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

Definition at line 182 of file lsa.hpp.

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

Definition at line 76 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 170 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 194 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 94 of file lsa.hpp.

Here is the caller graph for this function:

void nlsr::Lsa::setExpiringEventId ( const ndn::EventId  leei)
inlineinherited

Definition at line 100 of file lsa.hpp.

Here is the caller graph for this function:

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

Definition at line 64 of file lsa.hpp.

Here is the caller graph for this function:

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

Definition at line 82 of file lsa.hpp.

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

Print data common to all LSA types.

Definition at line 365 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 323 of file lsa.cpp.

Field Documentation

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

Definition at line 154 of file lsa.hpp.

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

Definition at line 155 of file lsa.hpp.

uint32_t nlsr::Lsa::m_lsSeqNo
protectedinherited

Definition at line 153 of file lsa.hpp.

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

Definition at line 152 of file lsa.hpp.