-
Notifications
You must be signed in to change notification settings - Fork 22
/
Tool.hpp
83 lines (67 loc) · 1.81 KB
/
Tool.hpp
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
#ifndef AVANGO_TOOLS_TOOL_HPP
#define AVANGO_TOOLS_TOOL_HPP
/**
* \file
* \ingroup av_tools
*/
#include <avango/FieldContainer.h>
#include <avango/tools/TargetHolder.hpp>
#include <avango/tools/windows_specific_tools.hpp>
namespace av
{
namespace tools
{
/**
* Abstract tool base class
*
* \ingroup av_tools
*/
class AV_TOOLS_DLL Tool : public av::FieldContainer
{
AV_FC_DECLARE_ABSTRACT();
public:
/**
* Constructor.
*/
Tool();
protected:
/**
* Destructor made protected to prevent allocation on stack.
*/
virtual ~Tool();
public:
/**
* The tool will operate on the targets defined by this multifield.
*/
MFTargetHolder Targets;
/* virtual */ void evaluate();
protected:
/**
* evaluateTarget is called from evaluate for each target.
*/
virtual void evaluateTarget(TargetHolder& holder);
/**
* evaluateAddedTarget is called from evaluate for each new target.
*/
virtual void evaluateAddedTarget(TargetHolder& holder);
/**
* evaluateKeptTarget is called from evaluate for each target
* which remained in the Target list since the last evaluate.
*/
virtual void evaluateKeptTarget(TargetHolder& holder);
/**
* evaluateRemovedTarget is called from evaluate for each target
* which was removed from the Target list since the last evaluate.
*/
virtual void evaluateRemovedTarget(TargetHolder& holder);
MFTargetHolder::ContainerType mLastTargets;
};
using SFTool = SingleField<Link<Tool>>;
using MFTool = MultiField<Link<Tool>>;
} // namespace tools
#ifdef AV_INSTANTIATE_FIELD_TEMPLATES
template class AV_TOOLS_DLL SingleField<Link<::av::tools::Tool>>;
template class AV_TOOLS_DLL MultiField<Link<::av::tools::Tool>>;
#endif
} // namespace av
#endif // AVANGO_TOOLS_TOOL_HPP