NRE_CpuID.hpp
Go to the documentation of this file.
1 
10  #pragma once
11 
12  #ifdef _WIN32
13  #include <limits.h>
14  #include <intrin.h>
15  typedef unsigned __int32 Register;
16  #else
17  #include <stdint.h>
18  typedef uint32_t Register;
19  #endif
20 
21  #include <Utility/String/NRE_String.hpp>
22 
27  namespace NRE {
32  namespace System {
33 
38  class CpuID {
39  private : // Fields
40  Register registers[4];
42  public : // Methods
43  //## Constructor ##//
47  CpuID() = delete;
52  CpuID(unsigned int i);
53 
54  //## Getter ##//
60  Register const& getRegister(unsigned int index) const;
64  const Register* getRegisters() const;
68  std::size_t getRegistersSize() const;
72  Register const& getEax() const;
76  Register const& getEbx() const;
80  Register const& getEcx() const;
84  Register const& getEdx() const;
85 
86  //## Access Operator ##//
92  Register const& operator [](unsigned int index) const;
93 
94  //## Stream Operator ##//
99  Utility::String toString() const;
100  };
101 
108  std::ostream& operator <<(std::ostream& stream, CpuID const& o);
109  }
110  }
111 
112  #include "NRE_CpuID.tpp"
Register const & getEax() const
Register const & getEcx() const
Register const & getRegister(unsigned int index) const
Utility::String toString() const
Definition: NRE_CpuID.cpp:25
Register const & getEdx() const
System&#39;s API.
The NearlyRealEngine&#39;s global namespace.
Register const & operator[](unsigned int index) const
std::size_t getRegistersSize() const
Allow access to the cpuid intrinsic command for all system.
Definition: NRE_CpuID.hpp:38
const Register * getRegisters() const
Register const & getEbx() const