-
Notifications
You must be signed in to change notification settings - Fork 22
/
TypeSelector.hpp
79 lines (64 loc) · 1.76 KB
/
TypeSelector.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
#ifndef AVANGO_TOOLS_TYPESELECTOR_HPP
#define AVANGO_TOOLS_TYPESELECTOR_HPP
/**
* \file
* \ingroup av_tools
*/
#include <avango/tools/Selector.hpp>
#include <avango/tools/windows_specific_tools.hpp>
namespace av
{
namespace tools
{
/**
* TypeSelector class selects targets from the types of given av::FieldContainers.
*
* \ingroup av_tools
*/
class AV_TOOLS_DLL TypeSelector : public Selector
{
AV_FC_DECLARE();
public:
/**
* Constructor.
*/
TypeSelector();
protected:
/**
* Destructor made protected to prevent allocation on stack.
*/
virtual ~TypeSelector();
public:
/**
* Defines the input targets from which the objects are selected.
*/
MFTargetHolder Targets;
/**
* Defines types by objects which may be selected. The output is in SelectedTargets.
*/
MFContainer SelectableTypes;
/**
* Defines additional types by objects which may come as output from another Selector.
*/
MFTargetHolder SelectableTargetTypes;
/**
* Set to true if only equal types should be selectable.
* Otherwise also derived types are selectable, which is the default.
*/
SFBool EqualTypeOnly;
/* virtual */ void fieldHasChanged(const av::Field& field);
/* virtual */ void evaluate();
protected:
bool isSelectable(const av::FieldContainer& object);
std::set<Type> mTypes;
bool mTypesDirty;
};
using SFTypeSelector = SingleField<Link<TypeSelector>>;
using MFTypeSelector = MultiField<Link<TypeSelector>>;
} // namespace tools
#ifdef AV_INSTANTIATE_FIELD_TEMPLATES
template class AV_TOOLS_DLL SingleField<Link<tools::TypeSelector>>;
template class AV_TOOLS_DLL MultiField<Link<tools::TypeSelector>>;
#endif
} // namespace av
#endif // AVANGO_TOOLS_TYPESELECTOR_HPP