Aikido
ScopedState.hpp
Go to the documentation of this file.
1 #ifndef AIKIDO_STATESPACE_SCOPEDSTATE_HPP_
2 #define AIKIDO_STATESPACE_SCOPEDSTATE_HPP_
3 #include <memory>
4 
6 
7 namespace aikido {
8 namespace statespace {
9 
14 template <class _Handle>
15 class ScopedState : public _Handle
16 {
17 public:
18  using Handle = _Handle;
19  using typename Handle::QualifiedState;
20  using typename Handle::State;
21  using typename Handle::StateSpace;
22 
27  explicit ScopedState(const StateSpace* _space);
28 
29  virtual ~ScopedState();
30 
31  // ScopedState is uncopyable, must use std::move
32  ScopedState(const ScopedState&) = delete;
33  ScopedState& operator=(const ScopedState&) = delete;
34 
35  ScopedState(ScopedState&&) = default;
36  ScopedState& operator=(ScopedState&&) = default;
37 
39  ScopedState clone() const;
40 
41 private:
42  std::unique_ptr<char[]> mBuffer;
43 };
44 
45 } // namespace statespace
46 } // namespace aikido
47 
49 
50 #endif // ifndef AIKIDO_STATESPACE_SCOPEDSTATE_HPP_
aikido::statespace::ScopedState::operator=
ScopedState & operator=(const ScopedState &)=delete
aikido::statespace::ScopedState::~ScopedState
virtual ~ScopedState()
Definition: ScopedState-impl.hpp:18
aikido
Format of serialized trajectory in YAML.
Definition: algorithm.hpp:4
StateHandle.hpp
aikido::statespace::ScopedState::ScopedState
ScopedState(const StateSpace *_space)
Construct a ScopedState by allocating a new state in _space.
Definition: ScopedState-impl.hpp:8
aikido::statespace::SE2
The two-dimensional special Euclidean group SE(2), i.e.
Definition: SE2.hpp:19
aikido::statespace::StateHandle
Wrap a State with its StateSpace to provide convenient accessor methods.
Definition: StateHandle.hpp:16
ScopedState-impl.hpp
aikido::statespace::ScopedState
CRTP RAII wrapper for a StateHandle.
Definition: ScopedState.hpp:15
aikido::statespace::StateHandle::QualifiedState
_QualifiedState QualifiedState
Definition: StateHandle.hpp:20
aikido::statespace::ScopedState::mBuffer
std::unique_ptr< char[]> mBuffer
Definition: ScopedState.hpp:42
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
aikido::statespace::StateHandle::State
typename StateSpace::State State
Definition: StateHandle.hpp:22