src: configuration file parsing
used boost::property_tree::info_parser for parsing nlsr's configuration file and
changed configuration command style to info command style. Removed tokenizer from
nlsr
Refs: #1542
Change-Id: If017ddd7eef5caa59b33940bfc27a71aa4de266b
diff --git a/src/adjacent.cpp b/src/adjacent.cpp
index 94dceee..f27c4b8 100644
--- a/src/adjacent.cpp
+++ b/src/adjacent.cpp
@@ -10,11 +10,31 @@
using namespace std;
-Adjacent::Adjacent(const ndn::Name& an, uint32_t cf, double lc, uint32_t s,
- uint32_t iton)
+const float Adjacent::DEFAULT_LINK_COST = 10.0;
+
+Adjacent::Adjacent()
+ : m_name()
+ , m_connectingFaceUri()
+ , m_linkCost(DEFAULT_LINK_COST)
+ , m_status(ADJACENT_STATUS_INACTIVE)
+ , m_interestTimedOutNo(0)
+{
+}
+
+Adjacent::Adjacent(const ndn::Name& an)
+ : m_name(an)
+ , m_connectingFaceUri()
+ , m_linkCost(DEFAULT_LINK_COST)
+ , m_status(ADJACENT_STATUS_INACTIVE)
+ , m_interestTimedOutNo(0)
+ {
+ }
+
+Adjacent::Adjacent(const ndn::Name& an, const std::string& cfu, double lc,
+ uint32_t s, uint32_t iton)
{
m_name = an;
- m_connectingFace = cf;
+ m_connectingFaceUri = cfu;
m_linkCost = lc;
m_status = s;
m_interestTimedOutNo = iton;
@@ -24,7 +44,7 @@
Adjacent::operator==(const Adjacent& adjacent) const
{
return (m_name == adjacent.getName()) &&
- (m_connectingFace == adjacent.getConnectingFace()) &&
+ (m_connectingFaceUri == adjacent.getConnectingFaceUri()) &&
(std::abs(m_linkCost - adjacent.getLinkCost()) <
std::numeric_limits<double>::epsilon()) ;
}
@@ -39,7 +59,7 @@
operator<<(std::ostream& os, const Adjacent& adj)
{
os << "Adjacent : " << adj.getName() << endl;
- os << "Connecting Face: " << adj.getConnectingFace() << endl;
+ os << "Connecting FaceUri: " << adj.getConnectingFaceUri() << endl;
os << "Link Cost: " << adj.getLinkCost() << endl;
os << "Status: " << adj.getStatus() << endl;
os << "Interest Timed out: " << adj.getInterestTimedOutNo() << endl;