Skip to content

Commit

Permalink
Documentation fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
florianbecker committed Oct 5, 2020
1 parent a3a6f0b commit 6d2b424
Show file tree
Hide file tree
Showing 6 changed files with 36 additions and 36 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
18 changes: 9 additions & 9 deletions source/CPU.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 <fb\@vxapps.com> (VX Apps)
*/
class CPU {
Expand Down Expand Up @@ -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; }
Expand Down Expand Up @@ -165,7 +165,7 @@ namespace vx {

private:
/**
* @brief Current asked leaf.
* @brief Currently asked leaf.
*/
std::array<unsigned int, 4> m_currentLeaf = {};

Expand Down
16 changes: 8 additions & 8 deletions source/DoubleExtras.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,23 +48,23 @@ 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,
double _right,
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,
Expand All @@ -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<double, double> doubleSplit( double _value );
}
20 changes: 10 additions & 10 deletions source/Serial.h
Original file line number Diff line number Diff line change
Expand Up @@ -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. */
};

/**
Expand All @@ -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 );
Expand Down Expand Up @@ -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;

Expand All @@ -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; }

Expand All @@ -134,7 +134,7 @@ namespace vx {
bool m_isOpen = false;

/**
* @brief Membber for descriptor.
* @brief Member for descriptor.
*/
int m_descriptor = -1;
};
Expand Down
6 changes: 3 additions & 3 deletions source/Timing.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ namespace vx {

public:
/**
* @brief Default constuctor for Timing.
* @brief Default constructor for Timing.
*/
Timing() = default;

Expand Down Expand Up @@ -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<std::chrono::high_resolution_clock> m_start = {};

/**
* @brief Clock to calculate the cpu time elasped.
* @brief Clock to calculate the elapsed cpu time.
*/
std::clock_t m_cpu = 0;
};
Expand Down
6 changes: 3 additions & 3 deletions source/templates/Timer.h
Original file line number Diff line number Diff line change
Expand Up @@ -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<typename Function>
void setTimeout( Function _function, int _delay ) {
Expand All @@ -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<typename Function>
void setInterval( Function _function, int _interval ) {
Expand All @@ -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; }

Expand Down

0 comments on commit 6d2b424

Please sign in to comment.