-
Notifications
You must be signed in to change notification settings - Fork 14
XML.Tools
AQUAgpusph can be pictured as a sandbox where the user can define a set of variables and a set of tools to process them. That is indeed the way AQUAgpusph achieves its high level of modularity.
The user can define how the variables are operated setting up a pipeline, which is nothing but a queue of tools to be executed.
To this end <Tool>
elements can be added within <Tools>
sections on the
XML input files.
Along this line, there are 2 clearly different things that are configured by the
<Tool>
element:
- How the tools are arranged
- What the tool should do
The former has to do with how the queue of tools should look like, while the latter has to do with the payload of the tool, or in other words what is executed to transform the variables.
Each <Tool>
element can be used to insert, remove or replace one or more tools
from the pipeline.
Also, some conditions can be set on the tools to control if they should be actually executed, as already documented here.
In any case a name
attribute is mandatory for each <Tool>
element.
The name does not have to follow any special naming convention, so it might
include spaces or special chars.
It is though strongly recomended to do not use special characters that can be
confused with wildcards.
To append new tools at the end of the pipeline simply use the attribute
action="add"
on the <Tool>
element.
To insert tools somewhere in between the pipeline the attributes
action="insert"
or action="try_insert"
can be set on the <Tool>
element.
The difference between "insert"
and "try_insert"
is that the former will
fail if the tool cannot be inserted --becuase the referenced place does not
exists-- while the latter will only print a warning in such a case.
The place where the tool should be inserted can be defined in 2 ways:
- Setting the position place index with the
at
attribute. E.g.at="0"
is inserting the tool at the beginning of the pipeline - Referring another tool name, using the following attributes:
-
before
: The tool will be inserted before the tool named with this attribute -
before_prefix
: The same thanbefore
, but the provided name is edited inserting the including prefix -
after
: The tool will be inserted after the tool named with this attribute -
after_prefix
: The same thanafter
, but the provided name is edited inserting the including prefix
-
When using before
, before_prefix
, after
or after_prefix
,
wildcards can be used so
the tool will be inserted as many times as matching names are found.
With the attributes action="remove"
and action="try_remove"
, tools can be
dropped from the pipeline.
The tools to be removed are referred by the attribute name
, which might
contain wildcards.
If no matching names are found on the pipeline, action="remove"
will fail
and stop AQUAgpusph, while action="try_remove"
will print a warning.
With the attributes action="replace"
and action="try_replace"
, tools can be
replaced by different ones the pipeline.
The tools to be replaced are referred by the attribute name
, which might
contain wildcards.
If no matching names are found on the pipeline, action="replace"
will fail
and stop AQUAgpusph, while action="try_replace"
will print a warning.
Several types of tools can be considered on the pipeline, meant to operate on the different kind of variables --Scalars or Arrays--:
- Operators
- Special
- Extensions
- Reports
There is an additional type of tool, called dummy
, which is actually void,
i.e. it is not executing any operation.
dummy
tools are usually considered as markers, so other presets might know
when certain block of tools started and finished.
dummy
tools can be adeed setting the attribute type=dummy
.
No additional attributes are required.