App::ObjectIdentifier::Component Class Reference

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]

ObjectIdentifier::Component::Component ( const String _name = String(),
typeEnum  _type = SIMPLE,
int  _begin = INT_MAX,
int  _end = INT_MAX,
int  _step = 1 
)

Construct a Component part.

Parameters
_nameName of component
_typeType; simple, array, range or map
_beginArray index or beginning of a Range, or INT_MAX for other type.
_endending of a Range, or INT_MAX for other type.

◆ 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()

ObjectIdentifier::Component ObjectIdentifier::Component::ArrayComponent ( int  _index)
static

Create an array component with given name and index.

Parameters
_componentName of component
_indexIndex of component
Returns
A new Component object.

◆ del()

void ObjectIdentifier::Component::del ( Py::Object &  pyobj) const

◆ FC_DEFAULT_CTORS()

App::ObjectIdentifier::Component::FC_DEFAULT_CTORS ( Component  )

◆ get()

Py::Object ObjectIdentifier::Component::get ( const Py::Object &  pyobj) const

◆ 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]

ObjectIdentifier::Component ObjectIdentifier::Component::MapComponent ( const String _key)
static

Create a map component with given name and key.

Parameters
_componentName of component
_keyKey of component
Returns
A new Component object.

◆ MapComponent() [2/2]

ObjectIdentifier::Component ObjectIdentifier::Component::MapComponent ( String &&  _key)
static

◆ operator<()

bool App::ObjectIdentifier::Component::operator< ( const Component other) const

◆ operator==()

bool ObjectIdentifier::Component::operator== ( const Component other) const

Comparison operator for Component objects.

Parameters
otherThe object we want to compare to.
Returns
true if they are equal, false if not.

◆ RangeComponent()

ObjectIdentifier::Component ObjectIdentifier::Component::RangeComponent ( int  _begin,
int  _end = INT_MAX,
int  _step = 1 
)
static

Create a range component with given begin and end.

Parameters
_beginbeginning index of the range
_endending index of the range
Returns
A new Component object.

◆ set()

void ObjectIdentifier::Component::set ( Py::Object &  pyobj,
const Py::Object &  value 
) const

◆ SimpleComponent() [1/3]

ObjectIdentifier::Component ObjectIdentifier::Component::SimpleComponent ( const char *  _component)
static

Create a simple component part with the given name.

Parameters
_componentName of component.
Returns
A new Component object.

Referenced by Part::PropertyPartShape::getPaths(), and Gui::QuantitySpinBox::setBoundToByName().

◆ SimpleComponent() [2/3]

ObjectIdentifier::Component ObjectIdentifier::Component::SimpleComponent ( const String _component)
static

Create a simple component part with the given name.

Parameters
_componentName of component.
Returns
A new Component object.

◆ SimpleComponent() [3/3]

ObjectIdentifier::Component ObjectIdentifier::Component::SimpleComponent ( ObjectIdentifier::String &&  _component)
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 class ObjectIdentifier
friend

The documentation for this class was generated from the following files: