Noise Modeler Library  0.1
Library for procedurally generating noise-based terrains and other content
 All Classes Files Functions Variables Enumerations Enumerator Groups Pages
idgenerator.hpp
1 #ifndef NM_IDGENERATOR_HPP
2 #define NM_IDGENERATOR_HPP
3 
4 #include <string>
5 
6 namespace nm {
7 
12 class IdGenerator {
13 public:
14  explicit IdGenerator(std::string prefix="nm_id_"):
15  m_prefix(prefix),
16  m_i(0)
17  {}
18  std::string getUniqueId() {
19  return m_prefix + std::to_string(m_i++);
20  }
21 private:
22  std::string m_prefix;
23  long m_i;
24 };
25 
26 } // namespace nm
27 
28 #endif // NM_IDGENERATOR_HPP
The IdGenerator class.
Definition: idgenerator.hpp:12