BioDynaMo
v1.05.120-25dc9790
|
Go to the documentation of this file.
15 #ifndef CORE_OPERATION_OPERATION_H_
16 #define CORE_OPERATION_OPERATION_H_
79 "AgentOperationImpl do not support this function operator");
89 "StandaloneOperationImpl do not support this function operator");
104 explicit Operation(
const std::string &name);
111 Operation(
const std::string &name, uint32_t frequency);
137 template <
typename T>
139 T *implementation =
nullptr;
142 if (
dynamic_cast<T *
>(imp)) {
143 implementation =
dynamic_cast<T *
>(imp);
146 return implementation;
179 if (filter ==
nullptr) {
210 #endif // CORE_OPERATION_OPERATION_H_
bool IsExcluded(Functor< bool, Agent * > *filter)
void operator()(Agent *agent) override
virtual bool IsStandalone()=0
Returns whether or not this operations is a stand-alone operation.
std::string OpComputeTargetString(OpComputeTarget t)
std::set< Functor< bool, Agent * > * > exclude_filters_
If this is an agent operation don't run it for this list of filters.
bool IsStandalone() override
Returns whether or not this operations is a stand-alone operation.
void SetUp()
Forwards call to implementation's Setup function.
Operation(const std::string &name)
virtual OperationImpl * Clone()=0
std::vector< OperationImpl * > implementations_
The different operation implementations for each supported compute target.
T * GetImplementation()
Returns the implementation corresponding to the template argument.
Contains code required by all agents.
std::string name_
Operation name / unique identifier.
Interface for implementing an operation.
bool IsStandalone() override
Returns whether or not this operations is a stand-alone operation.
bool IsGpuOperation() const
Returns whether or not this operation is supposed to run on a GPU.
void TearDown()
Forwards call to implementation's TearDown function.
static void Fatal(const std::string &location, const Args &... parts)
Prints fatal error message.
virtual void operator()()=0
bool IsComputeTargetSupported(OpComputeTarget target)
Interface for implementing an operation that should run on a GPU.
void SetExcludeFilters(const std::set< Functor< bool, Agent * > * > &exclude_filters)
OpComputeTarget target_
The target that this operation implementation is supposed to run on.
void SelectComputeTarget(OpComputeTarget target)
OpComputeTarget active_target_
The compute target that this operation will be executed on.
void operator()() override
virtual ~OperationImpl()=default
void AddOperationImpl(OpComputeTarget target, OperationImpl *impl)