genesis-3d_engine/Engine/foundation/jobs/tp/tpjobport.h
zhongdaohuan 6e8fbca745 genesis-3d engine version 1.3.
match the genesis editor version 1.3.0.653.
2014-05-05 14:50:33 +08:00

48 lines
1.2 KiB
Objective-C

#pragma once
//------------------------------------------------------------------------------
/**
@class Jobs::TPJobPort
Thread-pool implementation of JobPort.
(C) 2009 Radon Labs GmbH
*/
#include "jobs/base/jobportbase.h"
//------------------------------------------------------------------------------
namespace Jobs
{
class TPJobPort : public Base::JobPortBase
{
__DeclareClass(TPJobPort);
public:
/// constructor
TPJobPort();
/// destructor
virtual ~TPJobPort();
/// discard the job port
void Discard();
/// push a job for execution
void PushJob(const GPtr<Job>& job);
/// push a job chain, each job in the chain depends on previous job
void PushJobChain(const Util::Array<GPtr<Jobs::Job> >& jobs);
/// push a flush command (no effect in thread-pool job system)
void PushFlush();
/// push a sync command
void PushSync();
/// wait for completion
void WaitDone();
/// check for completion, return immediately
bool CheckDone();
private:
GPtr<Job> lastPushedJob; // pointer to last pushed job
};
} // namespace Jobs
//------------------------------------------------------------------------------