Class implementing a reference to a property. More...
#include <ExpressionParser.h>
Public Member Functions | |
virtual void addComponent (Component *component) override | |
ObjectIdentifier getPath () const | |
const App::Property * getProperty () const | |
Find the property this expression referse to. More... | |
virtual bool isTouched () const override | |
Determine if the expression is touched or not, i.e whether the Property object it refers to is touched(). More... | |
std::string name () const | |
void setPath (const ObjectIdentifier &path) | |
virtual Expression * simplify () const override | |
Simplify the expression. More... | |
VariableExpression (const App::DocumentObject *_owner=0, ObjectIdentifier _var=ObjectIdentifier()) | |
~VariableExpression () | |
![]() | |
const Base::Quantity & getQuantity () const | |
double getScaler () const | |
const Base::Unit & getUnit () const | |
const std::string getUnitString () const | |
double getValue () const | |
void setQuantity (const Base::Quantity &_quantity) | |
void setUnit (const Base::Quantity &_quantity) | |
Set unit information. More... | |
UnitExpression (const App::DocumentObject *_owner=0, const Base::Quantity &_quantity=Base::Quantity(), const std::string &_unitStr=std::string()) | |
~UnitExpression () | |
![]() | |
bool adjustLinks (const std::set< App::DocumentObject * > &inList) | |
Expression * copy () const | |
Expression * eval () const | |
Expression (const App::DocumentObject *_owner) | |
void getDepObjects (std::set< App::DocumentObject * > &, std::vector< std::string > *labels=0) const | |
std::set< App::DocumentObject * > getDepObjects (std::vector< std::string > *labels=0) const | |
ExpressionDeps getDeps () const | |
void getDeps (ExpressionDeps &deps) const | |
std::set< App::ObjectIdentifier > getIdentifiers () const | |
void getIdentifiers (std::set< App::ObjectIdentifier > &) const | |
App::DocumentObject * getOwner () const | |
Py::Object getPyValue () const | |
boost::any getValueAsAny () const | |
bool hasComponent () const | |
ExpressionPtr importSubNames (const std::map< std::string, std::string > &nameMap) const | |
bool isSame (const Expression &other) const | |
virtual int priority () const | |
ExpressionPtr replaceObject (const App::DocumentObject *parent, App::DocumentObject *oldObj, App::DocumentObject *newObj) const | |
std::string toString (bool persistent=false, bool checkPriority=false, int indent=0) const | |
void toString (std::ostream &os, bool persistent=false, bool checkPriority=false, int indent=0) const | |
ExpressionPtr updateLabelReference (App::DocumentObject *obj, const std::string &ref, const char *newLabel) const | |
void visit (ExpressionVisitor &v) | |
virtual ~Expression () | |
![]() | |
BaseClass () | |
Construction. More... | |
virtual PyObject * getPyObject (void) | |
This method returns the Python wrapper for a C++ object. More... | |
virtual Type getTypeId (void) const | |
bool isDerivedFrom (const Type type) const | |
virtual void setPyObject (PyObject *) | |
virtual ~BaseClass () | |
Destruction. More... | |
Protected Attributes | |
ObjectIdentifier var | |
Variable name More... | |
![]() | |
PyObject * cache = 0 | |
![]() | |
ComponentList components | |
App::DocumentObject * owner | |
The document object used to access unqualified variables (i.e local scope) More... | |
Additional Inherited Members | |
![]() | |
typedef std::vector< Component * > ComponentList | |
![]() | |
static Component * createComponent (const std::string &n) | |
static Component * createComponent (Expression *e1, Expression *e2=0, Expression *e3=0, bool isRange=false) | |
static Expression * parse (const App::DocumentObject *owner, const std::string &buffer) | |
![]() | |
static void * create (void) | |
static Type getClassTypeId (void) | |
static void init (void) | |
![]() | |
std::string comment | |
friend ExpressionVisitor | |
![]() | |
static void initSubclass (Base::Type &toInit, const char *ClassName, const char *ParentName, Type::instantiationMethod method=nullptr) | |
Detailed Description
Class implementing a reference to a property.
If the name is unqualified, the owner of the expression is searched. If it is qualified, the document that contains the owning document object is searched for other document objects to search. Both labels and internal document names are searched.
Constructor & Destructor Documentation
◆ VariableExpression()
VariableExpression::VariableExpression | ( | const App::DocumentObject * | _owner = 0 , |
ObjectIdentifier | _var = ObjectIdentifier() |
||
) |
◆ ~VariableExpression()
VariableExpression::~VariableExpression | ( | ) |
Member Function Documentation
◆ addComponent()
|
overridevirtual |
Reimplemented from App::Expression.
References App::Expression::addComponent(), App::ObjectIdentifier::ArrayComponent(), App::ObjectIdentifier::MapComponent(), and App::ObjectIdentifier::RangeComponent().
◆ getPath()
ObjectIdentifier App::VariableExpression::getPath | ( | ) | const |
◆ getProperty()
const Property * VariableExpression::getProperty | ( | ) | const |
Find the property this expression referse to.
Unqualified names (i.e the name only without any dots) are resolved in the owning DocumentObjects. Qualified names are looked up in the owning Document. It is first looked up by its internal name. If not found, the DocumentObjects' labels searched.
If something fails, an exception is thrown.
- Returns
- The Property object if it is derived from either PropertyInteger, PropertyFloat, or PropertyString.
◆ isTouched()
|
overridevirtual |
Determine if the expression is touched or not, i.e whether the Property object it refers to is touched().
- Returns
- True if the Property object is touched, false if not.
Reimplemented from App::Expression.
◆ name()
std::string App::VariableExpression::name | ( | ) | const |
◆ setPath()
void VariableExpression::setPath | ( | const ObjectIdentifier & | path | ) |
◆ simplify()
|
overridevirtual |
Simplify the expression.
Simplification of VariableExpression objects is not possible (if it is instantiated it would be an evaluation instead).
- Returns
- A copy of the expression.
Reimplemented from App::UnitExpression.
References App::Expression::copy().
Member Data Documentation
◆ var
|
protected |
Variable name
The documentation for this class was generated from the following files:
- src/App/ExpressionParser.h
- src/App/Expression.cpp