diff --git a/src/EC/Manager.hpp b/src/EC/Manager.hpp index ed7077a..650e093 100644 --- a/src/EC/Manager.hpp +++ b/src/EC/Manager.hpp @@ -97,6 +97,7 @@ namespace EC public: // section for "temporary" structures {{{ + /// Temporary struct used internally by ThreadPool struct TPFnDataStructZero { std::array range; Manager *manager; @@ -104,6 +105,7 @@ namespace EC const BitsetType *signature; void *userData; }; + /// Temporary struct used internally by ThreadPool template struct TPFnDataStructOne { std::array range; @@ -113,6 +115,7 @@ namespace EC void *userData; Function *fn; }; + /// Temporary struct used internally by ThreadPool struct TPFnDataStructTwo { std::array range; Manager *manager; @@ -120,6 +123,7 @@ namespace EC void *userData; const std::vector *matching; }; + /// Temporary struct used internally by ThreadPool struct TPFnDataStructThree { std::array range; Manager *manager; @@ -128,6 +132,7 @@ namespace EC EntitiesType *entities; std::mutex *mutex; }; + /// Temporary struct used internally by ThreadPool struct TPFnDataStructFour { std::array range; Manager *manager; @@ -136,6 +141,7 @@ namespace EC BitsetType *signatures; std::mutex *mutex; }; + /// Temporary struct used internally by ThreadPool struct TPFnDataStructFive { std::array range; std::size_t index; @@ -144,6 +150,7 @@ namespace EC std::vector >* multiMatchingEntities; }; + /// Temporary struct used internally by ThreadPool struct TPFnDataStructSix { std::array range; Manager *manager; @@ -152,6 +159,7 @@ namespace EC BitsetType *bitsets; std::mutex *mutex; }; + /// Temporary struct used internally by ThreadPool template struct TPFnDataStructSeven { std::array range; @@ -686,7 +694,7 @@ namespace EC // 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 @@ -808,7 +816,7 @@ namespace EC manager.forMatchingSignaturePtr>( &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 @@ -1147,8 +1155,8 @@ namespace EC // 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(); @@ -1200,8 +1208,8 @@ namespace EC // 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.