Ocean
Loading...
Searching...
No Matches
Performance.h
Go to the documentation of this file.
1
/*
2
* Copyright (c) Meta Platforms, Inc. and affiliates.
3
*
4
* This source code is licensed under the MIT license found in the
5
* LICENSE file in the root directory of this source tree.
6
*/
7
8
#ifndef META_OCEAN_SYSTEM_PERFORMANCE_H
9
#define META_OCEAN_SYSTEM_PERFORMANCE_H
10
11
#include "
ocean/system/System.h
"
12
13
#include "
ocean/base/Singleton.h
"
14
15
namespace
Ocean
16
{
17
18
namespace
System
19
{
20
21
/**
22
* This class implements functionalities concerning the underlying system performance.
23
* @ingroup system
24
*/
25
class
OCEAN_SYSTEM_EXPORT
Performance
:
public
Singleton
<Performance>
26
{
27
friend
class
Singleton
<
Performance
>;
28
29
public
:
30
31
/**
32
* Definition of different system performance levels.
33
*/
34
enum
PerformanceLevel
: uint32_t
35
{
36
/// Performance level for e.g. mobile phones
37
LEVEL_LOW
,
38
/// Performance level for e.g. mobile computers
39
LEVEL_MEDIUM
,
40
/// Performance level for e.g. desktop computers
41
LEVEL_HIGH
,
42
/// Performance level for e.g. workstations
43
LEVEL_VERY_HIGH
,
44
/// Performance level for e.g. high performance workstations
45
LEVEL_ULTRA
46
};
47
48
public
:
49
50
/**
51
* Returns the current performance level.
52
* @return Current selected performance level
53
*/
54
PerformanceLevel
performanceLevel
();
55
56
/**
57
* Sets the current performance level.
58
* @param level New performance level
59
*/
60
void
setPerformanceLevel
(
const
PerformanceLevel
level);
61
62
protected
:
63
64
/**
65
* Creates a new Performance object.<br>
66
* The default medium performance depends on the number of available processor cores.<br>
67
* A system with one processor core has performance value 'medium' as default.<br>
68
* Systems with two processor cores have performance value 'high' as default.<br>
69
* And systems with four or more processor cores have performance value 'ultra' as default.<br>
70
* However the performance value can be changed at any time.
71
*/
72
Performance
();
73
74
protected
:
75
76
/// Current performance level.
77
PerformanceLevel
performanceLevel_ = LEVEL_MEDIUM;
78
};
79
80
}
81
82
}
83
84
#endif
// META_OCEAN_SYSTEM_PERFORMANCE_H
Singleton.h
Ocean::Singleton
This template class is the base class for all singleton objects.
Definition
Singleton.h:71
Ocean::System::Performance
This class implements functionalities concerning the underlying system performance.
Definition
Performance.h:26
Ocean::System::Performance::Performance
Performance()
Creates a new Performance object.
Ocean::System::Performance::PerformanceLevel
PerformanceLevel
Definition of different system performance levels.
Definition
Performance.h:35
Ocean::System::Performance::LEVEL_MEDIUM
@ LEVEL_MEDIUM
Performance level for e.g. mobile computers.
Definition
Performance.h:39
Ocean::System::Performance::LEVEL_VERY_HIGH
@ LEVEL_VERY_HIGH
Performance level for e.g. workstations.
Definition
Performance.h:43
Ocean::System::Performance::LEVEL_HIGH
@ LEVEL_HIGH
Performance level for e.g. desktop computers.
Definition
Performance.h:41
Ocean::System::Performance::LEVEL_LOW
@ LEVEL_LOW
Performance level for e.g. mobile phones.
Definition
Performance.h:37
Ocean::System::Performance::performanceLevel
PerformanceLevel performanceLevel()
Returns the current performance level.
Ocean::System::Performance::setPerformanceLevel
void setPerformanceLevel(const PerformanceLevel level)
Sets the current performance level.
Ocean
The namespace covering the entire Ocean framework.
Definition
Accessor.h:15
System.h
impl
ocean
system
Performance.h
Generated on Sun Mar 9 2025 06:03:32 for Ocean by
1.9.8