1 #ifndef CommonTools_Utils_MethodInvoker_h 2 #define CommonTools_Utils_MethodInvoker_h 14 #include "oneapi/tbb/concurrent_unordered_map.h" 15 #include "oneapi/tbb/concurrent_queue.h" 30 std::vector<AnyMethodArgument>
ints_;
41 const std::vector<AnyMethodArgument>&
ints = std::vector<AnyMethodArgument>());
76 iOther.needsDestructor_ =
false;
77 iOther.invoker_ =
nullptr;
92 mutable oneapi::tbb::concurrent_queue<edm::ObjectWithDict>
storage_;
128 typedef tbb::concurrent_unordered_map<edm::TypeID, SingleInvokerPtr, edm::TypeIDHasher>
InvokerMap;
160 #endif // CommonTools_Utils_MethodInvoker_h
const SingleInvoker & invoker(const edm::TypeWithDict &) const
const char * name() const
SingleInvoker(const SingleInvoker &)=delete
method::TypeCode retType_
edm::ObjectWithDict invoke(const edm::ObjectWithDict &obj, edm::ObjectWithDict &retstore) const
StorageManager(StorageManager &&iOther)
bool isRefGet_
true if this invoker just pops out a ref and returns (ref.get(), false)
tbb::concurrent_unordered_map< edm::TypeID, SingleInvokerPtr, edm::TypeIDHasher > InvokerMap
bool storageNeedsDestructor_
double retToDouble(const edm::ObjectWithDict &) const
convert the output of invoke to a double, if possible
std::string methodName() const
MethodInvoker(const edm::FunctionWithDict &method, const std::vector< AnyMethodArgument > &ints=std::vector< AnyMethodArgument >())
edm::MemberWithDict member_
edm::ObjectWithDict createStorage(bool &needsDestructor) const
void returnStorage(edm::ObjectWithDict &&) const
edm::ObjectWithDict object_
std::vector< AnyMethodArgument > ints_
Keeps different SingleInvokers for each dynamic type of the objects passed to invoke() ...
std::shared_ptr< SingleInvoker > SingleInvokerPtr
edm::FunctionWithDict const method() const
size_t operator()(TypeID const &tid) const
edm::FunctionWithDict method_
oneapi::tbb::concurrent_queue< edm::ObjectWithDict > storage_
edm::TypeWithDict retTypeFinal_
edm::ObjectWithDict invoke(const edm::ObjectWithDict &o, std::vector< StorageManager > &v) const
MethodInvoker & operator=(const MethodInvoker &)
StorageManager & operator=(const StorageManager &)=delete
std::pair< edm::ObjectWithDict, bool > invoke(const edm::ObjectWithDict &o, std::vector< StorageManager > &v) const
SingleInvoker const * invoker_
double invokeLast(const edm::ObjectWithDict &o, std::vector< StorageManager > &v) const
invoke and coerce result to double
edm::ObjectWithDict borrowStorage() const
std::vector< void * > args_
std::string returnTypeName() const
std::vector< AnyMethodArgument > argsBeforeFixups_
edm::MemberWithDict const member() const
std::vector< MethodInvoker > invokers_
StorageManager(edm::ObjectWithDict const &iObj, SingleInvoker const *iInvoker, bool iNeedsDestructor_)
void throwFailedConversion(const edm::ObjectWithDict &) const
ROOT::VecOps::RVec< int > ints
LazyInvoker(const std::string &name, const std::vector< AnyMethodArgument > &args)
SingleInvoker & operator=(const SingleInvoker &)=delete