A component is a part of a Path object, and is used to either name a property or a field within a property. More...
#include <ObjectIdentifier.h>
Public Member Functions | |
Component (const String &_name=String(), typeEnum _type=SIMPLE, int begin=INT_MAX, int end=INT_MAX, int step=1) | |
Construct a Component part. More... | |
Component (String &&_name, typeEnum _type=SIMPLE, int begin=INT_MAX, int end=INT_MAX, int step=1) | |
void | del (Py::Object &pyobj) const |
FC_DEFAULT_CTORS (Component) | |
Py::Object | get (const Py::Object &pyobj) const |
int | getBegin () const |
int | getEnd () const |
int | getIndex () const |
size_t | getIndex (size_t count) const |
const std::string & | getName () const |
int | getStep () const |
bool | isArray () const |
bool | isMap () const |
bool | isRange () const |
bool | isSimple () const |
bool | operator< (const Component &other) const |
bool | operator== (const Component &other) const |
Comparison operator for Component objects. More... | |
void | set (Py::Object &pyobj, const Py::Object &value) const |
void | toString (std::ostream &ss, bool toPython=false) const |
Create a string representation of a component. More... | |
Static Public Member Functions | |
static Component | ArrayComponent (int _index) |
Create an array component with given name and index. More... | |
static Component | MapComponent (const String &_key) |
Create a map component with given name and key. More... | |
static Component | MapComponent (String &&_key) |
static Component | RangeComponent (int _begin, int _end=INT_MAX, int _step=1) |
Create a range component with given begin and end. More... | |
static Component | SimpleComponent (const char *_component) |
Create a simple component part with the given name. More... | |
static Component | SimpleComponent (const String &_component) |
Create a simple component part with the given name. More... | |
static Component | SimpleComponent (String &&_component) |
Friends | |
class | ObjectIdentifier |
Detailed Description
A component is a part of a Path object, and is used to either name a property or a field within a property.
A component can be either a single entry, and array, or a map to other sub-fields.
Constructor & Destructor Documentation
◆ Component() [1/2]
◆ Component() [2/2]
ObjectIdentifier::Component::Component | ( | String && | _name, |
typeEnum | _type = SIMPLE , |
||
int | begin = INT_MAX , |
||
int | end = INT_MAX , |
||
int | step = 1 |
||
) |
Member Function Documentation
◆ ArrayComponent()
|
static |
Create an array component with given name and index.
- Parameters
-
_component Name of component _index Index of component
- Returns
- A new Component object.
◆ del()
void ObjectIdentifier::Component::del | ( | Py::Object & | pyobj | ) | const |
References Base::PyException::ThrowException().
◆ FC_DEFAULT_CTORS()
App::ObjectIdentifier::Component::FC_DEFAULT_CTORS | ( | Component | ) |
◆ get()
Py::Object ObjectIdentifier::Component::get | ( | const Py::Object & | pyobj | ) | const |
References App::ExpressionParser::isModuleImported(), and Base::PyException::ThrowException().
Referenced by draftguitools.gui_trackers.editTracker::move().
◆ getBegin()
int App::ObjectIdentifier::Component::getBegin | ( | ) | const |
◆ getEnd()
int App::ObjectIdentifier::Component::getEnd | ( | ) | const |
◆ getIndex() [1/2]
int App::ObjectIdentifier::Component::getIndex | ( | ) | const |
◆ getIndex() [2/2]
size_t ObjectIdentifier::Component::getIndex | ( | size_t | count | ) | const |
◆ getName()
const std::string& App::ObjectIdentifier::Component::getName | ( | ) | const |
◆ getStep()
int App::ObjectIdentifier::Component::getStep | ( | ) | const |
◆ isArray()
bool App::ObjectIdentifier::Component::isArray | ( | ) | const |
◆ isMap()
bool App::ObjectIdentifier::Component::isMap | ( | ) | const |
◆ isRange()
bool App::ObjectIdentifier::Component::isRange | ( | ) | const |
◆ isSimple()
bool App::ObjectIdentifier::Component::isSimple | ( | ) | const |
◆ MapComponent() [1/2]
|
static |
Create a map component with given name and key.
- Parameters
-
_component Name of component _key Key of component
- Returns
- A new Component object.
◆ MapComponent() [2/2]
|
static |
◆ operator<()
◆ operator==()
Comparison operator for Component objects.
- Parameters
-
other The object we want to compare to.
- Returns
- true if they are equal, false if not.
◆ RangeComponent()
|
static |
Create a range component with given begin and end.
- Parameters
-
_begin beginning index of the range _end ending index of the range
- Returns
- A new Component object.
◆ set()
void ObjectIdentifier::Component::set | ( | Py::Object & | pyobj, |
const Py::Object & | value | ||
) | const |
References Base::PyException::ThrowException().
Referenced by draftguitools.gui_trackers.editTracker::move().
◆ SimpleComponent() [1/3]
|
static |
Create a simple component part with the given name.
- Parameters
-
_component Name of component.
- Returns
- A new Component object.
Referenced by Part::PropertyPartShape::getPaths(), and Gui::QuantitySpinBox::setBoundToByName().
◆ SimpleComponent() [2/3]
|
static |
Create a simple component part with the given name.
- Parameters
-
_component Name of component.
- Returns
- A new Component object.
◆ SimpleComponent() [3/3]
|
static |
◆ toString()
void ObjectIdentifier::Component::toString | ( | std::ostream & | ss, |
bool | toPython = false |
||
) | const |
Create a string representation of a component.
- Returns
- A string representing the component.
Friends And Related Function Documentation
◆ ObjectIdentifier
|
friend |
The documentation for this class was generated from the following files:
- src/App/ObjectIdentifier.h
- src/App/ObjectIdentifier.cpp