diff --git a/include/hpp/manipulation/graph/statistics.hh b/include/hpp/manipulation/graph/statistics.hh index b58156f18591a1a807ef92f665da85c7e23b3291..9755b713e4b9679e3470698f46df5e9dcee65e3b 100644 --- a/include/hpp/manipulation/graph/statistics.hh +++ b/include/hpp/manipulation/graph/statistics.hh @@ -84,7 +84,7 @@ namespace hpp { std::ostream& print (std::ostream& os) const; private: - StatePtr_t state_; + StateWkPtr_t state_; typedef std::list <RoadmapNodePtr_t> RoadmapNodes_t; RoadmapNodes_t roadmapNodes_; @@ -193,7 +193,7 @@ namespace hpp { private: /// The constraint graph - graph::GraphPtr_t graph_; + graph::GraphWkPtr_t graph_; }; typedef StateHistogram NodeHistogram HPP_MANIPULATION_DEPRECATED; typedef boost::shared_ptr <StateHistogram> NodeHistogramPtr_t; diff --git a/include/hpp/manipulation/roadmap-node.hh b/include/hpp/manipulation/roadmap-node.hh index a6e728997a99c7978bc54a66244e59c1f02922d0..e4de416f258bdd85232d60975ff50da554cc049b 100644 --- a/include/hpp/manipulation/roadmap-node.hh +++ b/include/hpp/manipulation/roadmap-node.hh @@ -66,13 +66,13 @@ namespace hpp { /// \deprecated use graphState instead. graph::StatePtr_t graphNode () const HPP_MANIPULATION_DEPRECATED { - return state_; + return state_.lock(); } /// Getter for the graph::State. graph::StatePtr_t graphState () const { - return state_; + return state_.lock(); } /// Setter for the graph::State. @@ -97,16 +97,16 @@ namespace hpp { symbolicCC_ = sc; } - const SymbolicComponentPtr_t& symbolicComponent () const + SymbolicComponentPtr_t symbolicComponent () const { - return symbolicCC_; + return symbolicCC_.lock(); } private: CachingSystem cacheSystem_; - graph::StatePtr_t state_; - SymbolicComponentPtr_t symbolicCC_; + graph::StateWkPtr_t state_; + SymbolicComponentWkPtr_t symbolicCC_; }; } // namespace manipulation } // namespace hpp diff --git a/include/hpp/manipulation/symbolic-component.hh b/include/hpp/manipulation/symbolic-component.hh index 7da561c7431f17f5087e627cdd35fcea5272d0d5..da122d513dc5ac0a0b6c553e11b7f5197c5fcd13 100644 --- a/include/hpp/manipulation/symbolic-component.hh +++ b/include/hpp/manipulation/symbolic-component.hh @@ -81,7 +81,7 @@ namespace hpp { RoadmapNodes_t nodes_; private: - RoadmapPtr_t roadmap_; + RoadmapWkPtr_t roadmap_; SymbolicComponents_t to_, from_; SymbolicComponentWkPtr_t weak_; }; // class SymbolicComponent diff --git a/src/graph/statistics.cc b/src/graph/statistics.cc index cd73d9641232ef60bac033a075ade2cfaf3367e2..fec9efab49ad158eaa76cf207fcaa1618d7957b4 100644 --- a/src/graph/statistics.cc +++ b/src/graph/statistics.cc @@ -109,17 +109,17 @@ namespace hpp { bool NodeBin::operator<(const NodeBin& rhs) const { - return state_->id () < rhs.state ()->id (); + return state()->id () < rhs.state ()->id (); } bool NodeBin::operator==(const NodeBin& rhs) const { - return state_ == rhs.state (); + return state() == rhs.state (); } const StatePtr_t& NodeBin::state () const { - return state_; + return state_.lock(); } std::ostream& NodeBin::print (std::ostream& os) const @@ -152,7 +152,7 @@ namespace hpp { std::ostream& NodeBin::printValue (std::ostream& os) const { - return os << "NodeBin (" << state_->name () << ")"; + return os << "NodeBin (" << state()->name () << ")"; } LeafHistogramPtr_t LeafHistogram::create (const Foliation f) @@ -198,7 +198,7 @@ namespace hpp { void StateHistogram::add (const RoadmapNodePtr_t& n) { - iterator it = insert (NodeBin (graph_->getState (n))); + iterator it = insert (NodeBin (constraintGraph()->getState (n))); it->push_back (n); if (numberOfObservations()%10 == 0) { hppDout (info, *this); @@ -213,12 +213,12 @@ namespace hpp { const graph::GraphPtr_t& StateHistogram::constraintGraph () const { - return graph_; + return graph_.lock(); } HistogramPtr_t StateHistogram::clone () const { - return HistogramPtr_t (new StateHistogram (graph_)); + return HistogramPtr_t (new StateHistogram (constraintGraph())); } unsigned int LeafBin::numberOfObsOutOfConnectedComponent (const core::ConnectedComponentPtr_t& cc) const diff --git a/src/symbolic-component.cc b/src/symbolic-component.cc index 6b4da162cfd7b401762b1c36f96631f535f7c421..8de3e738223360648c757e05ecc04c331e8ff093 100644 --- a/src/symbolic-component.cc +++ b/src/symbolic-component.cc @@ -32,7 +32,7 @@ namespace hpp { void SymbolicComponent::addNode (const RoadmapNodePtr_t& node) { assert(state_); - graph::StatePtr_t state = roadmap_->getState(node); + graph::StatePtr_t state = roadmap_.lock()->getState(node); // Sanity check if (state_ == state) // Oops @@ -44,7 +44,7 @@ namespace hpp { void SymbolicComponent::setFirstNode (const RoadmapNodePtr_t& node) { assert(!state_); - state_ = roadmap_->getState(node); + state_ = roadmap_.lock()->getState(node); nodes_.push_back(node); }