F´ Flight Software - C/C++ Documentation  devel
A framework for building embedded system applications to NASA flight quality standards.
SystemResources.hpp
Go to the documentation of this file.
1 // ======================================================================
2 // \title SystemResourcesComponentImpl.hpp
3 // \author Santos F. Fregoso
4 // \brief hpp file for SystemResources component implementation class
5 //
6 // \copyright
7 // Copyright 2021, by the California Institute of Technology.
8 // ALL RIGHTS RESERVED. United States Government Sponsorship
9 // acknowledged.
10 //
11 // ======================================================================
12 
13 #ifndef SystemResources_HPP
14 #define SystemResources_HPP
15 
17 #include "Os/SystemResources.hpp"
18 #include "Os/FileSystem.hpp"
19 
20 namespace Svc {
21 
23  public:
24  // ----------------------------------------------------------------------
25  // Construction, initialization, and destruction
26  // ----------------------------------------------------------------------
27 
30  SystemResources(const char* const compName
31  );
32 
35  void init(const NATIVE_INT_TYPE instance = 0
36  );
37 
40  ~SystemResources(void);
41 
43 
44  PRIVATE :
45 
46  // ----------------------------------------------------------------------
47  // Handler implementations for user-defined typed input ports
48  // ----------------------------------------------------------------------
49 
52  void
53  run_handler(const NATIVE_INT_TYPE portNum,
54  U32 context
55  );
56 
57  private:
58  // ----------------------------------------------------------------------
59  // Command handler implementations
60  // ----------------------------------------------------------------------
61 
64  void ENABLE_cmdHandler(
65  const FwOpcodeType opCode,
66  const U32 cmdSeq,
67  SystemResourceEnabled enable
68  );
69 
72  void VERSION_cmdHandler(const FwOpcodeType opCode,
73  const U32 cmdSeq
74  );
75 
76  private:
77  void Cpu();
78  void Mem();
79  void PhysMem();
80  void Version();
82 
83 
84  static const U32 CPU_COUNT = 16;
86  cpuTlmFunc m_cpu_tlm_functions[CPU_COUNT];
87  U32 m_cpu_count;
89  Os::SystemResources::CpuTicks m_cpu[CPU_COUNT];
90  Os::SystemResources::CpuTicks m_cpu_prev[CPU_COUNT];
91  bool m_enable;
92 };
93 
94 } // end namespace Svc
95 
96 #endif
PlatformIntType NATIVE_INT_TYPE
Definition: BasicTypes.h:51
float F32
32-bit floating point
Definition: BasicTypes.h:45
U32 FwOpcodeType
Definition: FpConfig.h:78
void init()
Object initializer.
Definition: ObjBase.cpp:27
Definition: Time.hpp:9
Auto-generated base for SystemResources component.
void(SystemResourcesComponentBase::* cpuTlmFunc)(F32, Fw::Time)
SystemResources(const char *const compName)