00001 #ifndef __GTXabsl2ProfilerLog_h_
00002 #define __GTXabsl2ProfilerLog_h_
00003
00004 #ifdef _WIN32
00005 #pragma warning(disable:4786)
00006
00007
00008 #endif
00009
00010 #include <string>
00011 #include <vector>
00012 #include <deque>
00013
00014 #include "Platform/GTAssert.h"
00015
00016 #include "Tools/Streams/OutStreams.h"
00017 #include "Platform/SystemCall.h"
00018
00019
00020 #include "Tools/Xabsl2/Xabsl2Engine/Xabsl2Engine.h"
00021 #include "Tools/Debugging/Debugging.h"
00022
00023 #include "Tools/Streams/InStreams.h"
00024 #include "Tools/Module/SolutionRequest.h"
00025
00026 #include "GTXabsl2ProfilerNameTable.h"
00027
00028
00029 class GTXabsl2ActiveOption{
00030 public:
00031
00032 int optionNumber;
00033
00034
00035 int stateNumber;
00036
00037
00038 std::vector<double> parameters;
00039
00040
00041
00042
00043
00044 GTXabsl2ActiveOption(): optionNumber(-1), stateNumber(-1){}
00045
00046
00047
00048
00049
00050 GTXabsl2ActiveOption(int o, int st, std::vector<double> p): optionNumber(o), stateNumber(st), parameters(p){}
00051
00052
00053
00054
00055 bool operator ==(const GTXabsl2ActiveOption other)const
00056 {
00057 if(this->optionNumber == other.optionNumber && this->stateNumber == other.stateNumber
00058 && this->parameters == other.parameters)
00059 return true;
00060 return false;
00061 }
00062 };
00063
00064
00065
00066
00067
00068
00069 class GTXabsl2LogEntry{
00070 public:
00071
00072 unsigned long frameNumber;
00073
00074
00075 std::vector<double> inputSymbolValues;
00076
00077
00078 std::vector<GTXabsl2ActiveOption> activeOptions;
00079
00080
00081
00082
00083 GTXabsl2LogEntry(){};
00084 GTXabsl2LogEntry(unsigned long fn):frameNumber(fn){}
00085 GTXabsl2LogEntry(unsigned long fn, std::vector<GTXabsl2ActiveOption> aO, std::vector<double>dI):frameNumber(fn), inputSymbolValues(dI), activeOptions(aO){}
00086 unsigned int getMaxNumberOfParameters(){
00087 unsigned int maxNumberOfParameters = 0;
00088 for(unsigned int i = 0; i < activeOptions.size(); ++i){
00089 if(activeOptions[i].parameters.size() > maxNumberOfParameters)
00090 maxNumberOfParameters = activeOptions[i].parameters.size();
00091 }
00092 return maxNumberOfParameters;
00093 }
00094 int differsInParameters(GTXabsl2LogEntry& entry);
00095 };
00096
00097
00098
00099
00100
00101
00102 In& operator>>(In& in, GTXabsl2LogEntry& log);
00103
00104
00105
00106
00107
00108
00109
00110 Out& operator<<(Out& out, const GTXabsl2LogEntry& log);
00111
00112
00113
00114
00115
00116 class GTXabsl2Log: public std::deque<GTXabsl2LogEntry>
00117 {
00118 public:
00119
00120 GTXabsl2ProfilerNameTable nameTable;
00121
00122
00123 std::vector<std::string> inputSymbolNames;
00124
00125
00126
00127
00128
00129
00130
00131
00132
00133
00134 void init(Xabsl2Engine& pEngine);
00135
00136
00137
00138
00139 void append(GTXabsl2LogEntry logentry);
00140
00141 void clearAll();
00142
00143 int getIndexOfFrameNumber(unsigned int frameNumber);
00144
00145 int getActiveOptionNumberAtFrameNumber(unsigned int frameNumber, int optionMaxDepth);
00146 GTXabsl2ActiveOption getOption(int index, int optionMaxDepth);
00147 };
00148
00149
00150
00151
00152
00153
00154
00155 In& operator>>(In& in, GTXabsl2Log& log);
00156
00157
00158
00159
00160
00161
00162
00163 Out& operator<<(Out& out, const GTXabsl2Log& log);
00164
00165
00166 #endif// __GTXabsl2ProfilerLog_h_