Programming Reference:Target Class
- 1 Target Class
- 2 SetOfTargets Class
- 3 See also
The Target class is a virtual base class which defines an event handling interface for targets. There, a "Target" is defined as "an object that performs an action when selected."
A Target descendant class will typically override its empty OnSelect() event handlers with a function that performs an action. An application uses the public Target::Select() function to control its behavior; this function, in turn, calls the virtual event handler.
The SetOfTargets class allows to define sets of targets, and to select all of the targets it contains.
int Tag (rw)
An arbitrary integer that may be used to encode information about a given target (e.g., its corresponding row in a configuration matrix).
Prompts a target to perform its selection action by calling its OnSelect() event handler.
In its OnSelect event handler, a target performs an action, e.g. entering a letter into a speller.
SetOfTargets is declared in the Target class header file.
SetOfTargets is a helper class that provides selection and destruction of a group of stimuli.
Adds a target object to the set.
Removes a given target object from the set; nothing happens when the specified target is not a member of the set.
Clears the set. Targets that were represented in the set in form of pointers are unaffected.
Deletes all target objects that are in the set, and clears the set. To avoid dangling pointers, and multiple deletion, you should make sure that the set's members are not part of any other SetOfTargets by the time you call SetOfTargets::DeleteObjects().
bool Contains(Target pointer)
Returns true if the specified target object is part of the set, and false otherwise.
Returns true if any of the elements of the specified set is part of the set on which Intersects is called, and false otherwise.
Calls each element's Select() method.