src: Replace LSA string literals with constants
refs: #2310
Change-Id: I0823c320400fe03b6268982cec05578c04d82ca8
diff --git a/src/lsa.hpp b/src/lsa.hpp
index 2137069..6ba85c9 100644
--- a/src/lsa.hpp
+++ b/src/lsa.hpp
@@ -120,7 +120,7 @@
: Lsa()
, m_npl()
{
- setLsType("name");
+ setLsType(NameLsa::TYPE_STRING);
}
NameLsa(const ndn::Name& origR, const std::string& lst, uint32_t lsn,
@@ -159,7 +159,8 @@
private:
NamePrefixList m_npl;
-
+public:
+ static const std::string TYPE_STRING;
};
class AdjLsa: public Lsa
@@ -169,7 +170,7 @@
: Lsa()
, m_adl()
{
- setLsType("adjacency");
+ setLsType(AdjLsa::TYPE_STRING);
}
AdjLsa(const ndn::Name& origR, const std::string& lst, uint32_t lsn,
@@ -218,6 +219,9 @@
private:
uint32_t m_noLink;
AdjacencyList m_adl;
+
+public:
+ static const std::string TYPE_STRING;
};
class CoordinateLsa: public Lsa
@@ -228,7 +232,7 @@
, m_corRad(0)
, m_corTheta(0)
{
- setLsType("coordinate");
+ setLsType(CoordinateLsa::TYPE_STRING);
}
CoordinateLsa(const ndn::Name& origR, const std::string lst, uint32_t lsn,
@@ -278,6 +282,8 @@
double m_corRad;
double m_corTheta;
+public:
+ static const std::string TYPE_STRING;
};
}//namespace nlsr