Skip to content

Commit

Permalink
refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
ozguronsoy committed Dec 9, 2024
1 parent a5ade9e commit d8ce76f
Show file tree
Hide file tree
Showing 4 changed files with 86 additions and 6 deletions.
2 changes: 1 addition & 1 deletion HephCommon/HeaderFiles/Complex.h
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ namespace Heph

constexpr bool operator!=(const Complex& rhs) const
{
return this->real != rhs.real || this->imag != rhs.imag;
return !((*this) == rhs);
}

/**
Expand Down
83 changes: 81 additions & 2 deletions HephCommon/HeaderFiles/ConsoleLogger.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ namespace Heph
{
/**
* @brief class for printing formatted messages to the console.
* @note this class cannot be instantiated.
* @note this is a static class and cannot be instantiated.
*/
class HEPH_API ConsoleLogger final
{
Expand All @@ -34,26 +34,105 @@ namespace Heph
/**
* prints the provided message to the console.
*
* @param message message that will be printed.
* @param logLevel one of the <b>HEPH_CL_*</b> macros.
*
*/
static void Log(const std::string& message, const char* logLevel);

/**
* prints the provided message to the console.
*
* @param logLevel one of the <b>HEPH_CL_*</b> macros.
* @param message message that will be printed.
* @param logLevel one of the <b>HEPH_CL_*</b> macros.
* @param libName name of the library thats printing. The default value is "HephLibs".
*
*/
static void Log(const std::string& message, const char* logLevel, const std::string& libName);

/**
* prints the provided message to the console as INFO.
*
* @param message message that will be printed.
*
*/
static void LogInfo(const std::string& message);

/**
* prints the provided message to the console as INFO.
*
* @param message message that will be printed.
* @param libName name of the library thats printing. The default value is "HephLibs".
*
*/
static void LogInfo(const std::string& message, const std::string& libName);

/**
* prints the provided message to the console as WARNING.
*
* @param message message that will be printed.
*
*/
static void LogWarning(const std::string& message);

/**
* prints the provided message to the console as WARNING.
*
* @param message message that will be printed.
* @param libName name of the library thats printing. The default value is "HephLibs".
*
*/
static void LogWarning(const std::string& message, const std::string& libName);

/**
* prints the provided message to the console as ERROR.
*
* @param message message that will be printed.
*
*/
static void LogError(const std::string& message);

/**
* prints the provided message to the console as ERROR.
*
* @param message message that will be printed.
* @param libName name of the library thats printing. The default value is "HephLibs".
*
*/
static void LogError(const std::string& message, const std::string& libName);

/**
* prints the provided message to the console as SUCCESS.
*
* @param message message that will be printed.
*
*/
static void LogSuccess(const std::string& message);

/**
* prints the provided message to the console as SUCCESS.
*
* @param message message that will be printed.
* @param libName name of the library thats printing. The default value is "HephLibs".
*
*/
static void LogSuccess(const std::string& message, const std::string& libName);

/**
* prints the provided message to the console as DEBUG.
*
* @param message message that will be printed.
*
*/
static void LogDebug(const std::string& message);

/**
* prints the provided message to the console as DEBUG.
*
* @param message message that will be printed.
* @param libName name of the library thats printing. The default value is "HephLibs".
*
*/
static void LogDebug(const std::string& message, const std::string& libName);

/**
Expand Down
4 changes: 2 additions & 2 deletions HephCommon/HeaderFiles/Stopwatch.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
* gets the elapsed time since the last reset of the thread local Stopwatch instance in seconds.
*
*/
#define HEPH_SW_DT_S Heph::Stopwatch::GetInstance().DeltaTime()
#define HEPH_SW_DT_S HEPH_SW_DT

/**
* gets the elapsed time since the last reset of the thread local Stopwatch instance in milliseconds.
Expand Down Expand Up @@ -75,7 +75,7 @@ namespace Heph
/**
* gets the elapsed time since the last reset.
*
* @param prefix the desired metric prefix.
* @param prefix the metric prefix of the time unit.
*/
double DeltaTime(double prefix) const;

Expand Down
3 changes: 2 additions & 1 deletion HephCommon/HeaderFiles/UserEventArgs.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ namespace Heph
/**
* @brief class for passing custom data to the event handlers as key/value pairs.
*
* @important This class only stores the pointers to the arguments. So it's your responsibility to ensure that the arguments still exist when handling the events.
* @important This class only stores the pointers to the arguments.
* Thus you have to ensure that the arguments still exist when handling the events.
*
*/
class HEPH_API UserEventArgs final
Expand Down

0 comments on commit d8ce76f

Please sign in to comment.