1/*
2 * Copyright (c) 2008-2015, NVIDIA CORPORATION. All rights reserved.
3 *
4 * NVIDIA CORPORATION and its licensors retain all intellectual property
5 * and proprietary rights in and to this software, related documentation
6 * and any modifications thereto. Any use, reproduction, disclosure or
7 * distribution of this software and related documentation without an express
8 * license agreement from NVIDIA CORPORATION is strictly prohibited.
9 */
10// Copyright (c) 2004-2008 AGEIA Technologies, Inc. All rights reserved.
11// Copyright (c) 2001-2004 NovodeX AG. All rights reserved.
12
13
14#ifndef PX_PHYSICS_EXTENSIONS_DEFAULT_CPU_DISPATCHER_H
15#define PX_PHYSICS_EXTENSIONS_DEFAULT_CPU_DISPATCHER_H
16/** \addtogroup extensions
17 @{
18*/
19
20#include "common/PxPhysXCommonConfig.h"
21#include "pxtask/PxCpuDispatcher.h"
22
23#ifndef PX_DOXYGEN
24namespace physx
25{
26#endif
27
28/**
29\brief A default implementation for a CPU task dispatcher.
30
31@see PxDefaultCpuDispatcherCreate() PxCpuDispatcher
32*/
33class PxDefaultCpuDispatcher: public physx::PxCpuDispatcher
34{
35public:
36 /**
37 \brief Deletes the dispatcher.
38
39 Do not keep a reference to the deleted instance.
40
41 @see PxDefaultCpuDispatcherCreate()
42 */
43 virtual void release() = 0;
44
45 /**
46 \brief Enables profiling at task level.
47
48 \note By default enabled only in profiling builds.
49
50 \param[in] runProfiled True if tasks should be profiled.
51 */
52 virtual void setRunProfiled(bool runProfiled) = 0;
53
54 /**
55 \brief Checks if profiling is enabled at task level.
56
57 \return True if tasks should be profiled.
58 */
59 virtual bool getRunProfiled() const = 0;
60};
61
62
63/**
64\brief Create default dispatcher, extensions SDK needs to be initialized first.
65
66\param[in] numThreads Number of worker threads the dispatcher should use.
67\param[in] affinityMasks Array with affinity mask for each thread. If not defined, default masks will be used.
68
69\note numThreads may be zero in which case no worker thread are initialized and
70simulation tasks will be executed on the thread that calls PxScene::simulate()
71
72@see PxDefaultCpuDispatcher
73*/
74PxDefaultCpuDispatcher* PxDefaultCpuDispatcherCreate(PxU32 numThreads, PxU32* affinityMasks = NULL);
75
76#ifndef PX_DOXYGEN
77} // namespace physx
78#endif
79
80/** @} */
81#endif
82