BioDynaMo
v1.05.120-25dc9790
|
Go to the documentation of this file.
15 #ifndef CORE_OPERATION_OPERATION_REGISTRY_H_
16 #define CORE_OPERATION_OPERATION_REGISTRY_H_
20 #include <unordered_map>
64 #define BDM_REGISTER_OP(op, name, target) \
65 bool op::registered_ = OperationRegistry::GetInstance()->AddOperationImpl( \
66 name, OpComputeTarget::target, new op());
71 #define BDM_REGISTER_OP_WITH_FREQ(op, name, target, frequency) \
72 bool op::registered_ = OperationRegistry::GetInstance()->AddOperationImpl( \
73 name, OpComputeTarget::target, new op(), frequency);
78 #define BDM_REGISTER_TEMPLATE_OP(op, T, name, target) \
80 bool op<T>::registered_ = \
81 OperationRegistry::GetInstance()->AddOperationImpl( \
82 name, OpComputeTarget::target, new op<T>());
91 #define BDM_OP_HEADER(class_name) \
93 static bool registered_; \
96 class_name *Clone() override { return new class_name(*this); }
100 #endif // CORE_OPERATION_OPERATION_REGISTRY_H_
Operation * GetOperation(const std::string &op_name)
bool AddOperationImpl(const std::string &op_name, OpComputeTarget target, OperationImpl *impl, uint32_t frequency=1)
static OperationRegistry * GetInstance()
Singleton class - returns the static instance.
Operation * NewOperation(const std::string &name)
A convenient function to get a new operation from the registry by its name.
std::unordered_map< std::string, Operation * > operations_
The map containing the operations; accessible by their name.