AMSmartProperties  201
Core library
AMVariableNames.h
Go to the documentation of this file.
1 
8 #ifndef AMVARIABLENAMES_H
9 #define AMVARIABLENAMES_H
10 
17 #include <map>
18 #include <string>
19 
20 namespace AMSmartProperties {
21 
29 {
30  static bool m_enabled;
31  std::map<const void*, std::string> m_map;
32  static AMVariableNames* m_instance;
33 
35  static AMVariableNames& instance();
36 public:
42  static void setEnabled(bool);
52  static void setVariableName(const void* ptr, const char * prefix, const char * delimiter, const char * name);
62  static void setVariableName(const void* ptr, std::string name, bool enabled);
70  static std::string getVariableName(const void* ptr);
78  static const char* getVariableNameCStr(const void* ptr);
83  static bool isEnabled() {
84  return m_enabled;
85  }
86 };
87 
88 } //namespace
89 
91 #endif
static void setVariableName(const void *ptr, const char *prefix, const char *delimiter, const char *name)
assign variable name with address. Stored string value is prefix+delimiter+name. reasin for split it ...
static bool isEnabled()
get info that function is enabled.
Definition: AMVariableNames.h:83
static const char * getVariableNameCStr(const void *ptr)
string with variable name and address. In case, that variable names is allowed and name was previousl...
static std::string getVariableName(const void *ptr)
string with variable name and address. In case, that variable names is allowed and name was previousl...
static void setEnabled(bool)
enable or disable this function. Typically called on on initialisation. Default state is false - disa...
Simple sigleton, that assign address in memory to human readable name. Function is implicitly disable...
Definition: AMVariableNames.h:28
Definition: AMFunction.h:16