Aikido
ScopedState-impl.hpp
Go to the documentation of this file.
2 
3 namespace aikido {
4 namespace statespace {
5 
6 //==============================================================================
7 template <class Handle>
9 {
10  this->mSpace = _space;
11  mBuffer.reset(new char[_space->getStateSizeInBytes()]);
12  this->mState = static_cast<ScopedState::State*>(
13  _space->allocateStateInBuffer(mBuffer.get()));
14 }
15 
16 //==============================================================================
17 template <class Handle>
19 {
20  this->mSpace->freeStateInBuffer(this->mState);
21 }
22 
23 //==============================================================================
24 template <class Handle>
26 {
27  return this->mSpace->cloneState(this->mState);
28 }
29 
30 } // namespace statespace
31 } // namespace aikido
aikido::statespace::ScopedState::~ScopedState
virtual ~ScopedState()
Definition: ScopedState-impl.hpp:18
aikido
Format of serialized trajectory in YAML.
Definition: algorithm.hpp:4
aikido::statespace::ScopedState::ScopedState
ScopedState(const StateSpace *_space)
Construct a ScopedState by allocating a new state in _space.
Definition: ScopedState-impl.hpp:8
mSpace
std::shared_ptr< const statespace::R< N > > mSpace
Definition: RnConstantSampler-impl.hpp:46
aikido::statespace::ScopedState
CRTP RAII wrapper for a StateHandle.
Definition: ScopedState.hpp:15
aikido::statespace::ScopedState::clone
ScopedState clone() const
Creates an identical clone of the state this ScopedState handles.
Definition: ScopedState-impl.hpp:25
aikido::statespace::StateHandle::StateSpace
_StateSpace StateSpace
Definition: StateHandle.hpp:19
ScopedState.hpp