Logo Search packages:      
Sourcecode: lttoolbox version File versions  Download package

void State::copy ( State const &  s  )  [private]

Copy function

Parameters:
s the state to be copied

Definition at line 67 of file State.C.

References Pool< T >::get(), pool, Pool< T >::release(), and state.

Referenced by operator=(), and State().

{
  // release references
  for(multimap<Node *, vector<unsigned short> *>::iterator it = state.begin(),
                                                           limit = state.end();
      it != limit; it++)
  {
    pool.release(it->second);
  }

  state = s.state;

  for(multimap<Node *, vector<unsigned short> *>::iterator it = state.begin(),
                                                           limit = state.end();
      it != state.end(); it++)
  {
    vector<unsigned short> *tmp = pool.get();
    *tmp = *(it->second);
    it->second = tmp;
  }
}


Generated by  Doxygen 1.6.0   Back to index