NASA Astrobee Robot Software  0.19.1
Flight software for the Astrobee robots operating inside the International Space Station.
temp_monitor.h
Go to the documentation of this file.
1 /* Copyright (c) 2017, United States Government, as represented by the
2  * Administrator of the National Aeronautics and Space Administration.
3  *
4  * All rights reserved.
5  *
6  * The Astrobee platform is licensed under the Apache License, Version 2.0
7  * (the "License"); you may not use this file except in compliance with the
8  * License. You may obtain a copy of the License at
9  *
10  * http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing, software
13  * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
14  * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
15  * License for the specific language governing permissions and limitations
16  * under the License.
17  */
18 
19 #ifndef TEMP_MONITOR_TEMP_MONITOR_H_
20 #define TEMP_MONITOR_TEMP_MONITOR_H_
21 
22 #include <i2c/i2c_new.h>
23 
24 #include <string>
25 #include <memory>
26 #include <map>
27 #include <vector>
28 
29 namespace temp_monitor {
30 
31 // The abstract interface through which temperature data is made available
32 
33 class TempMonitor {
34  public:
35  explicit TempMonitor(i2c::Device const& device) : device_(device) {}
36  virtual bool GetTemperature(double *temp) = 0;
37  protected:
39 };
40 
41 typedef std::shared_ptr < TempMonitor > TempMonitorPtr;
42 
43 // The internal interface used by developers to register derived classes
44 
46  public:
47  static std::shared_ptr < TempMonitor > Create(std::string const& type, i2c::Device const& device);
48  static std::vector < std::string > Enumeration();
49 };
50 
51 } // namespace temp_monitor
52 
53 #endif // TEMP_MONITOR_TEMP_MONITOR_H_
temp_monitor::TempMonitorFactory::Create
static std::shared_ptr< TempMonitor > Create(std::string const &type, i2c::Device const &device)
Definition: temp_monitor.cc:26
temp_monitor::TempMonitorFactory
Definition: temp_monitor.h:45
temp_monitor
Definition: temp_monitor.h:29
temp_monitor::TempMonitor
Definition: temp_monitor.h:33
temp_monitor::TempMonitorFactory::Enumeration
static std::vector< std::string > Enumeration()
Definition: temp_monitor.cc:33
temp_monitor::TempMonitor::GetTemperature
virtual bool GetTemperature(double *temp)=0
temp_monitor::TempMonitor::device_
i2c::Device device_
Definition: temp_monitor.h:38
temp_monitor::TempMonitorPtr
std::shared_ptr< TempMonitor > TempMonitorPtr
Definition: temp_monitor.h:41
i2c_new.h
i2c::Device
Definition: i2c_new.h:82
temp_monitor::TempMonitor::TempMonitor
TempMonitor(i2c::Device const &device)
Definition: temp_monitor.h:35