|
@@ -390,6 +390,7 @@ LazyObject::LazyObject(uint64_t id, const Element& element, const Document& doc)
|
|
: doc(doc)
|
|
: doc(doc)
|
|
, element(element)
|
|
, element(element)
|
|
, id(id)
|
|
, id(id)
|
|
|
|
+, being_constructed()
|
|
{
|
|
{
|
|
|
|
|
|
}
|
|
}
|
|
@@ -425,7 +426,8 @@ const Object* LazyObject::Get()
|
|
DOMError(err,&element);
|
|
DOMError(err,&element);
|
|
}
|
|
}
|
|
|
|
|
|
- // XXX prevent recursive calls
|
|
|
|
|
|
+ // prevent recursive calls
|
|
|
|
+ being_constructed = true;
|
|
|
|
|
|
// this needs to be relatively fast since it happens a lot,
|
|
// this needs to be relatively fast since it happens a lot,
|
|
// so avoid constructing strings all the time.
|
|
// so avoid constructing strings all the time.
|
|
@@ -462,6 +464,7 @@ const Object* LazyObject::Get()
|
|
//DOMError("failed to convert element to DOM object, class: " + classtag + ", name: " + name,&element);
|
|
//DOMError("failed to convert element to DOM object, class: " + classtag + ", name: " + name,&element);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ being_constructed = false;
|
|
return object.get();
|
|
return object.get();
|
|
}
|
|
}
|
|
|
|
|
|
@@ -697,6 +700,7 @@ void Document::ReadConnections()
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+
|
|
// ------------------------------------------------------------------------------------------------
|
|
// ------------------------------------------------------------------------------------------------
|
|
const std::vector<const AnimationStack*>& Document::AnimationStacks() const
|
|
const std::vector<const AnimationStack*>& Document::AnimationStacks() const
|
|
{
|
|
{
|
|
@@ -718,6 +722,7 @@ const std::vector<const AnimationStack*>& Document::AnimationStacks() const
|
|
return animationStacksResolved;
|
|
return animationStacksResolved;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+
|
|
// ------------------------------------------------------------------------------------------------
|
|
// ------------------------------------------------------------------------------------------------
|
|
LazyObject* Document::GetObject(uint64_t id) const
|
|
LazyObject* Document::GetObject(uint64_t id) const
|
|
{
|
|
{
|
|
@@ -725,6 +730,7 @@ LazyObject* Document::GetObject(uint64_t id) const
|
|
return it == objects.end() ? NULL : (*it).second;
|
|
return it == objects.end() ? NULL : (*it).second;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+
|
|
// ------------------------------------------------------------------------------------------------
|
|
// ------------------------------------------------------------------------------------------------
|
|
std::vector<const Connection*> Document::GetConnectionsBySourceSequenced(uint64_t source) const
|
|
std::vector<const Connection*> Document::GetConnectionsBySourceSequenced(uint64_t source) const
|
|
{
|
|
{
|
|
@@ -762,6 +768,7 @@ std::vector<const Connection*> Document::GetConnectionsByDestinationSequenced(ui
|
|
return temp; // NRVO should handle this
|
|
return temp; // NRVO should handle this
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+
|
|
// ------------------------------------------------------------------------------------------------
|
|
// ------------------------------------------------------------------------------------------------
|
|
Connection::Connection(uint64_t insertionOrder, uint64_t src, uint64_t dest, const std::string& prop, const Document& doc)
|
|
Connection::Connection(uint64_t insertionOrder, uint64_t src, uint64_t dest, const std::string& prop, const Document& doc)
|
|
: insertionOrder(insertionOrder)
|
|
: insertionOrder(insertionOrder)
|
|
@@ -783,6 +790,24 @@ Connection::~Connection()
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
+// ------------------------------------------------------------------------------------------------
|
|
|
|
+LazyObject& Connection::LazySourceObject() const
|
|
|
|
+{
|
|
|
|
+ LazyObject* const lazy = doc.GetObject(src);
|
|
|
|
+ ai_assert(lazy);
|
|
|
|
+ return *lazy;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+// ------------------------------------------------------------------------------------------------
|
|
|
|
+LazyObject& Connection::LazyDestinationObject() const
|
|
|
|
+{
|
|
|
|
+ LazyObject* const lazy = doc.GetObject(dest);
|
|
|
|
+ ai_assert(lazy);
|
|
|
|
+ return *lazy;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+
|
|
// ------------------------------------------------------------------------------------------------
|
|
// ------------------------------------------------------------------------------------------------
|
|
const Object* Connection::SourceObject() const
|
|
const Object* Connection::SourceObject() const
|
|
{
|
|
{
|
|
@@ -791,6 +816,7 @@ const Object* Connection::SourceObject() const
|
|
return lazy->Get();
|
|
return lazy->Get();
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+
|
|
// ------------------------------------------------------------------------------------------------
|
|
// ------------------------------------------------------------------------------------------------
|
|
const Object* Connection::DestinationObject() const
|
|
const Object* Connection::DestinationObject() const
|
|
{
|
|
{
|