Doc: Move doc comments ObjectIdentifier

Move the doc comments from the cpp file to the header file.
This commit is contained in:
Pieter Hijma
2025-04-27 09:35:43 +02:00
parent 8a82caf3af
commit 295e9636a0
2 changed files with 235 additions and 270 deletions

View File

@@ -51,16 +51,6 @@ FC_LOG_LEVEL_INIT("Expression", true, true)
using namespace App;
using namespace Base;
// Path class
/**
* @brief Quote input string according to quoting rules for an expression: because " and ' are
* used to designate inch and foot units, strings are quoted as <<string>>.
*
* @param input
* @return
*/
std::string App::quote(const std::string& input, bool toPython)
{
std::stringstream output;
@@ -103,12 +93,6 @@ std::string App::quote(const std::string& input, bool toPython)
}
/**
* @brief Construct an ObjectIdentifier object, given an owner and a single-value property.
* @param _owner Owner of property.
* @param property Name of property.
*/
ObjectIdentifier::ObjectIdentifier(const App::PropertyContainer* _owner,
const std::string& property,
int index)
@@ -153,12 +137,6 @@ ObjectIdentifier::ObjectIdentifier(const App::PropertyContainer* _owner, bool lo
}
}
/**
* @brief Construct an ObjectIdentifier object given a property. The property is assumed to be
* single-valued.
* @param prop Property to construct object identifier for.
*/
ObjectIdentifier::ObjectIdentifier(const Property& prop, int index)
: owner(nullptr)
, documentNameSet(false)
@@ -185,11 +163,6 @@ ObjectIdentifier::ObjectIdentifier(const Property& prop, int index)
}
}
/**
* @brief Get the name of the property.
* @return Name
*/
std::string App::ObjectIdentifier::getPropertyName() const
{
ResolveResults result(*this);
@@ -200,13 +173,6 @@ std::string App::ObjectIdentifier::getPropertyName() const
return components[result.propertyIndex].getName();
}
/**
* @brief Get Component at given index \a i.
* @param i: Index to get
* @param idx: optional return of adjusted component index
* @return A component.
*/
const App::ObjectIdentifier::Component& App::ObjectIdentifier::getPropertyComponent(int i,
int* idx) const
{
@@ -252,34 +218,16 @@ std::vector<ObjectIdentifier::Component> ObjectIdentifier::getPropertyComponents
return res;
}
/**
* @brief Compare object identifier with \a other.
* @param other Other object identifier.
* @return true if they are equal.
*/
bool ObjectIdentifier::operator==(const ObjectIdentifier& other) const
{
return owner == other.owner && toString() == other.toString();
}
/**
* @brief Compare object identifier with \a other.
* @param other Other object identifier
* @return true if they differ from each other.
*/
bool ObjectIdentifier::operator!=(const ObjectIdentifier& other) const
{
return !(operator==)(other);
}
/**
* @brief Compare object identifier with other.
* @param other Other object identifier.
* @return true if this object is less than the other.
*/
bool ObjectIdentifier::operator<(const ObjectIdentifier& other) const
{
if (owner < other.owner) {
@@ -291,21 +239,11 @@ bool ObjectIdentifier::operator<(const ObjectIdentifier& other) const
return toString() < other.toString();
}
/**
* @brief Return number of components.
* @return Number of components in this identifier.
*/
int ObjectIdentifier::numComponents() const
{
return components.size();
}
/**
* @brief Compute number of sub components, i.e excluding the property.
* @return Number of components.
*/
int ObjectIdentifier::numSubComponents() const
{
ResolveResults result(*this);
@@ -341,17 +279,6 @@ bool ObjectIdentifier::verify(const App::Property& prop, bool silent) const
return true;
}
/**
* @brief Create a string representation of this object identifier.
*
* An identifier is written as document#documentobject.property.subproperty1...subpropertyN
* document# may be dropped; it is assumed to be within owner's document. If documentobject is
* dropped, the property is assumed to be owned by the owner specified in the object identifiers
* constructor.
*
* @return A string
*/
const std::string& ObjectIdentifier::toString() const
{
if (!_cache.empty() || !owner) {
@@ -510,11 +437,6 @@ bool ObjectIdentifier::replaceObject(ObjectIdentifier& res,
return true;
}
/**
* @brief Escape toString representation so it is suitable for being embedded in a python command.
* @return Escaped string.
*/
std::string ObjectIdentifier::toEscapedString() const
{
return Base::Tools::escapedUnicodeFromUtf8(toString().c_str());
@@ -606,11 +528,6 @@ bool ObjectIdentifier::relabeledDocument(ExpressionVisitor& v,
return false;
}
/**
* @brief Get sub field part of a property as a string.
* @return String representation of path.
*/
void ObjectIdentifier::getSubPathStr(std::ostream& s,
const ResolveResults& result,
bool toPython) const
@@ -633,14 +550,6 @@ std::string ObjectIdentifier::getSubPathStr(bool toPython) const
}
/**
* @brief Construct a Component part
* @param _name Name of component
* @param _type Type; simple, array, range or map
* @param _begin Array index or beginning of a Range, or INT_MAX for other type.
* @param _end ending of a Range, or INT_MAX for other type.
*/
ObjectIdentifier::Component::Component(const String& _name,
ObjectIdentifier::Component::typeEnum _type,
int _begin,
@@ -784,23 +693,11 @@ void ObjectIdentifier::Component::del(Py::Object& pyobj) const
}
}
/**
* @brief Create a simple component part with the given name
* @param _component Name of component.
* @return A new Component object.
*/
ObjectIdentifier::Component ObjectIdentifier::Component::SimpleComponent(const char* _component)
{
return Component(String(_component));
}
/**
* @brief Create a simple component part with the given name
* @param _component Name of component.
* @return A new Component object.
*/
ObjectIdentifier::Component
ObjectIdentifier::Component::SimpleComponent(const ObjectIdentifier::String& _component)
{
@@ -813,25 +710,11 @@ ObjectIdentifier::Component::SimpleComponent(ObjectIdentifier::String&& _compone
return Component(std::move(_component));
}
/**
* @brief Create an array component with given name and index.
* @param _component Name of component
* @param _index Index of component
* @return A new Component object.
*/
ObjectIdentifier::Component ObjectIdentifier::Component::ArrayComponent(int _index)
{
return Component(String(), Component::ARRAY, _index);
}
/**
* @brief Create a map component with given name and key.
* @param _component Name of component
* @param _key Key of component
* @return A new Component object.
*/
ObjectIdentifier::Component ObjectIdentifier::Component::MapComponent(const String& _key)
{
return Component(_key, Component::MAP);
@@ -842,26 +725,12 @@ ObjectIdentifier::Component ObjectIdentifier::Component::MapComponent(String&& _
return Component(std::move(_key), Component::MAP);
}
/**
* @brief Create a range component with given begin and end.
* @param _begin beginning index of the range
* @param _end ending index of the range
* @return A new Component object.
*/
ObjectIdentifier::Component
ObjectIdentifier::Component::RangeComponent(int _begin, int _end, int _step)
{
return Component(String(), Component::RANGE, _begin, _end, _step);
}
/**
* @brief Comparison operator for Component objects.
* @param other The object we want to compare to.
* @return true if they are equal, false if not.
*/
bool ObjectIdentifier::Component::operator==(const ObjectIdentifier::Component& other) const
{
if (type != other.type) {
@@ -882,11 +751,6 @@ bool ObjectIdentifier::Component::operator==(const ObjectIdentifier::Component&
}
}
/**
* @brief Create a string representation of a component.
* @return A string representing the component.
*/
void ObjectIdentifier::Component::toString(std::ostream& ss, bool toPython) const
{
switch (type) {
@@ -925,17 +789,6 @@ enum ResolveFlags
ResolveAmbiguous,
};
/**
* @brief Search for the document object given by name in doc.
*
* Name might be the internal name or a label. In any case, it must uniquely define
* the document object.
*
* @param doc Document to search
* @param name Name to search for.
* @return Pointer to document object if a unique pointer is found, 0 otherwise.
*/
App::DocumentObject* ObjectIdentifier::getDocumentObject(const App::Document* doc,
const String& name,
std::bitset<32>& flags)
@@ -991,13 +844,6 @@ App::DocumentObject* ObjectIdentifier::getDocumentObject(const App::Document* do
}
}
/**
* @brief Resolve the object identifier to a concrete document, documentobject, and property.
*
* This method is a helper method that fills out data in the given ResolveResults object.
*
*/
void ObjectIdentifier::resolve(ResolveResults& results) const
{
if (!owner) {
@@ -1128,12 +974,6 @@ void ObjectIdentifier::resolve(ResolveResults& results) const
}
}
/**
* @brief Find a document with the given name.
* @param name Name of document
* @return Pointer to document, or 0 if it is not found or not uniquely defined by name.
*/
Document* ObjectIdentifier::getDocument(String name, bool* ambiguous) const
{
if (name.getString().empty()) {
@@ -1186,11 +1026,6 @@ Document* ObjectIdentifier::getDocument(String name, bool* ambiguous) const
}
}
/**
* @brief Get the document object for the object identifier.
* @return Pointer to document object, or 0 if not found or uniquely defined.
*/
DocumentObject* ObjectIdentifier::getDocumentObject() const
{
const App::Document* doc = getDocument();
@@ -1290,11 +1125,6 @@ void ObjectIdentifier::getDep(Dependencies& deps,
}
}
/**
* @brief Get components as a string list.
* @return List of strings.
*/
std::vector<std::string> ObjectIdentifier::getStringList() const
{
std::vector<std::string> l;
@@ -1323,12 +1153,6 @@ std::vector<std::string> ObjectIdentifier::getStringList() const
return l;
}
/**
* @brief Construct the simplest possible object identifier relative to another.
* @param other The other object identifier.
* @return A new simplified object identifier.
*/
ObjectIdentifier ObjectIdentifier::relativeTo(const ObjectIdentifier& other) const
{
ObjectIdentifier result(other.getOwner());
@@ -1351,16 +1175,6 @@ ObjectIdentifier ObjectIdentifier::relativeTo(const ObjectIdentifier& other) con
return result;
}
/**
* @brief Parse a string to create an object identifier.
*
* This method throws an exception if the string is invalid.
*
* @param docObj Document object that will own this object identifier.
* @param str String to parse
* @return A new object identifier.
*/
ObjectIdentifier ObjectIdentifier::parse(const DocumentObject* docObj, const std::string& str)
{
std::unique_ptr<Expression> expr(ExpressionParser::parse(docObj, str.c_str()));
@@ -1381,12 +1195,6 @@ std::string ObjectIdentifier::resolveErrorString() const
return result.resolveErrorString();
}
/**
* @brief << operator, used to add a component to the object identifier.
* @param value Component object
* @return Reference to itself.
*/
ObjectIdentifier& ObjectIdentifier::operator<<(const ObjectIdentifier::Component& value)
{
components.push_back(value);
@@ -1402,11 +1210,6 @@ ObjectIdentifier& ObjectIdentifier::operator<<(ObjectIdentifier::Component&& val
}
/**
* @brief Get pointer to property pointed to by this object identifier.
* @return Point to property if it is uniquely defined, or 0 otherwise.
*/
Property* ObjectIdentifier::getProperty(int* ptype) const
{
ResolveResults result(*this);
@@ -1462,15 +1265,6 @@ Property* ObjectIdentifier::resolveProperty(const App::DocumentObject* obj,
}
/**
* @brief Create a canonical representation of an object identifier.
*
* The main work is actually done by the property's virtual canonicalPath(...) method,
* which is invoked by this call.
*
* @return A new object identifier.
*/
ObjectIdentifier ObjectIdentifier::canonicalPath() const
{
ObjectIdentifier res(*this);
@@ -1498,15 +1292,6 @@ ObjectIdentifier::DocumentMapper::~DocumentMapper()
_DocumentMap = nullptr;
}
/**
* @brief Set the document name for this object identifier.
*
* If force is true, the document name will always be included in the string representation.
*
* @param name Name of document object.
* @param force Force name to be set
*/
void ObjectIdentifier::setDocumentName(ObjectIdentifier::String&& name, bool force)
{
if (name.getString().empty()) {
@@ -1533,12 +1318,6 @@ void ObjectIdentifier::setDocumentName(ObjectIdentifier::String&& name, bool for
documentName = std::move(name);
}
/**
* @brief Get the document name from this object identifier
*
* @return Document name as a String object.
*/
ObjectIdentifier::String ObjectIdentifier::getDocumentName() const
{
ResolveResults result(*this);
@@ -1546,16 +1325,6 @@ ObjectIdentifier::String ObjectIdentifier::getDocumentName() const
return result.resolvedDocumentName;
}
/**
* @brief Set the document object name of this object identifier.
*
* If force is true, the document object will not be resolved dynamically from the
* object identifier's components, but used as given by this method.
*
* @param name Name of document object.
* @param force Force name to be set.
*/
void ObjectIdentifier::setDocumentObjectName(ObjectIdentifier::String&& name,
bool force,
ObjectIdentifier::String&& subname,
@@ -1619,11 +1388,6 @@ void ObjectIdentifier::setDocumentObjectName(const App::DocumentObject* obj,
}
/**
* @brief Get the document object name
* @return String with name of document object as resolved by object identifier.
*/
ObjectIdentifier::String ObjectIdentifier::getDocumentObjectName() const
{
ResolveResults result(*this);
@@ -1636,11 +1400,6 @@ bool ObjectIdentifier::hasDocumentObjectName(bool forced) const
return !documentObjectName.getString().empty() && (!forced || documentObjectNameSet);
}
/**
* @brief Get a string representation of this object identifier.
* @return String representation.
*/
std::string ObjectIdentifier::String::toString(bool toPython) const
{
if (isRealString()) {
@@ -1924,19 +1683,6 @@ ObjectIdentifier::access(const ResolveResults& result, Py::Object* value, Depend
return pyobj;
}
/**
* @brief Get the value of the property or field pointed to by this object identifier.
*
* All type of objects are supported. Some types are casted to FC native
* type, including: Int, Float, String, Unicode String, and Quantities. Others
* are just kept as Python object wrapped by App::any.
*
* @param pathValue: if true, calls the property's getPathValue(), which is
* necessary for Qunatities to work.
*
* @return The value of the property or field.
*/
App::any ObjectIdentifier::getValue(bool pathValue, bool* isPseudoProperty) const
{
ResolveResults rs(*this);
@@ -1993,16 +1739,6 @@ Py::Object ObjectIdentifier::getPyValue(bool pathValue, bool* isPseudoProperty)
return Py::Object();
}
/**
* @brief Set value of a property or field pointed to by this object identifier.
*
* This method uses Python to do the actual work. and a limited set of types that
* can be in the App::any variable is supported: Base::Quantity, double,
* char*, const char*, int, unsigned int, short, unsigned short, char, and unsigned char.
*
* @param value Value to set
*/
void ObjectIdentifier::setValue(const App::any& value) const
{
std::stringstream ss;
@@ -2180,12 +1916,6 @@ void ObjectIdentifier::resolveAmbiguity(ResolveResults& result)
}
}
/** Construct and initialize a ResolveResults object, given an ObjectIdentifier instance.
*
* The constructor will invoke the ObjectIdentifier's resolve() method to initialize the object's
* data.
*/
ObjectIdentifier::ResolveResults::ResolveResults(const ObjectIdentifier& oi)
: propertyType(PseudoNone)
{

View File

@@ -62,6 +62,19 @@ class PropertyContainer;
class DocumentObject;
class ExpressionVisitor;
/**
* @brief Quote a string.
*
* Quote an input string according to quoting rules for an expression: because
* " and ' are used to designate inch and foot units, strings are quoted as
* <<string>>.
*
* @param[in] input The string to quote.
* @param[in] toPython If true, use Python quoting rules. Otherwise, use
* FreeCAD quoting rules.
*
* @return The string quoted.
*/
AppExport std::string quote(const std::string& input, bool toPython = false);
// Unfortunately VS2013 does not support default move constructor, so we have
@@ -75,6 +88,7 @@ AppExport std::string quote(const std::string& input, bool toPython = false);
} \
_t& operator=(_t&& other)
class AppExport ObjectIdentifier
{
@@ -131,6 +145,10 @@ public:
}
/** Returns a possibly quoted string */
/**
* @brief Get a string representation of this object identifier.
* @return String representation.
*/
std::string toString(bool toPython = false) const;
// Operators
@@ -210,6 +228,13 @@ public:
return *this;
}
/**
* @brief Construct a Component part
* @param _name Name of component
* @param _type Type; simple, array, range or map
* @param _begin Array index or beginning of a Range, or INT_MAX for other type.
* @param _end ending of a Range, or INT_MAX for other type.
*/
Component(const String& _name = String(),
typeEnum _type = SIMPLE,
int begin = std::numeric_limits<int>::max(),
@@ -221,17 +246,45 @@ public:
int end = std::numeric_limits<int>::max(),
int step = 1); // explicit bombs
/**
* @brief Create a simple component part with the given name
* @param _component Name of component.
* @return A new Component object.
*/
static Component SimpleComponent(const char* _component);
/**
* @brief Create a simple component part with the given name
* @param _component Name of component.
* @return A new Component object.
*/
static Component SimpleComponent(const String& _component);
static Component SimpleComponent(String&& _component);
/**
* @brief Create an array component with given name and index.
* @param _component Name of component
* @param _index Index of component
* @return A new Component object.
*/
static Component ArrayComponent(int _index);
/**
* @brief Create a range component with given begin and end.
* @param _begin beginning index of the range
* @param _end ending index of the range
* @return A new Component object.
*/
static Component RangeComponent(int _begin,
int _end = std::numeric_limits<int>::max(),
int _step = 1);
/**
* @brief Create a map component with given name and key.
* @param _component Name of component
* @param _key Key of component
* @return A new Component object.
*/
static Component MapComponent(const String& _key);
static Component MapComponent(String&& _key);
@@ -259,6 +312,10 @@ public:
// Accessors
/**
* @brief Create a string representation of a component.
* @return A string representing the component.
*/
void toString(std::ostream& ss, bool toPython = false) const;
const std::string& getName() const
@@ -287,6 +344,11 @@ public:
// Operators
/**
* @brief Comparison operator for Component objects.
* @param other The object we want to compare to.
* @return true if they are equal, false if not.
*/
bool operator==(const Component& other) const;
bool operator<(const Component& other) const;
@@ -345,12 +407,22 @@ public:
return Component::MapComponent(_key);
}
/**
* @brief Construct an ObjectIdentifier object, given an owner and a single-value property.
* @param _owner Owner of property.
* @param property Name of property.
*/
explicit ObjectIdentifier(const App::PropertyContainer* _owner = nullptr,
const std::string& property = std::string(),
int index = std::numeric_limits<int>::max());
ObjectIdentifier(const App::PropertyContainer* _owner, bool localProperty);
/**
* @brief Construct an ObjectIdentifier object given a property. The property is assumed to be
* single-valued.
* @param prop Property to construct object identifier for.
*/
ObjectIdentifier(const App::Property& prop,
int index = std::numeric_limits<int>::max()); // explicit bombs
@@ -391,6 +463,10 @@ public:
_cache.clear();
}
/**
* @brief Get the name of the property.
* @return Name
*/
std::string getPropertyName() const;
template<typename C>
@@ -399,6 +475,12 @@ public:
components.insert(components.end(), cs.begin(), cs.end());
}
/**
* @brief Get Component at given index \a i.
* @param i: Index to get
* @param idx: optional return of adjusted component index
* @return A component.
*/
const Component& getPropertyComponent(int i, int* idx = nullptr) const;
void setComponent(int idx, Component&& comp);
@@ -412,28 +494,84 @@ public:
std::string getSubPathStr(bool toPython = false) const;
/**
* @brief Return number of components.
* @return Number of components in this identifier.
*/
int numComponents() const;
/**
* @brief Compute number of sub components, i.e excluding the property.
* @return Number of components.
*/
int numSubComponents() const;
/**
* @brief Create a string representation of this object identifier.
*
* An identifier is written as document#documentobject.property.subproperty1...subpropertyN
* document# may be dropped; it is assumed to be within owner's document. If documentobject is
* dropped, the property is assumed to be owned by the owner specified in the object identifiers
* constructor.
*
* @return A string
*/
const std::string& toString() const;
std::string toPersistentString() const;
/**
* @brief Escape toString representation so it is suitable for being embedded in a python command.
* @return Escaped string.
*/
std::string toEscapedString() const;
bool isTouched() const;
/**
* @brief Get pointer to property pointed to by this object identifier.
* @return Point to property if it is uniquely defined, or 0 otherwise.
*/
App::Property* getProperty(int* ptype = nullptr) const;
/**
* @brief Create a canonical representation of an object identifier.
*
* The main work is actually done by the property's virtual canonicalPath(...) method,
* which is invoked by this call.
*
* @return A new object identifier.
*/
App::ObjectIdentifier canonicalPath() const;
// Document-centric functions
/**
* @brief Set the document name for this object identifier.
*
* If force is true, the document name will always be included in the string representation.
*
* @param name Name of document object.
* @param force Force name to be set
*/
void setDocumentName(String&& name, bool force = false);
/**
* @brief Get the document name from this object identifier
*
* @return Document name as a String object.
*/
String getDocumentName() const;
/**
* @brief Set the document object name of this object identifier.
*
* If force is true, the document object will not be resolved dynamically from the
* object identifier's components, but used as given by this method.
*
* @param name Name of document object.
* @param force Force name to be set.
*/
void setDocumentObjectName(String&& name,
bool force = false,
String&& subname = String(),
@@ -451,6 +589,10 @@ public:
return localProperty;
}
/**
* @brief Get the document object name
* @return String with name of document object as resolved by object identifier.
*/
String getDocumentObjectName() const;
const std::string& getSubObjectName(bool newStyle) const;
@@ -506,12 +648,30 @@ public:
/// Returns all label references
void getDepLabels(std::vector<std::string>& labels) const;
/**
* @brief Find a document with the given name.
* @param name Name of document
* @return Pointer to document, or 0 if it is not found or not uniquely defined by name.
*/
App::Document* getDocument(String name = String(), bool* ambiguous = nullptr) const;
/**
* @brief Get the document object for the object identifier.
* @return Pointer to document object, or 0 if not found or uniquely defined.
*/
App::DocumentObject* getDocumentObject() const;
/**
* @brief Get components as a string list.
* @return List of strings.
*/
std::vector<std::string> getStringList() const;
/**
* @brief Construct the simplest possible object identifier relative to another.
* @param other The other object identifier.
* @return A new simplified object identifier.
*/
App::ObjectIdentifier relativeTo(const App::ObjectIdentifier& other) const;
bool replaceObject(ObjectIdentifier& res,
@@ -521,17 +681,49 @@ public:
// Operators
/**
* @brief << operator, used to add a component to the object identifier.
* @param value Component object
* @return Reference to itself.
*/
App::ObjectIdentifier& operator<<(const Component& value);
App::ObjectIdentifier& operator<<(Component&& value);
/**
* @brief Compare object identifier with \a other.
* @param other Other object identifier.
* @return true if they are equal.
*/
bool operator==(const ObjectIdentifier& other) const;
/**
* @brief Compare object identifier with \a other.
* @param other Other object identifier
* @return true if they differ from each other.
*/
bool operator!=(const ObjectIdentifier& other) const;
/**
* @brief Compare object identifier with other.
* @param other Other object identifier.
* @return true if this object is less than the other.
*/
bool operator<(const ObjectIdentifier& other) const;
// Getter
/**
* @brief Get the value of the property or field pointed to by this object identifier.
*
* All type of objects are supported. Some types are casted to FC native
* type, including: Int, Float, String, Unicode String, and Quantities. Others
* are just kept as Python object wrapped by App::any.
*
* @param pathValue: if true, calls the property's getPathValue(), which is
* necessary for Qunatities to work.
*
* @return The value of the property or field.
*/
App::any getValue(bool pathValue = false, bool* isPseudoProperty = nullptr) const;
Py::Object getPyValue(bool pathValue = false, bool* isPseudoProperty = nullptr) const;
@@ -539,10 +731,28 @@ public:
// Setter: is const because it does not alter the object state,
// but does have an aiding effect.
/**
* @brief Set value of a property or field pointed to by this object identifier.
*
* This method uses Python to do the actual work. and a limited set of types that
* can be in the App::any variable is supported: Base::Quantity, double,
* char*, const char*, int, unsigned int, short, unsigned short, char, and unsigned char.
*
* @param value Value to set
*/
void setValue(const App::any& value) const;
// Static functions
/**
* @brief Parse a string to create an object identifier.
*
* This method throws an exception if the string is invalid.
*
* @param docObj Document object that will own this object identifier.
* @param str String to parse
* @return A new object identifier.
*/
static ObjectIdentifier parse(const App::DocumentObject* docObj, const std::string& str);
std::string resolveErrorString() const;
@@ -563,6 +773,11 @@ protected:
struct ResolveResults
{
/** Construct and initialize a ResolveResults object, given an ObjectIdentifier instance.
*
* The constructor will invoke the ObjectIdentifier's resolve() method to initialize the object's
* data.
*/
explicit ResolveResults(const ObjectIdentifier& oi);
int propertyIndex {0};
@@ -588,15 +803,35 @@ protected:
App::DocumentObject*& sobj,
int& ptype) const;
/**
* @brief Get sub field part of a property as a string.
* @return String representation of path.
*/
void getSubPathStr(std::ostream& ss, const ResolveResults& result, bool toPython = false) const;
Py::Object access(const ResolveResults& rs,
Py::Object* value = nullptr,
Dependencies* deps = nullptr) const;
/**
* @brief Resolve the object identifier to a concrete document, documentobject, and property.
*
* This method is a helper method that fills out data in the given ResolveResults object.
*
*/
void resolve(ResolveResults& results) const;
void resolveAmbiguity(ResolveResults& results);
/**
* @brief Search for the document object given by name in doc.
*
* Name might be the internal name or a label. In any case, it must uniquely define
* the document object.
*
* @param doc Document to search
* @param name Name to search for.
* @return Pointer to document object if a unique pointer is found, 0 otherwise.
*/
static App::DocumentObject*
getDocumentObject(const App::Document* doc, const String& name, std::bitset<32>& flags);