X-Git-Url: https://git.llucax.com/z.facultad/75.42/plaqui.git/blobdiff_plain/e54fbe1822f4c536eb1f26476e95a8bb53d9511f..a9cb053146d2f1dc73e536ed87597f458deebea3:/Server/src/runnable.h diff --git a/Server/src/runnable.h b/Server/src/runnable.h index 04cb094..39a221f 100644 --- a/Server/src/runnable.h +++ b/Server/src/runnable.h @@ -28,15 +28,41 @@ #ifndef PLAQUI_RUNNABLE_H #define PLAQUI_RUNNABLE_H +#include + namespace Plaqui { /// ealizauna tarea (generalmente en un thread). class Runnable { + private: + // Thread en el cual correr la tarea. + Glib::Thread* thread; + + protected: + + /// Realiza la terea. + virtual void real_run(void) = 0; + public: - /// Realiza la tarea. - virtual void run(void) = 0; + /** + * Destructor. + */ + virtual ~Runnable(void) {} + + /** + * Constructor. + */ + Runnable(void); + + /** + * Comienza la tares. + * + * \param detach Si es true se corre en un thread propio. Si no no + * retorna hasta que finaliza. + */ + virtual void run(bool detach = true); };