retdec
var_name_gen.h
Go to the documentation of this file.
1 
7 #ifndef RETDEC_LLVMIR2HLL_VAR_NAME_GEN_VAR_NAME_GEN_H
8 #define RETDEC_LLVMIR2HLL_VAR_NAME_GEN_VAR_NAME_GEN_H
9 
10 #include <string>
11 
13 
14 namespace retdec {
15 namespace llvmir2hll {
16 
27 public:
28  virtual ~VarNameGen() = default;
29 
33  virtual std::string getId() const = 0;
34 
42  virtual void restart() = 0;
43 
50  virtual std::string getNextVarName() = 0;
51 
52  const std::string &getPrefix() const;
53 
54 protected:
55  VarNameGen(std::string prefix = "");
56 
57 protected:
59  const std::string prefix;
60 };
61 
62 } // namespace llvmir2hll
63 } // namespace retdec
64 
65 #endif
A base class for all generators of variable names.
Definition: var_name_gen.h:26
const std::string prefix
The prefix of all returned variable names.
Definition: var_name_gen.h:59
VarNameGen(std::string prefix="")
Constructs a new variable name generator.
Definition: var_name_gen.cpp:18
virtual void restart()=0
Restarts the generator to start returning variable names from the beginning.
virtual std::string getId() const =0
Returns the ID of the generator.
const std::string & getPrefix() const
Returns the prefix used by the generator.
Definition: var_name_gen.cpp:24
virtual std::string getNextVarName()=0
Returns a next variable name.
virtual ~VarNameGen()=default
A mixin to make classes non-copyable.
Definition: non_copyable.h:27
A library providing API for working with back-end IR.
Definition: archive_wrapper.h:19
A mixin to make classes non-copyable.