nlsr::CoordinateLsa Class Reference

Represents an LSA of hyperbolic coordinates of the origin router. More...

#include <coordinate-lsa.hpp>

+ Inheritance diagram for nlsr::CoordinateLsa:
+ Collaboration diagram for nlsr::CoordinateLsa:

Public Types

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

Public Member Functions

 CoordinateLsa ()=default
 
 CoordinateLsa (const ndn::Block &block)
 
 CoordinateLsa (const ndn::Name &originRouter, uint64_t seqNo, const ndn::time::system_clock::time_point &timepoint, double radius, std::vector< double > angles)
 
const ndn::time::system_clock::time_point & getExpirationTimePoint () const
 
const ndn::Name & getOriginRouter () const
 
double getRadius () const
 
uint64_t getSeqNo () const
 
const std::vector< double > & getTheta () const
 
Lsa::Type getType () const override
 
void setExpirationTimePoint (const ndn::time::system_clock::time_point &lt)
 
void setExpiringEventId (ndn::scheduler::EventId eid)
 
void setRadius (double cr)
 
void setSeqNo (uint64_t seqNo)
 
void setTheta (std::vector< double > ct)
 
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 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
 

Friends

bool operator== (const CoordinateLsa &lhs, const CoordinateLsa &rhs)
 

Detailed Description

Represents an LSA of hyperbolic coordinates of the origin router.

CoordinateLsa is encoded as:

CoordinateLsa = COORDINATE-LSA-TYPE TLV-LENGTH
Lsa
HyperbolicRadius
1*HyperbolicAngle ; theta
HyperbolicRadius = HYPERBOLIC-RADIUS-TYPE TLV-LENGTH
Double ; IEEE754 double precision
HyperbolicAngle = HYPERBOLIC-ANGLE-TYPE TLV-LENGTH
Double ; IEEE754 double precision

Definition at line 49 of file coordinate-lsa.hpp.

Member Enumeration Documentation

◆ Type

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

Definition at line 54 of file lsa.hpp.

Constructor & Destructor Documentation

◆ CoordinateLsa() [1/3]

nlsr::CoordinateLsa::CoordinateLsa ( )
default

◆ CoordinateLsa() [2/3]

nlsr::CoordinateLsa::CoordinateLsa ( const ndn::Name &  originRouter,
uint64_t  seqNo,
const ndn::time::system_clock::time_point &  timepoint,
double  radius,
std::vector< double >  angles 
)

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

◆ CoordinateLsa() [3/3]

nlsr::CoordinateLsa::CoordinateLsa ( const ndn::Block &  block)
explicit

Definition at line 36 of file coordinate-lsa.cpp.

Member Function Documentation

◆ getExpirationTimePoint()

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

Definition at line 97 of file lsa.hpp.

◆ getOriginRouter()

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

Definition at line 91 of file lsa.hpp.

◆ getRadius()

double nlsr::CoordinateLsa::getRadius ( ) const
inline

Definition at line 74 of file coordinate-lsa.hpp.

◆ getSeqNo()

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

Definition at line 85 of file lsa.hpp.

◆ getTheta()

const std::vector<double>& nlsr::CoordinateLsa::getTheta ( ) const
inline

Definition at line 87 of file coordinate-lsa.hpp.

◆ getType()

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

Implements nlsr::Lsa.

Definition at line 62 of file coordinate-lsa.hpp.

◆ setExpirationTimePoint()

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

Definition at line 103 of file lsa.hpp.

◆ setExpiringEventId()

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

Definition at line 110 of file lsa.hpp.

◆ setRadius()

void nlsr::CoordinateLsa::setRadius ( double  cr)
inline

Definition at line 80 of file coordinate-lsa.hpp.

◆ setSeqNo()

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

Definition at line 78 of file lsa.hpp.

◆ setTheta()

void nlsr::CoordinateLsa::setTheta ( std::vector< double >  ct)
inline

Definition at line 93 of file coordinate-lsa.hpp.

◆ type()

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

Definition at line 68 of file coordinate-lsa.hpp.

◆ update()

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

Implements nlsr::Lsa.

Definition at line 133 of file coordinate-lsa.cpp.

◆ wireDecode()

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

Definition at line 82 of file coordinate-lsa.cpp.

◆ wireEncode() [1/2]

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

Implements nlsr::Lsa.

Definition at line 64 of file coordinate-lsa.cpp.

◆ wireEncode() [2/2]

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

Definition at line 43 of file coordinate-lsa.cpp.

Friends And Related Function Documentation

◆ operator==

bool operator== ( const CoordinateLsa lhs,
const CoordinateLsa rhs 
)
friend

Definition at line 122 of file coordinate-lsa.hpp.

Member Data Documentation

◆ m_expirationTimePoint

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

Definition at line 139 of file lsa.hpp.

◆ m_expiringEventId

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

Definition at line 140 of file lsa.hpp.

◆ m_originRouter

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

Definition at line 137 of file lsa.hpp.

◆ m_seqNo

uint64_t nlsr::Lsa::m_seqNo = 0
protectedinherited

Definition at line 138 of file lsa.hpp.

◆ m_wire

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

Definition at line 142 of file lsa.hpp.