00001
00002
00003
00004
00005
00006
00007
00008 #ifndef __GTXabsl2ProfilerNameTable_h_
00009 #define __GTXabsl2ProfilerNameTable_h_
00010
00011 #ifdef _WIN32
00012 #pragma warning(disable:4786)
00013
00014
00015 #endif
00016
00017 #include <string>
00018 #include <vector>
00019 #include <deque>
00020
00021 #include "Platform/GTAssert.h"
00022
00023 #include "Tools/Streams/OutStreams.h"
00024 #include "Platform/SystemCall.h"
00025
00026 #include "Tools/Xabsl2/Xabsl2Engine/Xabsl2Array.h"
00027 #include "Tools/Xabsl2/Xabsl2Engine/Xabsl2Engine.h"
00028 #include "Tools/Debugging/Debugging.h"
00029
00030 #include "Tools/Streams/InStreams.h"
00031 #include "Tools/Module/SolutionRequest.h"
00032
00033
00034
00035
00036
00037
00038 class GTXabsl2ProfilerNameTableEntry{
00039 public:
00040
00041 std::string optionName;
00042
00043 std::vector<std::string> states;
00044
00045 std::vector<std::string> parameters;
00046
00047 int maxDepth;
00048
00049
00050
00051
00052
00053 GTXabsl2ProfilerNameTableEntry(){};
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063 GTXabsl2ProfilerNameTableEntry(const std::string option,std::vector<std::string> state, std::vector<std::string> params, const int depth)
00064 : optionName(option), states(state), parameters(params), maxDepth(depth){}
00065
00066 };
00067
00068
00069
00070
00071
00072
00073 class GTXabsl2ProfilerNameTable: public std::vector<GTXabsl2ProfilerNameTableEntry>
00074 {
00075
00076 public:
00077 int maxDepth;
00078
00079
00080
00081
00082 GTXabsl2ProfilerNameTable(): maxDepth(0)
00083 {}
00084
00085
00086
00087
00088 void init(Xabsl2Engine& pEngine);
00089
00090
00091
00092
00093
00094 int getOptionPosition(const std::string optionName) const
00095 {
00096 return findOption(optionName);
00097 }
00098
00099
00100
00101
00102
00103
00104
00105
00106 int getStatePosition(const std::string optionName, const std::string state){
00107 return findState(optionName, state);
00108 }
00109
00110
00111
00112
00113
00114 bool exists(const std::string optionName, const std::string stateName) const
00115 {
00116 return find(optionName, stateName) >= 0;
00117 }
00118
00119
00120
00121
00122 bool existsOption(const std::string option){
00123 return findOption(option) >=0;
00124 }
00125
00126
00127 protected:
00128
00129
00130
00131
00132 int find(const std::string optionName, const std::string state) const;
00133
00134
00135
00136
00137
00138 int findState(const std::string optionName, const std::string state) const;
00139
00140
00141
00142
00143
00144 int findOption(const std::string optionName) const;
00145
00146
00147
00148
00149
00150
00151 void registerOption(const Xabsl2Option* option, int depth);
00152
00153
00154
00155
00156 void countDepth(const Xabsl2Option* option, int depth);
00157
00158 };
00159
00160
00161
00162
00163
00164
00165 In& operator>>(In& in, GTXabsl2ProfilerNameTable& nameTable);
00166
00167
00168
00169
00170
00171
00172
00173 Out& operator<<(Out& out, const GTXabsl2ProfilerNameTable& nameTable);
00174
00175
00176 #endif// __GTXabsl2Profiler_h_