Inheritance diagram for nrEngine::ITask:
Public Member Functions | |
virtual | ~ITask () |
bool | operator< (const ITask &t) |
bool | operator== (const ITask &t) |
bool | operator<= (const ITask &t) |
bool | operator> (const ITask &t) |
bool | operator>= (const ITask &t) |
bool | operator!= (const ITask &t) |
virtual Result | updateTask ()=0 |
virtual Result | stopTask () |
virtual Result | onStartTask () |
virtual Result | onAddTask () |
virtual Result | onResumeTask () |
virtual Result | onSuspendTask () |
const char * | getTaskName () |
NR_FORCEINLINE TaskOrder | getTaskOrder () const |
NR_FORCEINLINE TaskId | getTaskID () const |
NR_FORCEINLINE TaskType | getTaskType () const |
NR_FORCEINLINE TaskState | getTaskState () const |
NR_FORCEINLINE TaskProperty | getTaskProperty () const |
Result | addTaskDependency (SharedPtr< ITask > task) |
Result | addTaskDependency (TaskId id) |
Result | addTaskDependency (const std::string &name) |
Protected Member Functions | |
void | setTaskName (const std::string &name) |
Setup the name of the task. | |
ITask () | |
ITask (const std::string &name) | |
Friends | |
class | Kernel |
Kernel should have the full access to the task data. So kernel is our friend. | |
class | Engine |
Engine should also get full access to running tasks, to allow setting up system tasks. |
Definition at line 192 of file ITask.h.
nrEngine::ITask::~ITask | ( | ) | [virtual] |
nrEngine::ITask::ITask | ( | ) | [protected] |
nrEngine::ITask::ITask | ( | const std::string & | name | ) | [protected] |
bool nrEngine::ITask::operator< | ( | const ITask & | t | ) |
One task is smaller than another one if it's order number is smaller
Definition at line 52 of file ITask.cpp.
References _taskOrder.
bool nrEngine::ITask::operator== | ( | const ITask & | t | ) |
Two tasks are the same if their order number are equal or they are the same objects
Definition at line 57 of file ITask.cpp.
References _taskOrder.
virtual Result nrEngine::ITask::updateTask | ( | ) | [pure virtual] |
In each cycle of our game loop this method will be called if task was added to our kernel.
Implemented in nrEngine::Clock, nrEngine::EventManager, nrEngine::IScript, and nrEngine::EmptyTask.
virtual Result nrEngine::ITask::stopTask | ( | ) | [virtual] |
Stop the task before task will be killed. Each derived object should release used memory here or in the destructor.
Reimplemented in nrEngine::Clock.
Definition at line 225 of file ITask.h.
References nrEngine::OK.
virtual Result nrEngine::ITask::onStartTask | ( | ) | [virtual] |
This method will be called by the kernel as soon as the task is prepared to run. So it will be started and in the next cycle it will be updated.
Reimplemented in nrEngine::Clock, and nrEngine::IScript.
Definition at line 231 of file ITask.h.
References nrEngine::OK.
virtual Result nrEngine::ITask::onAddTask | ( | ) | [virtual] |
This method will be called by kernel when the kernel will try to add this task into the kernel's pipeline. If this method return other value then OK, so the task will not be added into pipeline.
Definition at line 238 of file ITask.h.
References nrEngine::OK.
virtual Result nrEngine::ITask::onResumeTask | ( | ) | [virtual] |
Will be executed on waiking up the task from sleeping.
Definition at line 243 of file ITask.h.
References nrEngine::OK.
virtual Result nrEngine::ITask::onSuspendTask | ( | ) | [virtual] |
Kernel will call this method if task will be aked to go for sleeping.
Definition at line 248 of file ITask.h.
References nrEngine::OK.
const char* nrEngine::ITask::getTaskName | ( | ) |
Task should return his name. Name must not be unique. We will need this to read Log-Files in simple way.
Definition at line 254 of file ITask.h.
Referenced by addTaskDependency().
NR_FORCEINLINE TaskOrder nrEngine::ITask::getTaskOrder | ( | ) | const |
NR_FORCEINLINE TaskId nrEngine::ITask::getTaskID | ( | ) | const |
NR_FORCEINLINE TaskType nrEngine::ITask::getTaskType | ( | ) | const |
NR_FORCEINLINE TaskState nrEngine::ITask::getTaskState | ( | ) | const |
Get the state in which the task is
Definition at line 274 of file ITask.h.
Referenced by nrEngine::IScript::execute().
NR_FORCEINLINE TaskProperty nrEngine::ITask::getTaskProperty | ( | ) | const |
Add a new task on which one this task depends.
task | Smart poitner to the task |
Definition at line 121 of file ITask.cpp.
References getTaskName(), nrEngine::Log::LL_DEBUG, nrEngine::Log::LOG_KERNEL, and nrEngine::OK.
Referenced by addTaskDependency().
Add a new task on which one this task depends.
id | Unique ID of a task on which one this depends |
Definition at line 136 of file ITask.cpp.
References addTaskDependency(), nrEngine::Kernel::getTaskByID(), nrEngine::KERNEL_NO_TASK_FOUND, and nrEngine::Engine::sKernel().
Result nrEngine::ITask::addTaskDependency | ( | const std::string & | name | ) |
Add a new task on which one this task depends.
name | Unique name of a task on which one this depends |
Definition at line 150 of file ITask.cpp.
References addTaskDependency(), nrEngine::Kernel::getTaskByName(), nrEngine::KERNEL_NO_TASK_FOUND, and nrEngine::Engine::sKernel().