sequencing-manager.hpp
Go to the documentation of this file.
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
22 #ifndef NLSR_SEQUENCING_MANAGER_HPP
23 #define NLSR_SEQUENCING_MANAGER_HPP
24 
25 #include "conf-parameter.hpp"
26 #include "test-access-control.hpp"
27 
28 #include <ndn-cxx/face.hpp>
29 
30 #include <list>
31 #include <string>
32 #include <boost/cstdint.hpp>
33 
34 namespace nlsr {
35 
37 {
38 public:
39  SequencingManager(std::string filePath, int hypState);
40 
41  uint64_t
42  getNameLsaSeq() const
43  {
44  return m_nameLsaSeq;
45  }
46 
47  void
48  setNameLsaSeq(uint64_t nlsn)
49  {
50  m_nameLsaSeq = nlsn;
51  }
52 
53  uint64_t
54  getAdjLsaSeq() const
55  {
56  return m_adjLsaSeq;
57  }
58 
59  void
60  setAdjLsaSeq(uint64_t alsn)
61  {
62  m_adjLsaSeq = alsn;
63  }
64 
65  uint64_t
66  getCorLsaSeq() const
67  {
68  return m_corLsaSeq;
69  }
70 
71  void
72  setCorLsaSeq(uint64_t clsn)
73  {
74  m_corLsaSeq = clsn;
75  }
76 
77  void
79  {
80  m_nameLsaSeq++;
81  }
82 
83  void
85  {
86  m_adjLsaSeq++;
87  }
88 
89  void
91  {
92  m_corLsaSeq++;
93  }
94 
95  void
96  writeSeqNoToFile() const;
97 
99  void
100  initiateSeqNoFromFile();
101 
102 private:
109  void
110  setSeqFileDirectory(const std::string& filePath);
111 
112  void
113  writeLog() const;
114 
115 private:
116  uint64_t m_nameLsaSeq;
117  uint64_t m_adjLsaSeq;
118  uint64_t m_corLsaSeq;
119  std::string m_seqFileNameWithPath;
120 
122  int m_hyperbolicState;
123 };
124 
125 } // namespace nlsr
126 #endif // NLSR_SEQUENCING_MANAGER_HPP
void setAdjLsaSeq(uint64_t alsn)
#define PUBLIC_WITH_TESTS_ELSE_PRIVATE
uint64_t getCorLsaSeq() const
uint64_t getAdjLsaSeq() const
uint64_t getNameLsaSeq() const
void setNameLsaSeq(uint64_t nlsn)
Copyright (c) 2014-2018, The University of Memphis, Regents of the University of California, Arizona Board of Regents.
void setCorLsaSeq(uint64_t clsn)
SequencingManager(std::string filePath, int hypState)