gwnavgeneration/generator/iparallelforinterface.h Source File

iparallelforinterface.h
Go to the documentation of this file.
1 /*
2 * Copyright 2015 Autodesk, Inc. All rights reserved.
3 * Use of this software is subject to the terms of the Autodesk license agreement and any attachments or Appendices thereto provided at the time of installation or download,
4 * or which otherwise accompanies this software in either electronic or hard copy form, or which is signed by you and accepted by Autodesk.
5 */
6 
7 
8 // primary contact: GUAL - secondary contact: NOBODY
9 #ifndef GwNavGen_IParallelForInterface_H
10 #define GwNavGen_IParallelForInterface_H
11 
12 
15 
16 
17 namespace Kaim
18 {
19 
26 class IParallelElementFunctor : public NewOverrideBase<MemStat_NavDataGen>
27 {
28 public:
29  virtual ~IParallelElementFunctor() {}
30 
32  virtual void Do(void* element) = 0;
33 };
34 
35 
42 class IParallelForInterface : public RefCountBaseV<IParallelForInterface, MemStat_NavDataGen>
43 {
44 public:
45  /* For internal use only. */
46  class InitObject
47  {
48  public:
49  InitObject(IParallelForInterface* parallelFor) : m_parallelFor(parallelFor) { if (m_parallelFor) m_parallelFor->Init(); }
50  ~InitObject() { if (m_parallelFor) m_parallelFor->Terminate(); }
51  IParallelForInterface* m_parallelFor;
52  };
53 
54 public:
55  virtual ~IParallelForInterface() {}
56 
59  virtual KyResult Init() = 0;
60 
63  virtual KyResult Terminate() = 0;
64 
74  virtual KyResult ParallelFor(void** elements, KyUInt32 elementsCount, Kaim::IParallelElementFunctor* functor) = 0;
75 };
76 
77 
78 }
79 
80 
81 #endif
Provides an abstract base interface for an object that can treat computational jobs in parallel...
Definition: iparallelforinterface.h:43
KyInt32 KyResult
Defines a type that can be returned by methods or functions in the Gameware Navigation SDK to indicat...
Definition: types.h:254
virtual KyResult Init()=0
This method is expected to perform whatever steps are needed to initialize the parallelization mechan...
Provides an abstract base interface for an object that treats an element of data that can be passed t...
Definition: iparallelforinterface.h:26
virtual KyResult ParallelFor(void **elements, KyUInt32 elementsCount, Kaim::IParallelElementFunctor *functor)=0
This is the main method of the IParallelForInterface: it is called by Gameware Navigation to manage t...
virtual void Do(void *element)=0
This method is carries out whatever processing needs to be done for the specified data element...
Definition: gamekitcrowddispersion.h:20
virtual KyResult Terminate()=0
This method is expected to perform whatever steps are needed to shut down the parallelization mechani...
unsigned int KyUInt32
Type used internally to represent an unsigned 32-bit integer.
Definition: types.h:36