Skip to content

Commit

Permalink
Minor tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
cziter15 committed Feb 14, 2025
1 parent c34e610 commit 0300749
Show file tree
Hide file tree
Showing 8 changed files with 26 additions and 3 deletions.
2 changes: 2 additions & 0 deletions src/ksf/ksApplication.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@

namespace ksf
{
ksApplication::~ksApplication() = default;

bool ksApplication::loop()
{
/* This call will keep millis64 on track (handles rollover). */
Expand Down
5 changes: 5 additions & 0 deletions src/ksf/ksApplication.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ namespace ksf
AppLogCallbackFunc_t appLogCallback; //!< Callback function for logging
#endif
public:

/*!
@brief Instantiates a component of the type defined by the template instance.
This function will pass all template-defined parameters to the component constructor.
Expand Down Expand Up @@ -142,5 +143,9 @@ namespace ksf
*/
void setLogCallback(AppLogCallbackFunc_t logCallback);
#endif
/*!
@brief Destructs application.
*/
virtual ~ksApplication();
};
}
2 changes: 2 additions & 0 deletions src/ksf/ksComponent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@

namespace ksf
{
ksComponent::~ksComponent() = default;

bool ksComponent::init(ksApplication* app)
{
return true;
Expand Down
5 changes: 5 additions & 0 deletions src/ksf/ksComponent.h
Original file line number Diff line number Diff line change
Expand Up @@ -77,5 +77,10 @@ namespace ksf
@return True on success, false on fail.
*/
virtual bool postInit(ksApplication* app);

/*!
@brief Virtual destructor to ensure proper cleanup of derived classes
*/
virtual ~ksComponent();
};
}
6 changes: 4 additions & 2 deletions src/ksf/ksRtti.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ namespace ksf
class ksRtti
{
public:
virtual ~ksRtti() = default;

/*!
@brief Retrieves type ID of the object.
@return Object type ID.
Expand All @@ -50,7 +52,7 @@ namespace ksf
TType* as()
{
if (isA(TType::getClassType()))
return (TType*)this;
return static_cast<TType*>(this);

return nullptr;
}
Expand All @@ -64,7 +66,7 @@ namespace ksf
const TType* as() const
{
if (isA(TType::getClassType()))
return (TType*)this;
return static_cast<const TType*>(this);

return nullptr;
}
Expand Down
2 changes: 2 additions & 0 deletions src/ksf/misc/ksSimpleTimer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@

namespace ksf::misc
{
ksSimpleTimer::~ksSimpleTimer() = default;

ksSimpleTimer::ksSimpleTimer(uint32_t intervalMs)
{
setInterval(intervalMs);
Expand Down
5 changes: 5 additions & 0 deletions src/ksf/misc/ksSimpleTimer.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,5 +60,10 @@ namespace ksf::misc
@return True if timer interval just passed, otherwise false.
*/
bool hasTimePassed() const;

/*!
@brief Destructor.
*/
virtual ~ksSimpleTimer();
};
}
2 changes: 1 addition & 1 deletion src/ksf/misc/ksWSServer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ namespace ksf::misc

void ksWSServer::setMessageHandler(ksWsServerMessageFunc_t func)
{
onWebsocketTextMessage = func;
onWebsocketTextMessage = std::move(func);
}

uint64_t ksWSServer::getRequiredAuthToken() const
Expand Down

0 comments on commit 0300749

Please sign in to comment.