An abstract position in a searchable object. More...
#include <klfsearchbar.h>

Classes | |
| struct | PosData |
| A Base class for storing abstract position data. More... | |
Public Member Functions | |
| Pos () | |
| Pos (const Pos &other) | |
| ~Pos () | |
| Pos & | operator= (const Pos &other) |
| bool | valid () const |
| bool | equals (const Pos &other) const |
| template<class TT> | |
| TT * | data () const |
A shorthand for retrieving the posdata cast into the custom type. | |
Public Attributes | |
| KLFRefPtr< PosData > | posdata |
| Stores the actual position data, see PosData. | |
An abstract position in a searchable object.
Used by KLFPosSearchable to store search result positions.
A position can be invalid, or valid. The actual data representing the position is stored in a custom sub-class of PosData, to which a pointer is held in posdata.
You can construct an invalid position with the default constructor. Then just assign a data pointer to it and it becomes valid, e.g.
Definition at line 97 of file klfsearchbar.h.
|
inline |
Constructs an invalid position. This initializes the data pointer to NULL.
Definition at line 146 of file klfsearchbar.h.
References posdata.
Referenced by equals(), operator=(), and Pos().
|
inline |
Definition at line 150 of file klfsearchbar.h.
|
inline |
Definition at line 154 of file klfsearchbar.h.
References posdata.
|
inline |
A shorthand for retrieving the posdata cast into the custom type.
Example:
Additionally, a warning is issued if posdata is NULL or if posdata cannot by cast (with dynamic_cast<>) to the required type.
Definition at line 212 of file klfsearchbar.h.
References KLF_ASSERT_NOT_NULL, and posdata.
Referenced by equals().
|
inline |
Is equal to other if:
posdata 's equals() test is true;PosData's equals() test called if and only if both this and the other position are valid, i.e. have non-NULL posdata pointer. Definition at line 180 of file klfsearchbar.h.
Definition at line 160 of file klfsearchbar.h.
References KLF_DEBUG_BLOCK, Pos(), and posdata.
|
inline |
A position is valid if it has a non-NULL posdata pointer. It is invalid otherwise.
Definition at line 168 of file klfsearchbar.h.
References KLF_DEBUG_BLOCK, klfDbg, and posdata.
Referenced by KLFSearchBar::emitFoundSignals(), equals(), and KLFSearchable::searchFind().
Stores the actual position data, see PosData.
This pointer is set up by KLFPosSearchable subclasses to instanciate valid Pos objects. They may use this object transparently, just as a regular PosData* pointer, see KLFRefPtr.
Definition at line 196 of file klfsearchbar.h.
Referenced by data(), equals(), operator<<(), operator=(), Pos(), Pos(), KLFSearchable::searchFind(), valid(), and ~Pos().