$darkmode
osi_transceiver.hpp
Go to the documentation of this file.
1 /*
2  * Copyright 2020 Robert Bosch GmbH
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  * SPDX-License-Identifier: Apache-2.0
17  */
23 #pragma once
24 
25 #include <memory> // for shared_ptr<>
26 #include <vector> // for vector<>
27 
28 #include <cloe/core.hpp> // for Json, Error
29 
30 #include <osi_sensordata.pb.h> // for SensorData
31 
32 namespace osii {
33 
41 class OsiError : public cloe::Error {
42  public:
43  using Error::Error;
44  virtual ~OsiError() noexcept = default;
45 };
46 
51  public:
52  virtual ~OsiTransceiver() = default;
53 
61  virtual bool has_sensor_data() const = 0;
62 
66  virtual std::vector<std::shared_ptr<osi3::SensorData>> receive_sensor_data() = 0;
67 
68  virtual void to_json(cloe::Json& j) const = 0;
69 
70  friend void to_json(cloe::Json& j, const OsiTransceiver& t) { t.to_json(j); }
71 };
72 
73 } // namespace osii
Definition: error.hpp:35
Definition: osi_transceiver.hpp:41
Definition: osi_transceiver.hpp:50
virtual std::vector< std::shared_ptr< osi3::SensorData > > receive_sensor_data()=0
virtual bool has_sensor_data() const =0