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/SystemResources.hpp
"
18
#include "
Os/FileSystem.hpp
"
19
20
namespace
Svc
{
21
22
class
SystemResources
:
public
SystemResourcesComponentBase
{
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
42
typedef
void (
SystemResourcesComponentBase
::*
cpuTlmFunc
)(
F32
,
Fw::Time
);
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
();
81
F32
compCpuUtil(
Os::SystemResources::CpuTicks
current,
Os::SystemResources::CpuTicks
previous);
82
83
84
static
const
U32 CPU_COUNT = 16;
86
cpuTlmFunc
m_cpu_tlm_functions[CPU_COUNT];
87
U32 m_cpu_count;
88
Os::SystemResources::MemUtil
m_mem;
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
NATIVE_INT_TYPE
PlatformIntType NATIVE_INT_TYPE
Definition:
BasicTypes.h:51
F32
float F32
32-bit floating point
Definition:
BasicTypes.h:45
FileSystem.hpp
FwOpcodeType
U32 FwOpcodeType
Definition:
FpConfig.h:78
SystemResources.hpp
SystemResourcesComponentAc.hpp
Fw::ObjBase::init
void init()
Object initializer.
Definition:
ObjBase.cpp:27
Fw::Time
Definition:
Time.hpp:9
Svc::SystemResourceEnabled
Definition:
SystemResourceEnabledEnumAc.hpp:18
Svc::SystemResourcesComponentBase
Auto-generated base for SystemResources component.
Definition:
SystemResourcesComponentAc.hpp:36
Svc::SystemResources
Definition:
SystemResources.hpp:22
Svc::SystemResources::cpuTlmFunc
void(SystemResourcesComponentBase::* cpuTlmFunc)(F32, Fw::Time)
Definition:
SystemResources.hpp:42
Svc::SystemResources::SystemResources
SystemResources(const char *const compName)
Definition:
SystemResources.cpp:24
Svc::SystemResources::~SystemResources
~SystemResources(void)
Definition:
SystemResources.cpp:65
Svc::Version
Definition:
Version.hpp:14
Svc
Definition:
ActiveRateGroupCfg.hpp:18
Os::SystemResources::CpuTicks
Definition:
SystemResources.hpp:25
Os::SystemResources::MemUtil
Definition:
SystemResources.hpp:30
Svc
SystemResources
SystemResources.hpp
Generated by
1.9.1