From: <he...@us...> - 2008-12-19 18:14:31
|
Revision: 19 http://simspark.svn.sourceforge.net/simspark/?rev=19&view=rev Author: hedayat Date: 2008-12-19 18:12:56 +0000 (Fri, 19 Dec 2008) Log Message: ----------- Replaced make_shared() function calls with .lock() function call. Fixed compilation problem with recent boost versions. Modified Paths: -------------- trunk/spark/ChangeLog trunk/spark/lib/oxygen/agentaspect/effector.cpp trunk/spark/lib/oxygen/agentaspect/jointeffector.h trunk/spark/lib/oxygen/agentaspect/jointperceptor.h trunk/spark/lib/oxygen/physicsserver/body.cpp trunk/spark/lib/oxygen/physicsserver/bodycontroller.cpp trunk/spark/lib/oxygen/physicsserver/collider.cpp trunk/spark/lib/oxygen/physicsserver/collisionhandler.cpp trunk/spark/lib/oxygen/physicsserver/joint.cpp trunk/spark/lib/oxygen/sceneserver/basenode.cpp trunk/spark/lib/oxygen/sceneserver/fpscontroller.cpp trunk/spark/lib/oxygen/sceneserver/sceneserver.cpp trunk/spark/lib/oxygen/sceneserver/transform.cpp trunk/spark/lib/oxygen/simulationserver/simcontrolnode.cpp trunk/spark/lib/zeitgeist/class.cpp trunk/spark/lib/zeitgeist/core.cpp trunk/spark/lib/zeitgeist/leaf.cpp trunk/spark/lib/zeitgeist/leaf.h trunk/spark/lib/zeitgeist/node.cpp trunk/spark/lib/zeitgeist/node.h trunk/spark/plugin/forceeffector/forceeffector.cpp trunk/spark/plugin/perfectvisionperceptor/perfectvisionperceptor.cpp Modified: trunk/spark/ChangeLog =================================================================== --- trunk/spark/ChangeLog 2008-12-01 20:57:25 UTC (rev 18) +++ trunk/spark/ChangeLog 2008-12-19 18:12:56 UTC (rev 19) @@ -1,3 +1,28 @@ +2008-12-19 Hedayat Vatankhah <he...@gr...> + + * lib/oxygen/agentaspect/effector.cpp: + * lib/oxygen/agentaspect/jointeffector.h: + * lib/oxygen/agentaspect/jointperceptor.h: + * lib/oxygen/physicsserver/bodycontroller.cpp: + * lib/oxygen/physicsserver/collider.cpp: + * lib/oxygen/physicsserver/collisionhandler.cpp: + * lib/oxygen/physicsserver/joint.cpp: + * lib/oxygen/sceneserver/basenode.cpp: + * lib/oxygen/sceneserver/fpscontroller.cpp: + * lib/oxygen/simulationserver/simcontrolnode.cpp: + * lib/oxygen/sceneserver/transform.cpp: + * lib/oxygen/sceneserver/sceneserver.cpp: + * lib/oxygen/physicsserver/body.cpp: + * lib/zeitgeist/class.cpp: + * lib/zeitgeist/core.cpp: + * lib/zeitgeist/leaf.cpp: + * lib/zeitgeist/leaf.h: + * lib/zeitgeist/node.cpp: + * lib/zeitgeist/node.h: + * plugin/forceeffector/forceeffector.cpp: + * plugin/perfectvisionperceptor/perfectvisionperceptor.cpp: + - Replaced make_shared() with .lock() function call. + 2008-12-02 Hedayat Vatankhah <he...@gr...> * utility/libobj/CMakeLists.txt: Modified: trunk/spark/lib/oxygen/agentaspect/effector.cpp =================================================================== --- trunk/spark/lib/oxygen/agentaspect/effector.cpp 2008-12-01 20:57:25 UTC (rev 18) +++ trunk/spark/lib/oxygen/agentaspect/effector.cpp 2008-12-19 18:12:56 UTC (rev 19) @@ -30,7 +30,7 @@ Effector::GetAgentAspect() { return shared_static_cast<AgentAspect> - (make_shared(GetParentSupportingClass("AgentAspect"))); + (GetParentSupportingClass("AgentAspect").lock()); } bool Effector::Realize(boost::shared_ptr<ActionObject> action) Modified: trunk/spark/lib/oxygen/agentaspect/jointeffector.h =================================================================== --- trunk/spark/lib/oxygen/agentaspect/jointeffector.h 2008-12-01 20:57:25 UTC (rev 18) +++ trunk/spark/lib/oxygen/agentaspect/jointeffector.h 2008-12-19 18:12:56 UTC (rev 19) @@ -42,7 +42,7 @@ virtual void UpdateCached() { Effector::UpdateCached(); - mJoint = make_shared(FindParentSupportingClass<_JOINT>()); + mJoint = FindParentSupportingClass<_JOINT>().lock(); if (mJoint.get() == 0) { Modified: trunk/spark/lib/oxygen/agentaspect/jointperceptor.h =================================================================== --- trunk/spark/lib/oxygen/agentaspect/jointperceptor.h 2008-12-01 20:57:25 UTC (rev 18) +++ trunk/spark/lib/oxygen/agentaspect/jointperceptor.h 2008-12-19 18:12:56 UTC (rev 19) @@ -40,7 +40,7 @@ virtual void UpdateCached() { Perceptor::UpdateCached(); - mJoint = make_shared(FindParentSupportingClass<_JOINT>()); + mJoint = FindParentSupportingClass<_JOINT>().lock(); if (mJoint.get() == 0) { Modified: trunk/spark/lib/oxygen/physicsserver/body.cpp =================================================================== --- trunk/spark/lib/oxygen/physicsserver/body.cpp 2008-12-01 20:57:25 UTC (rev 18) +++ trunk/spark/lib/oxygen/physicsserver/body.cpp 2008-12-19 18:12:56 UTC (rev 19) @@ -126,7 +126,7 @@ dBodySetData(mODEBody, this); shared_ptr<BaseNode> baseNode = shared_static_cast<BaseNode> - (make_shared(GetParent())); + (GetParent().lock()); const Matrix& mat = baseNode->GetWorldTransform(); SetRotation(mat); @@ -425,7 +425,7 @@ const dReal* rot = dBodyGetRotation(mODEBody); shared_ptr<BaseNode> baseNode = shared_static_cast<BaseNode> - (make_shared(GetParent())); + (GetParent().lock()); Matrix mat; @@ -513,7 +513,7 @@ } shared_ptr<Body> body = shared_static_cast<Body> - (make_shared(bodyPtr->GetSelf())); + (bodyPtr->GetSelf().lock()); if (body.get() == 0) { Modified: trunk/spark/lib/oxygen/physicsserver/bodycontroller.cpp =================================================================== --- trunk/spark/lib/oxygen/physicsserver/bodycontroller.cpp 2008-12-01 20:57:25 UTC (rev 18) +++ trunk/spark/lib/oxygen/physicsserver/bodycontroller.cpp 2008-12-19 18:12:56 UTC (rev 19) @@ -43,7 +43,7 @@ mBody.reset(); mBody = shared_dynamic_cast<Body> - (make_shared(GetParentSupportingClass("Body"))); + (GetParentSupportingClass("Body").lock()); if (mBody.get() == 0) { Modified: trunk/spark/lib/oxygen/physicsserver/collider.cpp =================================================================== --- trunk/spark/lib/oxygen/physicsserver/collider.cpp 2008-12-01 20:57:25 UTC (rev 18) +++ trunk/spark/lib/oxygen/physicsserver/collider.cpp 2008-12-19 18:12:56 UTC (rev 19) @@ -194,7 +194,7 @@ } shared_ptr<Collider> collider = shared_static_cast<Collider> - (make_shared(collPtr->GetSelf())); + (collPtr->GetSelf().lock()); if (collider.get() == 0) { Modified: trunk/spark/lib/oxygen/physicsserver/collisionhandler.cpp =================================================================== --- trunk/spark/lib/oxygen/physicsserver/collisionhandler.cpp 2008-12-01 20:57:25 UTC (rev 18) +++ trunk/spark/lib/oxygen/physicsserver/collisionhandler.cpp 2008-12-19 18:12:56 UTC (rev 19) @@ -69,7 +69,7 @@ << "(CollisionHandler) found no Space node\n"; } - mCollider = shared_static_cast<Collider>(make_shared(GetParent())); + mCollider = shared_static_cast<Collider>(GetParent().lock()); if (mCollider.get() == 0) { GetLog()->Debug() Modified: trunk/spark/lib/oxygen/physicsserver/joint.cpp =================================================================== --- trunk/spark/lib/oxygen/physicsserver/joint.cpp 2008-12-01 20:57:25 UTC (rev 18) +++ trunk/spark/lib/oxygen/physicsserver/joint.cpp 2008-12-19 18:12:56 UTC (rev 19) @@ -66,7 +66,7 @@ } shared_ptr<Joint> joint = shared_static_cast<Joint> - (make_shared(jointPtr->GetSelf())); + (jointPtr->GetSelf().lock()); if (joint.get() == 0) { @@ -126,7 +126,7 @@ } shared_ptr<Leaf> mySelf = shared_static_cast<Leaf> - (make_shared(GetSelf())); + (GetSelf().lock()); shared_ptr<Leaf> leaf = GetCore()->Get(path,mySelf); Modified: trunk/spark/lib/oxygen/sceneserver/basenode.cpp =================================================================== --- trunk/spark/lib/oxygen/sceneserver/basenode.cpp 2008-12-01 20:57:25 UTC (rev 18) +++ trunk/spark/lib/oxygen/sceneserver/basenode.cpp 2008-12-19 18:12:56 UTC (rev 19) @@ -153,7 +153,7 @@ } // move up the hierarchy until we find a scene node - return make_shared(FindParentSupportingClass<Scene>()); + return FindParentSupportingClass<Scene>().lock(); } void BaseNode::EnableDebugMode() Modified: trunk/spark/lib/oxygen/sceneserver/fpscontroller.cpp =================================================================== --- trunk/spark/lib/oxygen/sceneserver/fpscontroller.cpp 2008-12-01 20:57:25 UTC (rev 18) +++ trunk/spark/lib/oxygen/sceneserver/fpscontroller.cpp 2008-12-19 18:12:56 UTC (rev 19) @@ -161,7 +161,7 @@ mBody->SetVelocity(velocity); shared_ptr<BaseNode> bodyParent = shared_static_cast<BaseNode> - (make_shared(mBody->GetParent())); + (mBody->GetParent().lock()); if (bodyParent.get() != 0) { Modified: trunk/spark/lib/oxygen/sceneserver/sceneserver.cpp =================================================================== --- trunk/spark/lib/oxygen/sceneserver/sceneserver.cpp 2008-12-01 20:57:25 UTC (rev 18) +++ trunk/spark/lib/oxygen/sceneserver/sceneserver.cpp 2008-12-19 18:12:56 UTC (rev 19) @@ -297,7 +297,7 @@ void SceneServer::ReparentTransformChildren(shared_ptr<Transform> node) { shared_ptr<BaseNode> parent = - shared_dynamic_cast<BaseNode>(make_shared(node->GetParent())); + shared_dynamic_cast<BaseNode>(node->GetParent().lock()); // while not empty while (node->begin() != node->end()) Modified: trunk/spark/lib/oxygen/sceneserver/transform.cpp =================================================================== --- trunk/spark/lib/oxygen/sceneserver/transform.cpp 2008-12-01 20:57:25 UTC (rev 18) +++ trunk/spark/lib/oxygen/sceneserver/transform.cpp 2008-12-19 18:12:56 UTC (rev 19) @@ -66,7 +66,7 @@ void Transform::SetWorldTransform(const salt::Matrix &transform) { shared_ptr<BaseNode> parent = shared_static_cast<BaseNode> - (make_shared(mParent)); + (mParent.lock()); if (parent.get() == 0) { @@ -122,7 +122,7 @@ void Transform::UpdateHierarchyInternal() { - shared_ptr<BaseNode> parent = shared_static_cast<BaseNode>(make_shared(mParent)); + shared_ptr<BaseNode> parent = shared_static_cast<BaseNode>(mParent.lock()); // no parent, return local transform if (parent.get() == NULL) Modified: trunk/spark/lib/oxygen/simulationserver/simcontrolnode.cpp =================================================================== --- trunk/spark/lib/oxygen/simulationserver/simcontrolnode.cpp 2008-12-01 20:57:25 UTC (rev 18) +++ trunk/spark/lib/oxygen/simulationserver/simcontrolnode.cpp 2008-12-19 18:12:56 UTC (rev 19) @@ -40,7 +40,7 @@ shared_ptr<SimulationServer> SimControlNode::GetSimulationServer() { return shared_static_cast<SimulationServer> - (make_shared(GetParent())); + (GetParent().lock()); } void SimControlNode::SetSimTime( float now ) Modified: trunk/spark/lib/zeitgeist/class.cpp =================================================================== --- trunk/spark/lib/zeitgeist/class.cpp 2008-12-01 20:57:25 UTC (rev 18) +++ trunk/spark/lib/zeitgeist/class.cpp 2008-12-19 18:12:56 UTC (rev 19) @@ -62,7 +62,7 @@ if (obj.get()) { if (obj->Construct(obj, shared_static_cast<Class> - (make_shared(GetSelf()))) == true) + (GetSelf().lock())) == true) { // successfully constructed AttachInstance(obj); @@ -85,7 +85,7 @@ } - return make_shared(mCore); + return mCore.lock(); } void Class::AttachInstance(const boost::weak_ptr<Object> &instance) Modified: trunk/spark/lib/zeitgeist/core.cpp =================================================================== --- trunk/spark/lib/zeitgeist/core.cpp 2008-12-01 20:57:25 UTC (rev 18) +++ trunk/spark/lib/zeitgeist/core.cpp 2008-12-19 18:12:56 UTC (rev 19) @@ -232,7 +232,7 @@ boost::shared_ptr<CoreContext> Core::CreateContext() { - return shared_ptr<CoreContext>(new CoreContext(make_shared(mSelf), GetRoot())); + return shared_ptr<CoreContext>(new CoreContext(mSelf.lock(), GetRoot())); } boost::shared_ptr<Object> Modified: trunk/spark/lib/zeitgeist/leaf.cpp =================================================================== --- trunk/spark/lib/zeitgeist/leaf.cpp 2008-12-01 20:57:25 UTC (rev 18) +++ trunk/spark/lib/zeitgeist/leaf.cpp 2008-12-19 18:12:56 UTC (rev 19) @@ -51,13 +51,13 @@ { if (name.compare("..") == 0) { - return make_shared(GetParent()); + return GetParent().lock(); } if (name.compare(".") == 0) { - return shared_static_cast<Leaf>(make_shared(GetSelf())); + return shared_static_cast<Leaf>(GetSelf().lock()); } return boost::shared_ptr<Leaf>(); @@ -77,12 +77,12 @@ { if (name.compare("..") == 0) { - baseList.push_back(make_shared(GetParent())); + baseList.push_back(GetParent().lock()); } if (name.compare(".") == 0) { - baseList.push_back(shared_static_cast<Leaf>(make_shared(GetSelf()))); + baseList.push_back(shared_static_cast<Leaf>(GetSelf().lock())); } } @@ -98,7 +98,7 @@ Leaf::GetParentSupportingClass(const std::string &name) const { shared_ptr<Node> node - = shared_static_cast<Node>(make_shared(GetParent())); + = shared_static_cast<Node>(GetParent().lock()); while ( @@ -107,7 +107,7 @@ (! node->GetClass()->SupportsClass(name)) ) { - node = make_shared(node->GetParent()); + node = node->GetParent().lock(); } return weak_ptr<Node>(node); @@ -160,7 +160,7 @@ { if (p) { - shared_ptr<Leaf> blah = make_shared(GetParent()); + shared_ptr<Leaf> blah = GetParent().lock(); parentPath = blah->GetFullPath(); } } Modified: trunk/spark/lib/zeitgeist/leaf.h =================================================================== --- trunk/spark/lib/zeitgeist/leaf.h 2008-12-01 20:57:25 UTC (rev 18) +++ trunk/spark/lib/zeitgeist/leaf.h 2008-12-19 18:12:56 UTC (rev 19) @@ -199,7 +199,7 @@ FindParentSupportingClass() const; // { // boost::shared_ptr<Node> node -// = boost::shared_static_cast<Node>(make_shared(GetParent())); +// = boost::shared_static_cast<Node>(GetParent().lock()); // while (node.get() != 0) // { @@ -211,7 +211,7 @@ // return test; // } -// node = boost::shared_static_cast<Node>(make_shared(node->GetParent())); +// node = boost::shared_static_cast<Node>(node->GetParent().lock()); // } // return boost::shared_ptr<CLASS>(); Modified: trunk/spark/lib/zeitgeist/node.cpp =================================================================== --- trunk/spark/lib/zeitgeist/node.cpp 2008-12-01 20:57:25 UTC (rev 18) +++ trunk/spark/lib/zeitgeist/node.cpp 2008-12-19 18:12:56 UTC (rev 19) @@ -232,7 +232,7 @@ } mChildren.push_back(leaf); - leaf->SetParent(shared_static_cast<Node>(make_shared(GetSelf()))); + leaf->SetParent(shared_static_cast<Node>(GetSelf().lock())); return true; } Modified: trunk/spark/lib/zeitgeist/node.h =================================================================== --- trunk/spark/lib/zeitgeist/node.h 2008-12-01 20:57:25 UTC (rev 18) +++ trunk/spark/lib/zeitgeist/node.h 2008-12-19 18:12:56 UTC (rev 19) @@ -132,7 +132,7 @@ Leaf::FindParentSupportingClass() const { boost::shared_ptr<Node> node - = boost::shared_static_cast<Node>(make_shared(GetParent())); + = boost::shared_static_cast<Node>(GetParent().lock()); while (node.get() != 0) { @@ -144,7 +144,7 @@ return test; } - //node = boost::shared_static_cast<Node>(make_shared(node->GetParent())); + //node = boost::shared_static_cast<Node>(node->GetParent().lock()); node = boost::shared_static_cast<Node>(node->GetParent().lock()); } Modified: trunk/spark/plugin/forceeffector/forceeffector.cpp =================================================================== --- trunk/spark/plugin/forceeffector/forceeffector.cpp 2008-12-01 20:57:25 UTC (rev 18) +++ trunk/spark/plugin/forceeffector/forceeffector.cpp 2008-12-19 18:12:56 UTC (rev 19) @@ -83,7 +83,7 @@ void ForceEffector::OnLink() { shared_ptr<BaseNode> parent = - shared_dynamic_cast<BaseNode>(make_shared(GetParent())); + shared_dynamic_cast<BaseNode>(GetParent().lock()); if (parent.get() == 0) { Modified: trunk/spark/plugin/perfectvisionperceptor/perfectvisionperceptor.cpp =================================================================== --- trunk/spark/plugin/perfectvisionperceptor/perfectvisionperceptor.cpp 2008-12-01 20:57:25 UTC (rev 18) +++ trunk/spark/plugin/perfectvisionperceptor/perfectvisionperceptor.cpp 2008-12-19 18:12:56 UTC (rev 19) @@ -71,7 +71,7 @@ // we want positions relative to the closest parent transform node shared_ptr<Transform> parent = shared_dynamic_cast<Transform> - (make_shared(FindParentSupportingClass<Transform>())); + (FindParentSupportingClass<Transform>().lock()); salt::Vector3f myPos(0,0,0); if (parent.get() == 0) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |