TaskStat.h
Go to the documentation of this file.
1 /****
2  * Sming Framework Project - Open Source framework for high efficiency native ESP8266 development.
3  * Created 2015 by Skurydin Alexey
4  * http://github.com/SmingHub/Sming
5  * All files of the Sming Core are provided under the LGPL v3 license.
6  *
7  * TaskStat.h
8  *
9  */
10 
11 #pragma once
12 
13 #include <Print.h>
14 #include <memory>
15 
16 namespace Profiling
17 {
30 class TaskStat
31 {
32 public:
37  TaskStat(Print& out);
38 
40 
48  bool update();
49 
53  void setOutput(Print& out)
54  {
55  this->out = &out;
56  }
57 
58 private:
59  Print* out;
60  static constexpr size_t maxTasks{32};
61  struct Info;
62  std::unique_ptr<Info[]> taskInfo;
63 #ifdef ARCH_ESP32
64  uint8_t startIndex{0};
65  uint8_t endIndex{0};
66 #endif
67 };
68 
69 } // namespace Profiling
Provides formatted output to stream.
Definition: Print.h:37
Helper class to support printing of real-time task information.
Definition: TaskStat.h:31
TaskStat(Print &out)
Constructor.
void setOutput(Print &out)
Change the output stream.
Definition: TaskStat.h:53
bool update()
Update the report.
Definition: CpuUsage.h:5