retdec
|
A base class for all generators of variable names. More...
#include <var_name_gen.h>
Public Member Functions | |
virtual | ~VarNameGen ()=default |
virtual std::string | getId () const =0 |
Returns the ID of the generator. More... | |
virtual void | restart ()=0 |
Restarts the generator to start returning variable names from the beginning. More... | |
virtual std::string | getNextVarName ()=0 |
Returns a next variable name. More... | |
const std::string & | getPrefix () const |
Returns the prefix used by the generator. More... | |
Protected Member Functions | |
VarNameGen (std::string prefix="") | |
Constructs a new variable name generator. More... | |
Protected Attributes | |
const std::string | prefix |
The prefix of all returned variable names. More... | |
Additional Inherited Members | |
![]() | |
NonCopyable (const NonCopyable &)=delete | |
NonCopyable & | operator= (const NonCopyable &)=delete |
NonCopyable ()=default | |
~NonCopyable ()=default | |
A base class for all generators of variable names.
This class should be used as a base class for all generators of variable names. These are classes which can generate names of anonymous local variables.
Instances of this class have reference object semantics.
|
virtualdefault |
|
protected |
Constructs a new variable name generator.
[in] | prefix | Prefix of all returned names. |
|
pure virtual |
Returns the ID of the generator.
Implemented in retdec::llvmir2hll::WordVarNameGen, retdec::llvmir2hll::NumVarNameGen, and retdec::llvmir2hll::FruitVarNameGen.
|
pure virtual |
Returns a next variable name.
If there is no next variable name available, the generator starts generating names from the beginning.
Implemented in retdec::llvmir2hll::WordVarNameGen, retdec::llvmir2hll::NumVarNameGen, and retdec::llvmir2hll::FruitVarNameGen.
const std::string & retdec::llvmir2hll::VarNameGen::getPrefix | ( | ) | const |
Returns the prefix used by the generator.
|
pure virtual |
Restarts the generator to start returning variable names from the beginning.
Note that there is no requirement for this class to return variable names in the same order between consecutive calls to this function.
Implemented in retdec::llvmir2hll::WordVarNameGen, retdec::llvmir2hll::NumVarNameGen, and retdec::llvmir2hll::FruitVarNameGen.
|
protected |
The prefix of all returned variable names.