Base class for expressions. More...

#include <Expression.h>

Classes

struct  Component
 
class  Exception
 

Public Types

typedef std::vector< Component * > ComponentList
 

Public Member Functions

virtual void addComponent (Component *component)
 
bool adjustLinks (const std::set< App::DocumentObject * > &inList)
 
Expressioncopy () const
 
Expressioneval () 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::ObjectIdentifiergetIdentifiers () const
 
void getIdentifiers (std::set< App::ObjectIdentifier > &) const
 
App::DocumentObjectgetOwner () 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 bool isTouched () const
 
virtual int priority () const
 
ExpressionPtr replaceObject (const App::DocumentObject *parent, App::DocumentObject *oldObj, App::DocumentObject *newObj) const
 
virtual Expressionsimplify () const =0
 
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 ()
 
- Public Member Functions inherited from Base::BaseClass
 BaseClass ()
 Construction. More...
 
virtual PyObjectgetPyObject (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...
 

Static Public Member Functions

static ComponentcreateComponent (const std::string &n)
 
static ComponentcreateComponent (Expression *e1, Expression *e2=0, Expression *e3=0, bool isRange=false)
 
static Expressionparse (const App::DocumentObject *owner, const std::string &buffer)
 
- Static Public Member Functions inherited from Base::BaseClass
static void * create (void)
 
static Type getClassTypeId (void)
 
static void init (void)
 

Public Attributes

std::string comment
 
friend ExpressionVisitor
 

Protected Attributes

ComponentList components
 
App::DocumentObjectowner
 The document object used to access unqualified variables (i.e local scope) More...
 

Additional Inherited Members

- Static Protected Member Functions inherited from Base::BaseClass
static void initSubclass (Base::Type &toInit, const char *ClassName, const char *ParentName, Type::instantiationMethod method=nullptr)
 

Detailed Description

Base class for expressions.

Member Typedef Documentation

◆ ComponentList

Constructor & Destructor Documentation

◆ Expression()

Expression::Expression ( const App::DocumentObject _owner)

◆ ~Expression()

Expression::~Expression ( )
virtual

Member Function Documentation

◆ addComponent()

void Expression::addComponent ( Component component)
virtual

◆ adjustLinks()

bool Expression::adjustLinks ( const std::set< App::DocumentObject * > &  inList)

References visit().

Referenced by AdjustLinksExpressionVisitor::visit().

◆ copy()

◆ createComponent() [1/2]

Expression::Component * Expression::createComponent ( const std::string &  n)
static

◆ createComponent() [2/2]

Expression::Component * Expression::createComponent ( Expression e1,
Expression e2 = 0,
Expression e3 = 0,
bool  isRange = false 
)
static

◆ eval()

◆ getDepObjects() [1/2]

void Expression::getDepObjects ( std::set< App::DocumentObject * > &  deps,
std::vector< std::string > *  labels = 0 
) const

References visit().

◆ getDepObjects() [2/2]

std::set< App::DocumentObject * > Expression::getDepObjects ( std::vector< std::string > *  labels = 0) const

◆ getDeps() [1/2]

ExpressionDeps Expression::getDeps ( ) const

◆ getDeps() [2/2]

void Expression::getDeps ( ExpressionDeps deps) const

References visit().

◆ getIdentifiers() [1/2]

std::set< App::ObjectIdentifier > Expression::getIdentifiers ( ) const

◆ getIdentifiers() [2/2]

void Expression::getIdentifiers ( std::set< App::ObjectIdentifier > &  deps) const

References visit().

◆ getOwner()

App::DocumentObject* App::Expression::getOwner ( ) const

◆ getPyValue()

Py::Object Expression::getPyValue ( ) const

◆ getValueAsAny()

App::any Expression::getValueAsAny ( ) const

◆ hasComponent()

bool App::Expression::hasComponent ( ) const

◆ importSubNames()

ExpressionPtr Expression::importSubNames ( const std::map< std::string, std::string > &  nameMap) const

◆ isSame()

bool Expression::isSame ( const Expression other) const

◆ isTouched()

virtual bool App::Expression::isTouched ( ) const
virtual

◆ parse()

◆ priority()

int Expression::priority ( ) const
virtual

Reimplemented in App::ConditionalExpression, and App::OperatorExpression.

Referenced by toString().

◆ replaceObject()

ExpressionPtr Expression::replaceObject ( const App::DocumentObject parent,
App::DocumentObject oldObj,
App::DocumentObject newObj 
) const

References copy(), and visit().

◆ simplify()

◆ toString() [1/2]

std::string Expression::toString ( bool  persistent = false,
bool  checkPriority = false,
int  indent = 0 
) const

Referenced by isSame().

◆ toString() [2/2]

void Expression::toString ( std::ostream &  os,
bool  persistent = false,
bool  checkPriority = false,
int  indent = 0 
) const

References priority().

◆ updateLabelReference()

ExpressionPtr Expression::updateLabelReference ( App::DocumentObject obj,
const std::string &  ref,
const char *  newLabel 
) const

◆ visit()

Member Data Documentation

◆ comment

std::string App::Expression::comment

Referenced by copy(), and isSame().

◆ components

ComponentList App::Expression::components
protected

Referenced by copy().

◆ ExpressionVisitor

friend App::Expression::ExpressionVisitor

◆ owner


The documentation for this class was generated from the following files:
  • src/App/Expression.h
  • src/App/Expression.cpp