-
Notifications
You must be signed in to change notification settings - Fork 18
Expand file tree
/
Copy pathGenericFunctionNode.h
More file actions
36 lines (28 loc) · 1.01 KB
/
GenericFunctionNode.h
File metadata and controls
36 lines (28 loc) · 1.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
/**
* @file GenericFunctionNode.h
*
* @ingroup Simulator/Core/FunctionNodes
*
* @brief Stores a function to invoke. Used by operation manager to store functions to defined by an operation type.
*
*/
#pragma once
#include "IFunctionNode.h"
#include <functional>
using namespace std;
class GenericFunctionNode : public IFunctionNode {
public:
/// Constructor, Function Signature: void ()
GenericFunctionNode(const Operations &operationType, const std::function<void()> &function);
/// Destructor
~GenericFunctionNode() = default;
/// Invokes the stored function if the sent operation type matches the operation type the function is stored as.
virtual bool invokeFunction(const Operations &operation) const override;
/// TODO: Remove when IFunctionNode supports functions with non-empty signatures
virtual bool invokeFunction(const Operations &operation, uint64_t arg1, uint64_t arg2) const
{
return false;
}
private:
std::function<void()> function_; ///< Stored function.
};