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
16
#include "
Svc/SystemResources/SystemResourcesComponentAc.hpp
"
17
#include "
Os/Cpu.hpp
"
18
#include "
Os/Memory.hpp
"
19
#include "
Os/FileSystem.hpp
"
20
21
namespace
Svc
{
22
23
class
SystemResources
:
public
SystemResourcesComponentBase
{
24
public
:
25
// ----------------------------------------------------------------------
26
// Construction, initialization, and destruction
27
// ----------------------------------------------------------------------
28
31
SystemResources
(
const
char
*
const
compName
32
);
33
36
~SystemResources
(
void
);
37
38
typedef
void (
SystemResourcesComponentBase
::*
cpuTlmFunc
)(
F32
,
Fw::Time
);
39
40
PRIVATE :
41
42
// ----------------------------------------------------------------------
43
// Handler implementations for user-defined typed input ports
44
// ----------------------------------------------------------------------
45
48
void
49
run_handler(
const
NATIVE_INT_TYPE
portNum,
50
U32 context
51
);
52
53
private
:
54
// ----------------------------------------------------------------------
55
// Command handler implementations
56
// ----------------------------------------------------------------------
57
60
void
ENABLE_cmdHandler(
61
const
FwOpcodeType
opCode,
62
const
U32 cmdSeq,
63
SystemResourceEnabled
enable
64
);
65
66
67
private
:
68
void
Cpu();
69
void
Mem();
70
void
PhysMem();
71
F32
compCpuUtil(
Os::Cpu::Ticks
current,
Os::Cpu::Ticks
previous);
72
73
74
static
const
U32 CPU_COUNT = 16;
76
cpuTlmFunc
m_cpu_tlm_functions[CPU_COUNT];
77
FwSizeType
m_cpu_count;
78
Os::Memory::Usage
m_mem;
79
Os::Cpu::Ticks
m_cpu[CPU_COUNT];
80
Os::Cpu::Ticks
m_cpu_prev[CPU_COUNT];
81
bool
m_enable;
82
};
83
84
}
// end namespace Svc
85
86
#endif
NATIVE_INT_TYPE
PlatformIntType NATIVE_INT_TYPE
Definition:
BasicTypes.h:55
F32
float F32
32-bit floating point
Definition:
BasicTypes.h:49
Cpu.hpp
FileSystem.hpp
FwOpcodeType
U32 FwOpcodeType
Definition:
FpConfig.h:91
FwSizeType
PlatformSizeType FwSizeType
Definition:
FpConfig.h:35
Memory.hpp
SystemResourcesComponentAc.hpp
Fw::Time
Definition:
Time.hpp:9
Svc::SystemResourceEnabled
Definition:
SystemResourceEnabledEnumAc.hpp:18
Svc::SystemResourcesComponentBase
Auto-generated base for SystemResources component.
Definition:
SystemResourcesComponentAc.hpp:35
Svc::SystemResources
Definition:
SystemResources.hpp:23
Svc::SystemResources::cpuTlmFunc
void(SystemResourcesComponentBase::* cpuTlmFunc)(F32, Fw::Time)
Definition:
SystemResources.hpp:38
Svc::SystemResources::SystemResources
SystemResources(const char *const compName)
Definition:
SystemResources.cpp:23
Svc::SystemResources::~SystemResources
~SystemResources(void)
Definition:
SystemResources.cpp:60
Svc
Definition:
ActiveRateGroupCfg.hpp:18
Os::Generic::UsedTotal
Generic used/total struct.
Definition:
Os.hpp:31
Svc
SystemResources
SystemResources.hpp
Generated by
1.9.1