Refactor old code documentation

This commit is contained in:
Wojtek Figat
2024-09-24 18:20:12 +02:00
parent f817448839
commit da203352fd
29 changed files with 424 additions and 1124 deletions

View File

@@ -13,35 +13,44 @@
class IRunnable : public Object
{
public:
// Virtual destructor
virtual ~IRunnable()
{
}
// Initializes the runnable object
// @return True if initialization was successful, otherwise false
/// <summary>
/// Initializes the runnable object.
/// </summary>
/// <returns>True if initialization was successful, otherwise false.</returns>
virtual bool Init()
{
return true;
}
// Runs the runnable object.
// @return The exit code
/// <summary>
/// Executes the runnable object.
/// </summary>
/// <returns>The exit code. Non-zero on error.</returns>
virtual int32 Run() = 0;
// Stops the runnable object. Called when thread is being terminated
/// <summary>
/// Stops the runnable object. Called when thread is being terminated
/// </summary>
virtual void Stop()
{
}
// Exits the runnable object
/// <summary>
/// Exits the runnable object
/// </summary>
virtual void Exit()
{
}
// Called when thread ends work (via Kill or normally)
// @param wasKilled True if thread has been killed
/// <summary>
/// Called when thread ends work (via Kill or normally).
/// </summary>
/// <param name="wasKilled">True if thread has been killed.</param>
virtual void AfterWork(bool wasKilled)
{
}
@@ -53,18 +62,15 @@ public:
class SimpleRunnable : public IRunnable
{
private:
bool _autoDelete;
public:
/// <summary>
/// Working function
/// </summary>
Function<int32()> OnWork;
public:
/// <summary>
/// Init
/// </summary>
@@ -75,7 +81,6 @@ public:
}
public:
// [IRunnable]
String ToString() const override
{