TransitionMap.h
Go to the documentation of this file.
1 /*
2  * Copyright 2015-2019 CNRS-UM LIRMM, CNRS-AIST JRL
3  */
4 
5 #pragma once
6 
9 
10 #include <map>
11 #include <string>
12 #include <unordered_set>
13 
14 namespace mc_control
15 {
16 
17 namespace fsm
18 {
19 
44 {
46  using origin_t = std::pair<std::string, std::string>;
47 
61  std::pair<bool, Transition> transition(const std::string & state, const std::string & output) const;
62 
64  std::unordered_set<std::string> transitions(const std::string & state) const;
65 
80  void init(const StateFactory & factory, const mc_rtc::Configuration & config);
81 
83  const std::string & initState() const;
84 
86  std::ostream & print(std::ostream & os) const;
87 
88 private:
89  std::string init_state_;
90  std::map<origin_t, Transition> map_;
91 };
92 
93 } // namespace fsm
94 
95 } // namespace mc_control
mc_rtc::Configuration
Simplify access to values hold within a JSON file.
Definition: Configuration.h:165
MC_CONTROL_FSM_DLLAPI
#define MC_CONTROL_FSM_DLLAPI
Definition: api.h:50
mc_control::fsm::StateFactory
Definition: StateFactory.h:32
mc_control::fsm::TransitionMap
Definition: TransitionMap.h:43
Transition.h
StateFactory.h
mc_control
Definition: CompletionCriteria.h:10
mc_control::fsm::TransitionMap::origin_t
std::pair< std::string, std::string > origin_t
Definition: TransitionMap.h:46