public:
// section for "temporary" structures {{{
+ /// Temporary struct used internally by ThreadPool
struct TPFnDataStructZero {
std::array<std::size_t, 2> range;
Manager *manager;
const BitsetType *signature;
void *userData;
};
+ /// Temporary struct used internally by ThreadPool
template <typename Function>
struct TPFnDataStructOne {
std::array<std::size_t, 2> range;
void *userData;
Function *fn;
};
+ /// Temporary struct used internally by ThreadPool
struct TPFnDataStructTwo {
std::array<std::size_t, 2> range;
Manager *manager;
void *userData;
const std::vector<std::size_t> *matching;
};
+ /// Temporary struct used internally by ThreadPool
struct TPFnDataStructThree {
std::array<std::size_t, 2> range;
Manager *manager;
EntitiesType *entities;
std::mutex *mutex;
};
+ /// Temporary struct used internally by ThreadPool
struct TPFnDataStructFour {
std::array<std::size_t, 2> range;
Manager *manager;
BitsetType *signatures;
std::mutex *mutex;
};
+ /// Temporary struct used internally by ThreadPool
struct TPFnDataStructFive {
std::array<std::size_t, 2> range;
std::size_t index;
std::vector<std::vector<std::size_t> >*
multiMatchingEntities;
};
+ /// Temporary struct used internally by ThreadPool
struct TPFnDataStructSix {
std::array<std::size_t, 2> range;
Manager *manager;
BitsetType *bitsets;
std::mutex *mutex;
};
+ /// Temporary struct used internally by ThreadPool
template <typename Iterable>
struct TPFnDataStructSeven {
std::array<std::size_t, 2> range;
// Lambda function contents here
},
&c, // "Context" object passed to the function
- 4 // four threads
+ true // enable use of internal ThreadPool
);
\endcode
Note, the ID given to the function is not permanent. An entity's ID
manager.forMatchingSignaturePtr<TypeList<C0, C1, T0>>(
&function, // ptr
&c, // "Context" object passed to the function
- 4 // four threads
+ true // enable use of ThreadPool
);
\endcode
Note, the ID given to the function is not permanent. An entity's ID
// call all stored functions
manager.callForMatchingFunctions();
- // call all stored functions with 4 threads
- manager.callForMatchingFunctions(4);
+ // call all stored functions with ThreadPool enabled
+ manager.callForMatchingFunctions(true);
// remove all stored functions
manager.clearForMatchingFunctions();
// call the previously added function
manager.callForMatchingFunction(id);
- // call the previously added function with 4 threads
- manager.callForMatchingFunction(id, 4);
+ // call the previously added function with ThreadPool enabled
+ manager.callForMatchingFunction(id, true);
\endcode
\return False if a function with the given id does not exist.