genesis-3d_engine/Engine/foundation/jobs/tp/tpjobfuncdesc.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

64 lines
1.4 KiB
Objective-C

#pragma once
//------------------------------------------------------------------------------
/**
@class Jobs::TPJobFuncDesc
A function descriptor for the thread-pool job system.
(C) 2009 Radon Labs GmbH
*/
#include "jobs/base/jobfuncdescbase.h"
#include "jobs/jobfunccontext.h"
//------------------------------------------------------------------------------
namespace Jobs
{
class TPJobFuncDesc : public Base::JobFuncDescBase
{
public:
/// callback function typedef
typedef void (*FuncPtr)(const JobFuncContext& ctx);
/// default constructor
TPJobFuncDesc();
/// constructor
TPJobFuncDesc(FuncPtr funcPtr);
/// get function pointer
FuncPtr GetFunctionPointer() const;
private:
FuncPtr funcPtr;
};
//------------------------------------------------------------------------------
/**
*/
inline
TPJobFuncDesc::TPJobFuncDesc() :
funcPtr(0)
{
// empty
}
//------------------------------------------------------------------------------
/**
*/
inline
TPJobFuncDesc::TPJobFuncDesc(FuncPtr funcPtr_) :
funcPtr(funcPtr_)
{
// empty
}
//------------------------------------------------------------------------------
/**
*/
inline TPJobFuncDesc::FuncPtr
TPJobFuncDesc::GetFunctionPointer() const
{
return this->funcPtr;
}
} // namespace Jobs
//------------------------------------------------------------------------------