/*---------------------------------------------------------------------------* Project: Horizon File: os_Task.h Copyright (C)2009 Nintendo Co., Ltd. All rights reserved. These coded instructions, statements, and computer programs contain proprietary information of Nintendo of America Inc. and/or Nintendo Company Ltd., and are protected by Federal copyright law. They may not be disclosed to third parties or copied or duplicated in any form, in whole or in part, without the prior written consent of Nintendo. $Rev: 24252 $ *---------------------------------------------------------------------------*/ /*! @file @brief Task に関する API の宣言 このファイル内の記述は将来的に大幅に変更される可能性があります。 直接使わないでください。 @deprecated :include nn/os.h */ #ifndef NN_OS_OS_TASK_H_ #define NN_OS_OS_TASK_H_ #include #include #include #ifdef __cplusplus namespace nn { namespace os { /* @brief タスクを表すクラスです。 :private */ class ITask { public: virtual void Invoke() = 0; virtual ~ITask() {} }; /* @brief キューイングできるタスククラスです。 :private */ class QueueableTask : public nn::fnd::IntrusiveQueue::Item, public ITask { public: /* @brief プールスレッドで実行される処理です。 @return 無し。 */ virtual void Invoke() = 0; }; /* @brief キューイングできる同期タスククラスです。 :private */ class QueueableWaitTask : private QueueableTask { public: /*! @brief 同期スレッドで同期待ちを行うオブジェクトです。 @return 無し。 */ virtual nn::os::WaitObject* GetWaitObject() = 0; QueueableTask* AsNonWaitableTask() { return this; } friend class IWaitTaskInvoker; }; class ITaskInvoker { public: virtual void AddTask(QueueableTask* task) = 0; virtual ~ITaskInvoker() {} // TODO: 優先度の設定など }; class IWaitTaskInvoker : public ITaskInvoker { public: virtual void AddWaitTask(QueueableWaitTask* task) = 0; protected: static QueueableWaitTask* GetWaitTaskPointer(QueueableTask* p) { return static_cast(p); } }; }} #endif #endif // NN_OS_OS_THREADPOOL_H_