Provides a way to identify a particular input or output of an operation in a (possibly nested) namespace.
#include <Workspace/Widgets/namepath.h>
◆ NamePath() [1/3]
- Parameters
-
namePath | The name path to copy. |
◆ NamePath() [2/3]
Constructs an invalid path.
- See also
- isValid()
◆ NamePath() [3/3]
- Parameters
-
iobase | The input/output with which to associate this name path. |
◆ ~NamePath()
◆ add()
void add |
( |
const QString & |
name | ) |
|
- Parameters
-
name | The name to append to the end of the name path. |
◆ back()
const QString & back |
( |
| ) |
const |
- Returns
- The last name in the name path.
- Precondition
- The name path must not be empty.
◆ clear()
Clears the name path. If the name path is invalid, clear() does nothing.
- See also
- isValid()
◆ clone()
- Returns
- A clone of this object.
- Note
- Subclasses would normally return their own type rather than the Clonable type. The C++ language rules allow a more derived type to be returned from a virtual function and the compiler will still treat it as a valid override.
Implements Clonable.
◆ empty()
- Returns
- True if the name path is empty or invalid.
- See also
- isValid()
◆ erase()
- Parameters
-
index | The index of the name to erase. Names at higher indexes are shifted down. |
◆ eraseToEnd()
void eraseToEnd |
( |
int |
index | ) |
|
- Parameters
-
index | The index of the name to erase. Names at higher indexes will also be erased. |
- Postcondition
- The size of the name path will be index after the function returns.
◆ front()
const QString & front |
( |
| ) |
const |
- Returns
- The first name in the name path.
- Precondition
- The name path must not be empty.
◆ getDataObject()
- Returns
- The data object this name path corresponds to. If the name path is empty, this will return the data object for the input/output the name path is attached to (set in the constructor). If the name path is invalid, a null pointer will be returned.
- See also
- isValid()
◆ getIOBase()
- Returns
- The input/output this name path is attached to (set in the constructor), or a null pointer if the name path is invalid.
- See also
- isValid()
◆ getLocalName()
QString getLocalName |
( |
| ) |
const |
- Returns
- The name of the specific data object this name path refers to. If the name path is not empty, this will be the last name in the name path list. For an empty name path, the name of the input/output this name path is associated with will be returned. Finally, if the name path is invalid, an empty string will be returned.
◆ getWidget()
QWidget * getWidget |
( |
| ) |
const |
◆ isValid()
- Returns
- True if the name path is associated with an input or output. The only way to create an invalid name path is through the default constructor.
◆ operator=()
◆ operator==()
bool operator== |
( |
const NamePath & |
namePath | ) |
const |
- Returns
- True if the two name paths refer to the same data.
◆ operator[]()
const QString & operator[] |
( |
int |
index | ) |
const |
- Parameters
-
index | The index into the name path of the name to return. It is up to the caller to ensure that this index is valid (ie >=0 and less than the result of size()). |
- Returns
- The specified name.
◆ setWidget()
void setWidget |
( |
QWidget * |
widget | ) |
const |
◆ size()