converter_base.hpp
Go to the documentation of this file.
1 /*
2  * Copyright 2015 Aldebaran
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  *
16 */
17 
18 #ifndef BASE_CONVERTER_HPP
19 #define BASE_CONVERTER_HPP
20 
21 /*
22 * LOCAL includes
23 */
24 #include <naoqi_driver/tools.hpp>
25 #include "../helpers/driver_helpers.hpp"
26 
27 /*
28 * ALDEBARAN includes
29 */
30 #include <qi/session.hpp>
31 #include <qi/anyobject.hpp>
32 
33 namespace naoqi
34 {
35 namespace converter
36 {
37 
38 // CRTP
39 template<class T>
41 {
42 
43 public:
44  BaseConverter( const std::string& name, float frequency, qi::SessionPtr session ):
45  name_( name ),
46  frequency_( frequency ),
47  robot_( helpers::driver::getRobot(session) ),
48  session_(session),
49  record_enabled_(false)
50  {}
51 
52  virtual ~BaseConverter() {}
53 
54  inline std::string name() const
55  {
56  return name_;
57  }
58 
59  inline float frequency() const
60  {
61  return frequency_;
62  }
63 
64 protected:
65  std::string name_;
66 
68  float frequency_;
71 
73  qi::SessionPtr session_;
74 
77 }; // class
78 
79 } // converter
80 } // naoqi
81 
82 #endif
BaseConverter(const std::string &name, float frequency, qi::SessionPtr session)
const robot::Robot & getRobot(const qi::SessionPtr &session)


naoqi_driver
Author(s): Karsten Knese
autogenerated on Sat Feb 15 2020 03:24:26