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 |
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.
ObjectIdentifier::Component::Component | ( | String && | _name, |
typeEnum | _type = SIMPLE , |
||
int | begin = INT_MAX , |
||
int | end = INT_MAX , |
||
int | step = 1 |
||
) |
|
static |
Create an array component with given name and index.
_component | Name of component |
_index | Index of component |
void ObjectIdentifier::Component::del | ( | Py::Object & | pyobj | ) | const |
References Base::PyException::ThrowException().
App::ObjectIdentifier::Component::FC_DEFAULT_CTORS | ( | Component | ) |
References draftfunctions.move::move().
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().
int App::ObjectIdentifier::Component::getBegin | ( | ) | const |
int App::ObjectIdentifier::Component::getEnd | ( | ) | const |
int App::ObjectIdentifier::Component::getIndex | ( | ) | const |
size_t ObjectIdentifier::Component::getIndex | ( | size_t | count | ) | const |
const std::string & App::ObjectIdentifier::Component::getName | ( | ) | const |
int App::ObjectIdentifier::Component::getStep | ( | ) | const |
bool App::ObjectIdentifier::Component::isArray | ( | ) | const |
bool App::ObjectIdentifier::Component::isMap | ( | ) | const |
bool App::ObjectIdentifier::Component::isRange | ( | ) | const |
bool App::ObjectIdentifier::Component::isSimple | ( | ) | const |
|
static |
Create a map component with given name and key.
_component | Name of component |
_key | Key of component |
|
static |
References draftfunctions.move::move().
Comparison operator for Component objects.
other | The object we want to compare to. |
|
static |
Create a range component with given begin and end.
_begin | beginning index of the range |
_end | ending index of the range |
void ObjectIdentifier::Component::set | ( | Py::Object & | pyobj, |
const Py::Object & | value | ||
) | const |
References Base::PyException::ThrowException().
Referenced by draftguitools.gui_trackers.editTracker::move().
|
static |
Create a simple component part with the given name.
_component | Name of component. |
Referenced by Part::PropertyPartShape::getPaths(), and Gui::QuantitySpinBox::setBoundToByName().
|
static |
Create a simple component part with the given name.
_component | Name of component. |
|
static |
References draftfunctions.move::move().
void ObjectIdentifier::Component::toString | ( | std::ostream & | ss, |
bool | toPython = false |
||
) | const |
Create a string representation of a component.
|
friend |