akmhoque | fdbddb1 | 2014-05-02 18:35:19 -0500 | [diff] [blame^] | 1 | #ifndef NLSR_NAME_PREFIX_LIST_HPP |
2 | #define NLSR_NAME_PREFIX_LIST_HPP | ||||
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 3 | |
4 | #include <list> | ||||
5 | #include <string> | ||||
akmhoque | fdbddb1 | 2014-05-02 18:35:19 -0500 | [diff] [blame^] | 6 | #include <boost/cstdint.hpp> |
akmhoque | c8a10f7 | 2014-04-25 18:42:55 -0500 | [diff] [blame] | 7 | |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 8 | |
9 | namespace nlsr { | ||||
akmhoque | c8a10f7 | 2014-04-25 18:42:55 -0500 | [diff] [blame] | 10 | class NamePrefixList |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 11 | { |
12 | |||||
13 | public: | ||||
akmhoque | c8a10f7 | 2014-04-25 18:42:55 -0500 | [diff] [blame] | 14 | NamePrefixList(); |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 15 | |
akmhoque | c8a10f7 | 2014-04-25 18:42:55 -0500 | [diff] [blame] | 16 | ~NamePrefixList(); |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 17 | |
akmhoque | fdbddb1 | 2014-05-02 18:35:19 -0500 | [diff] [blame^] | 18 | int32_t |
19 | insert(const std::string& name); | ||||
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 20 | |
akmhoque | fdbddb1 | 2014-05-02 18:35:19 -0500 | [diff] [blame^] | 21 | int32_t |
22 | remove(const std::string& name); | ||||
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 23 | |
24 | void | ||||
25 | sort(); | ||||
26 | |||||
akmhoque | fdbddb1 | 2014-05-02 18:35:19 -0500 | [diff] [blame^] | 27 | int32_t |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 28 | getSize() |
29 | { | ||||
30 | return m_nameList.size(); | ||||
31 | } | ||||
32 | |||||
33 | std::list<std::string>& | ||||
34 | getNameList() | ||||
35 | { | ||||
36 | return m_nameList; | ||||
37 | } | ||||
38 | |||||
39 | void | ||||
40 | print(); | ||||
41 | |||||
42 | private: | ||||
43 | std::list<std::string> m_nameList; | ||||
44 | |||||
45 | }; | ||||
46 | |||||
47 | }//namespace nlsr | ||||
48 | |||||
akmhoque | fdbddb1 | 2014-05-02 18:35:19 -0500 | [diff] [blame^] | 49 | #endif //NLSR_NAME_PREFIX_LIST_HPP |