App: add hiddenref() expression built-in function

Any object reference inside this function is treated as hidden to
exclude it from dependency calculation. This function allows some form
of cyclic depdenency.

Merger note: renamed from "HREF" to "HIDDENREF" to avoid confusion with
the standard "hypertext reference" use of HREF.
This commit is contained in:
Zheng, Lei
2019-12-23 11:50:11 +08:00
committed by Chris Hennes
parent 7e272d00f8
commit fdae470c1b
11 changed files with 500 additions and 225 deletions

View File

@@ -85,9 +85,11 @@ public:
struct ExpressionInfo {
std::shared_ptr<App::Expression> expression; /**< The actual expression tree */
bool busy;
ExpressionInfo(std::shared_ptr<App::Expression> expression = std::shared_ptr<App::Expression>()) {
this->expression = expression;
this->busy = false;
}
ExpressionInfo(const ExpressionInfo & other) {
@@ -186,6 +188,10 @@ private:
boost::unordered_map<int, App::ObjectIdentifier> &revNodes,
DiGraph &g, ExecuteOption option=ExecuteAll) const;
void slotChangedObject(const App::DocumentObject &obj, const App::Property &prop);
void slotChangedProperty(const App::DocumentObject &obj, const App::Property &prop);
void updateHiddenReference(const std::string &key);
bool running; /**< Boolean used to avoid loops */
bool restoring = false;
@@ -201,6 +207,9 @@ private:
/**< Expressions are read from file to this map first before they are validated and inserted into the actual map */
std::unique_ptr<std::vector<RestoredExpression> > restoredExpressions;
struct Private;
std::unique_ptr<Private> pimpl;
friend class AtomicPropertyChange;
};