IPSDK  4_1_0_2
IPSDK : Image Processing Software Development Kit
CpuDescription.h
1 // CpuDescription.h:
3 // -----------------
4 //
14 
15 #ifndef __IPSDKHARDWARE_CPUDESCRIPTION_H__
16 #define __IPSDKHARDWARE_CPUDESCRIPTION_H__
17 
18 // suppression warnings
19 // warning C4251: 'ipsdk::hard::CpuDescription::_instructionSetColl' : class 'std::set<_Kty>' needs to have dll-interface to be used by clients of class 'ipsdk::hard::CpuDescription'
20 #pragma warning (push)
21 #pragma warning (disable : 4251)
22 
24 #include <IPSDKSerialization/Engine/BaseSerializationObject.h>
26 
27 namespace ipsdk {
28 namespace hard {
29 
32 
34 {
35  // declare serial class
37 
38 public:
42  ~CpuDescription();
44 
45 // methods
46 public:
48  bool isInit() const;
49 
51  void init(const std::string& cpuShortInfoString,
52  const std::string& cpuBrandInfoString,
53  ipUInt32 nbPhysicalCores,
54  bool bSupportHyperThreading,
55  const InstructionSetColl& instructionSetColl,
56  const ipUInt64& totalPhysMem);
57 
60  const std::string& getCpuShortInfoString() const;
61 
64  const std::string& getCpuBrandInfoString() const;
65 
70  ipUInt32 getNbPhysicalCores() const;
71 
76  ipUInt32 getNbLogicalCores() const;
77 
80  bool isHyperThreadingSupported() const;
81 
84  const InstructionSetColl& getInstructionSetColl() const;
85 
88  ipUInt64 getTotalPhysicalMemory() const;
89 
92  bool isAvailable(const eInstructionSet& instructionSet) const;
93 
95  void clear();
96 
97 // attributes
98 protected:
100  std::string _cpuShortInfoString;
101 
103  std::string _cpuBrandInfoString;
104 
107 
110 
113 
116 
118  bool _bInit;
119 };
120 
123 
124 inline bool
126 {
127  return _bInit;
128 }
129 
132 
133 } // end of namespace hard
134 } // end of namespace ipsdk
135 
136 #pragma warning (pop)
137 
138 #endif // __IPSDKHARDWARE_CPUDESCRIPTION_H__
#define IPSDK_DECLARE_SERIAL_WITH_COPY(libraryName, className)
macro enabling serialization on class
Definition: SerializationHdrMacro.h:73
std::set< eInstructionSet > InstructionSetColl
instruction set collection
Definition: InstructionSetTypes.h:77
Main namespace for IPSDK library.
Definition: AlgorithmFunctionEfficiency.h:22
IPSDKCORE_API bool isAvailable(const eInstructionSet &instructionSet)
function allowing to check for instruction set availability on local processor
uint64_t ipUInt64
Base types definition.
Definition: BaseTypes.h:55
bool isInit() const
recovery of object initialization flag
Definition: CpuDescription.h:125
bool _bInit
object initialization flag
Definition: CpuDescription.h:118
ipUInt32 _nbPhysicalCores
number of cores
Definition: CpuDescription.h:106
std::string _cpuBrandInfoString
cpu brand info string
Definition: CpuDescription.h:103
eInstructionSet
Enumerate for processor instruction set description.
Definition: InstructionSetTypes.h:31
Description associated to a cpu resource.
Definition: CpuDescription.h:33
std::string _cpuShortInfoString
cpu short info string
Definition: CpuDescription.h:100
ipUInt64 _totalPhysMem
total physical memory (RAM), in bytes
Definition: CpuDescription.h:115
Predefined types associated to instruction set management.
bool _bSupportHyperThreading
flag indicating whether cpu support hyper-threading technology
Definition: CpuDescription.h:109
#define IPSDKHARDWARE_API
Import/Export macro for library IPSDKHardware.
Definition: IPSDKHardwareExports.h:25
Definition of import/export macro for library.
InstructionSetColl _instructionSetColl
instruction set collection supported by processor
Definition: CpuDescription.h:112
Base class for serializable class.
Definition: BaseSerializationObject.h:33
uint32_t ipUInt32
Base types definition.
Definition: BaseTypes.h:53