
#ifndef __WFX_KERNEL_TASK_H__
#define __WFX_KERNEL_TASK_H__

#include <WFX/WFXIncludes.h>

namespace WFX {

    namespace kernel {

        /**
         * this interface defines a task to be performed by the system kernel
         * each loop the update-function is called by the kernel
         */
        class Task  {
            public:
                /** indicates whether this task is stop()able */
                bool Killable;
                /** this tasks priority */
                Long Priority;

                /**
                 * Ctor
                 */
                Task() {
                    Killable = false;
                    Priority = 5000;
                }
                Task(Long prio) {
                    Killable = false;
                    Priority = prio;
                }
                virtual ~Task() {
                    LOG("TASK::destroy");
                }
                
                /**
                 * init function - called once at the beginning of this tasks lifetime
                 */
                virtual bool start()=0;
                /**
                 * stop function - called once at the end of this tasks lifetime
                 */
                virtual void stop()=0;
                /**
                 * update function. called each frame
                 */
                virtual void update()=0;
                /**
                 * pause function. called to suspend this task
                 */
                virtual void pause(){};
                /**
                 * resume function. called to unseuspoend this task
                 */
                virtual void resume(){};

        };

    }

}


#endif //include guard


