akmhoque | 157b0a4 | 2014-05-13 00:26:37 -0500 | [diff] [blame^] | 1 | #ifndef CONF_PROCESSOR_HPP |
2 | #define CONF_PROCESSOR_HPP | ||||
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 3 | |
akmhoque | 157b0a4 | 2014-05-13 00:26:37 -0500 | [diff] [blame^] | 4 | #include <boost/smart_ptr/shared_ptr.hpp> |
5 | #include <boost/property_tree/ptree.hpp> | ||||
akmhoque | fdbddb1 | 2014-05-02 18:35:19 -0500 | [diff] [blame] | 6 | #include <boost/cstdint.hpp> |
akmhoque | 157b0a4 | 2014-05-13 00:26:37 -0500 | [diff] [blame^] | 7 | |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 8 | #include "nlsr.hpp" |
9 | |||||
10 | namespace nlsr { | ||||
akmhoque | b6450b1 | 2014-04-24 00:01:03 -0500 | [diff] [blame] | 11 | |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 12 | class ConfFileProcessor |
13 | { | ||||
14 | public: | ||||
akmhoque | fdbddb1 | 2014-05-02 18:35:19 -0500 | [diff] [blame] | 15 | ConfFileProcessor(Nlsr& nlsr, const std::string& cfile) |
akmhoque | b6450b1 | 2014-04-24 00:01:03 -0500 | [diff] [blame] | 16 | : m_confFileName(cfile) |
17 | , m_nlsr(nlsr) | ||||
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 18 | { |
19 | } | ||||
20 | |||||
akmhoque | 157b0a4 | 2014-05-13 00:26:37 -0500 | [diff] [blame^] | 21 | bool |
22 | processConfFile(); | ||||
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 23 | |
24 | private: | ||||
akmhoque | 157b0a4 | 2014-05-13 00:26:37 -0500 | [diff] [blame^] | 25 | bool |
26 | load(std::istream& input); | ||||
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 27 | |
akmhoque | 157b0a4 | 2014-05-13 00:26:37 -0500 | [diff] [blame^] | 28 | bool |
29 | processSection(const std::string& section, | ||||
30 | boost::property_tree::ptree SectionAttributeTree); | ||||
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 31 | |
akmhoque | 157b0a4 | 2014-05-13 00:26:37 -0500 | [diff] [blame^] | 32 | bool |
33 | processConfSectionGeneral(boost::property_tree::ptree SectionAttributeTree); | ||||
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 34 | |
akmhoque | 157b0a4 | 2014-05-13 00:26:37 -0500 | [diff] [blame^] | 35 | bool |
36 | processConfSectionNeighbors(boost::property_tree::ptree SectionAttributeTree); | ||||
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 37 | |
akmhoque | 157b0a4 | 2014-05-13 00:26:37 -0500 | [diff] [blame^] | 38 | bool |
39 | processConfSectionHyperbolic(boost::property_tree::ptree SectionAttributeTree); | ||||
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 40 | |
akmhoque | 157b0a4 | 2014-05-13 00:26:37 -0500 | [diff] [blame^] | 41 | bool |
42 | processConfSectionFib(boost::property_tree::ptree SectionAttributeTree); | ||||
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 43 | |
akmhoque | 157b0a4 | 2014-05-13 00:26:37 -0500 | [diff] [blame^] | 44 | bool |
45 | processConfSectionAdvertising(boost::property_tree::ptree SectionAttributeTree); | ||||
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 46 | |
47 | private: | ||||
akmhoque | fdbddb1 | 2014-05-02 18:35:19 -0500 | [diff] [blame] | 48 | std::string m_confFileName; |
akmhoque | b6450b1 | 2014-04-24 00:01:03 -0500 | [diff] [blame] | 49 | Nlsr& m_nlsr; |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 50 | }; |
51 | |||||
52 | } //namespace nlsr | ||||
akmhoque | 157b0a4 | 2014-05-13 00:26:37 -0500 | [diff] [blame^] | 53 | #endif //CONF_PROCESSOR_HPP |