Critical Link MityCam SoC Firmware  1.0
Critical Link MityCam SoC Firmware
StatusReporter.h
Go to the documentation of this file.
1 #ifndef STATUSREPORTER_H
2 #define STATUSREPORTER_H
3 
4 #include <list>
5 #include <stdarg.h>
6 
17 {
18 public:
20  {
21  mcReporters.push_back(this);
22  }
23 
25  {
26  mcReporters.remove(this);
27  }
28 
32  enum teStatus
33  {
34  // Use this to signify capturing has started.
36  // Use this to signify capturing has ended.
38  // Use this to clear negative indications
40  // Use this to indicate a non-fatal issue (such as an invalid configuration).
42  // Use this to indicate a fatal issue (can't communicate with peripherals, etc).
44  // Use this to clear all indications
46  // Use this to indicate an information message (such as for diagnostics), this will not alter current indicators
48  };
49 
55  virtual void updateStatus(teStatus aeStatus, const char *apMessage) = 0;
56 
61  virtual void disableIndicators(bool abDisable) {}
62 
63  static void UpdateStatus(teStatus aeStatus, const char *apMessage);
64  static void DisableIndicators(bool abDisable);
65 
66 protected:
67  const char* statusToString(teStatus aeStatus);
68  static std::list<tcStatusReporter*> mcReporters;
69 };
70 
71 inline void DisableIndicators(bool abDisable)
72 {
74 }
75 
76 void UpdateStatus(const char *apFMT, ...);
77 
78 void UpdateStatus(tcStatusReporter::teStatus aeStatus, const char *apFMT, ...);
79 
80 void dump_backtrace(void);
81 
82 #endif // STATUSREPORTER_H
tcStatusReporter::disableIndicators
virtual void disableIndicators(bool abDisable)
Definition: StatusReporter.h:61
tcStatusReporter::teStatus
teStatus
Definition: StatusReporter.h:32
tcStatusReporter::tcStatusReporter
tcStatusReporter()
Definition: StatusReporter.h:19
tcStatusReporter::eeError
@ eeError
Definition: StatusReporter.h:43
tcStatusReporter::eeGood
@ eeGood
Definition: StatusReporter.h:39
tcStatusReporter
Base Class for status reporting interface.
Definition: StatusReporter.h:16
tcStatusReporter::eeCapturingEnd
@ eeCapturingEnd
Definition: StatusReporter.h:37
tcStatusReporter::eeCapturingStart
@ eeCapturingStart
Definition: StatusReporter.h:35
tcStatusReporter::DisableIndicators
static void DisableIndicators(bool abDisable)
Definition: StatusReporter.cpp:78
tcStatusReporter::statusToString
const char * statusToString(teStatus aeStatus)
Definition: StatusReporter.cpp:85
tcStatusReporter::UpdateStatus
static void UpdateStatus(teStatus aeStatus, const char *apMessage)
Definition: StatusReporter.cpp:71
tcStatusReporter::updateStatus
virtual void updateStatus(teStatus aeStatus, const char *apMessage)=0
tcStatusReporter::mcReporters
static std::list< tcStatusReporter * > mcReporters
Definition: StatusReporter.h:68
tcStatusReporter::eeClear
@ eeClear
Definition: StatusReporter.h:45
tcStatusReporter::eeWarning
@ eeWarning
Definition: StatusReporter.h:41
tcStatusReporter::~tcStatusReporter
virtual ~tcStatusReporter()
Definition: StatusReporter.h:24
DisableIndicators
void DisableIndicators(bool abDisable)
Definition: StatusReporter.h:71
UpdateStatus
void UpdateStatus(const char *apFMT,...)
Definition: StatusReporter.cpp:47
tcStatusReporter::eeInfo
@ eeInfo
Definition: StatusReporter.h:47
dump_backtrace
void dump_backtrace(void)
Definition: StatusReporter.cpp:11