My Project
Report.h
1 #pragma once
2 
3 #include <list>
4 #include <string>
5 #include <map>
6 using namespace std;
7 
8 namespace ParaEngine
9 {
15 class CReport
16 {
17 public:
18  CReport(void);
19  ~CReport(void);
20 
21 private:
22 
23  struct ReportItem
24  {
25  enum ItemType{
26  ReportString,
27  ReportValue
28  } itemtype;
29  string str;
30  double dValue;
31  ReportItem(const char* str){
32  this->str = str;
33  itemtype = ReportString;
34  }
35  ReportItem(double v){
36  dValue = v;
37  itemtype = ReportValue;
38  }
39  string GetString();
40 
41  };
42  // report items
43  map <string, ReportItem> m_items;
44 
45 public:
49  double GetValue (const char * strItemName);
53  void SetValue (const char * strItemName, double dValue);
57  void SetString (const char * strItemName, const char * str);
58 
59  /*
60  * create a new item using a user defined format.
61  * the format will be passed to printf(report, format, dValue) to generate report string.
62  * @params format: the format string such as "FPS is %d".
63  */
64  //void CreateItem(const char * strItemName, ReportItem& item);
65 
71  void GetItemReport (const char * strItemName, char* pReport);
72 
77  void GetAllReport (string & sReport);
78 };
79 }
different physics engine has different winding order.
Definition: EventBinding.h:32
this is a default report class.
Definition: Report.h:15