diff --git a/README.md b/README.md index 6b8e2e1..19f0268 100644 --- a/README.md +++ b/README.md @@ -10,16 +10,16 @@ make -j`nproc` ``` ## Classes -- **CPU** - Get CPU informations. +- **CPU** - Get CPU information. - **DoubleExtras** - Less, Greater, Equal, Between, Round, Split. - **Exec** - Run command and return stdout or mixed (stdout and stderr) and result code. - **KeyState** - Check for caps lock state. - **Serial** - Serial communication class. - **StringExtras** - LeftTrim, RightTrim, Trim. -- **Timing** - Measering time, cpu and real time. +- **Timing** - Measuring time, cpu and real time. ## Template classes -- **CSVWriter** - Write out comma seperated values. +- **CSVWriter** - Write out comma-separated values. - **Timer** - Timeout thread on time or interval. ## Unixservice class diff --git a/source/CPU.h b/source/CPU.h index 16fac09..9c17655 100644 --- a/source/CPU.h +++ b/source/CPU.h @@ -39,7 +39,7 @@ namespace vx { /** - * @brief The CPU class for receiving information about the CPU. + * @brief The CPU class to receive information about the CPU. * @author Florian Becker (VX Apps) */ class CPU { @@ -90,43 +90,43 @@ namespace vx { inline unsigned int extendedFamily() const { return ( m_leaf[0] >> 20 ) & 0xFF; } /** - * @brief Does cpu supports smx? + * @brief Does cpu support smx? * @return True, if the cpu supports smx - otherwise false. */ inline bool smxSupport() const { return ( m_leaf[2] >> 6 ) & 1; } /** - * @brief Does cpu supports sgx? + * @brief Does cpu support sgx? * @return True, if the cpu supports sgx - otherwise false. */ inline bool sgxSupport() const { return ( m_extendedLeaf[1] >> 2 ) & 0x1; } /** - * @brief Does cpu supports sgx launch control? + * @brief Does cpu support sgx launch control? * @return True, if the cpu supports sgx launch control - otherwise false. */ inline bool sgxLaunchControlSupport() const { return ( m_extendedLeaf[2] >> 30 ) & 0x01; } /** - * @brief Does cpu supports sgx version 1? + * @brief Does cpu support sgx version 1? * @return True, if the cpu supports sgx version 1 - otherwise false. */ inline bool sgxVersion1Support() const { return m_sgxLeaf[0] & 0x1; } /** - * @brief Does cpu supports sgx version 2? + * @brief Does cpu support sgx version 2? * @return True, if the cpu supports sgx version 2 - otherwise false. */ inline bool sgxVersion2Support() const { return ( m_sgxLeaf[0] >> 1 ) & 0x1; } /** - * @brief Maximum size of enclave. + * @brief Returns maximum size of enclave. * @return Maximum enclave size. */ inline unsigned int maximumEnclaveSize() const { return m_sgxLeaf[2] & 0xFF; } /** - * @brief Maximum size of enclave. + * @brief Returns maximum size of enclave. * @return Maximum enclave size. */ inline unsigned int maximumEnclaveSize64() const { return ( m_sgxLeaf[2] >> 8 ) & 0xFF; } @@ -165,7 +165,7 @@ namespace vx { private: /** - * @brief Current asked leaf. + * @brief Currently asked leaf. */ std::array m_currentLeaf = {}; diff --git a/source/DoubleExtras.h b/source/DoubleExtras.h index 71cf42c..3a0f525 100644 --- a/source/DoubleExtras.h +++ b/source/DoubleExtras.h @@ -48,11 +48,11 @@ namespace vx { double _right ); /** - * @brief Is _left less _right or _orEqual? + * @brief Is _left less than _right or _orEqual? * @param _left The first value. * @param _right The second value. * @param _orEqual Check if _left and _right are equal - default false. - * @return True, if _left less _right or _left and _right are equal and + * @return True, if _left is less than _right or _left and _right are equal and * _orEqual is set to true - otherwise false. */ bool doubleLess( double _left, @@ -60,11 +60,11 @@ namespace vx { bool _orEqual = false ); /** - * @brief Is _left greater _right or _orEqual? + * @brief Is _left greater than _right or _orEqual? * @param _left The first value. * @param _right The second value. * @param _orEqual Check if _left and _right are equal - default false. - * @return True, if _left greater _right or _left and _right are equal and + * @return True, if _left is greater than _right or _left and _right are equal and * _orEqual is set to true - otherwise false. */ bool doubleGreater( double _left, @@ -85,18 +85,18 @@ namespace vx { bool _orEqual = false ); /** - * @brief Round a double _value by _precision. Rounded by default to second places. + * @brief Round a double _value by _precision. Rounded by default to two decimal places. * @param _value Value to round. - * @param _precision Places to round. + * @param _precision Decimal places to round. * @return The rounded value. */ double doubleRound( double _value, std::size_t _precision = 2 ); /** - * @brief Split a double _value to its integral and fraction parts. + * @brief Split a double _value to its integer and decimal places. * @param _value Value to split. - * @return The integral and fraction part. + * @return The integer and decimal places. */ std::pair doubleSplit( double _value ); } diff --git a/source/Serial.h b/source/Serial.h index 9b0c29d..8f671ea 100644 --- a/source/Serial.h +++ b/source/Serial.h @@ -43,10 +43,10 @@ namespace vx { */ enum class Baudrate { - Speed9600 = 9000, /**< Baudrate speed of 9600. */ - Speed19200 = 19200, /**< Baudrate speed of 19200. */ - Speed38400 = 38400, /**< Baudrate speed of 38400. */ - Speed57600 = 57600 /**< Baudrate speed of 57600. */ + Speed9600 = 9000, /**< Baudrate of 9600. */ + Speed19200 = 19200, /**< Baudrate of 19200. */ + Speed38400 = 38400, /**< Baudrate of 38400. */ + Speed57600 = 57600 /**< Baudrate of 57600. */ }; /** @@ -59,7 +59,7 @@ namespace vx { /** * @brief Default constructor for Serial. * @param _path Device path. - * @param _baudrate Baudrate speed. + * @param _baudrate Baudrate. */ explicit Serial( const std::string &_path, Baudrate _baudrate = Baudrate::Speed9600 ); @@ -92,21 +92,21 @@ namespace vx { virtual ~Serial(); /** - * @brief Is the serial device open. + * @brief Is the serial device open? * @return True, if open - otherwise false. */ inline bool isOpen() const { return m_isOpen; } /** * @brief Flush the serial port. - * @return True, if fushing is successded - otherwise false. + * @return True, if fushing is successful - otherwise false. */ bool flush() const; /** * @brief Write data to the serial device. * @param _data Date written to the device. - * @return True, if the data written was successfull - otherwise false. + * @return True, if the data writing was successful - otherwise false. */ bool write( const std::string &_data ) const; @@ -118,7 +118,7 @@ namespace vx { /** * @brief Descriptor of current device. - * @return The descriptor of the serial device - -1 is not valid descriptor. + * @return The descriptor of the serial device - -1 is not a valid descriptor. */ inline int descriptor() const { return m_descriptor; } @@ -134,7 +134,7 @@ namespace vx { bool m_isOpen = false; /** - * @brief Membber for descriptor. + * @brief Member for descriptor. */ int m_descriptor = -1; }; diff --git a/source/Timing.h b/source/Timing.h index 18cf389..85867ec 100644 --- a/source/Timing.h +++ b/source/Timing.h @@ -50,7 +50,7 @@ namespace vx { public: /** - * @brief Default constuctor for Timing. + * @brief Default constructor for Timing. */ Timing() = default; @@ -83,12 +83,12 @@ namespace vx { std::string m_action = {}; /** - * @brief Clock to calculate system time elapsed. + * @brief Clock to calculate the elapsed system time. */ std::chrono::time_point m_start = {}; /** - * @brief Clock to calculate the cpu time elasped. + * @brief Clock to calculate the elapsed cpu time. */ std::clock_t m_cpu = 0; }; diff --git a/source/templates/Timer.h b/source/templates/Timer.h index b72d9ee..432c7b6 100644 --- a/source/templates/Timer.h +++ b/source/templates/Timer.h @@ -49,7 +49,7 @@ namespace vx { /** * @brief Call a function after timeout. * @param _function Call back function. - * @param _delay Delay after the function is valled in milliseconds. + * @param _delay Delay in milliseconds after the function is called. */ template void setTimeout( Function _function, int _delay ) { @@ -74,7 +74,7 @@ namespace vx { /** * @brief Call a function after interval. * @param _function Call back function. - * @param _interval Intervall after the function is called in milliseconds. + * @param _interval Interval in milliseconds after the function is called. */ template void setInterval( Function _function, int _interval ) { @@ -100,7 +100,7 @@ namespace vx { } /** - * @brief Stoping the current timer to not exeecute the call back function. + * @brief Stopping the current timer to not execute the call back function. */ inline void stop() { this->m_clear = true; }