$darkmode
rdb_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  */
24 #pragma once
25 
26 #include <memory> // for shared_ptr<>
27 #include <vector> // for vector<>
28 #ifdef VTD_API_2_2_0
29  #include <viRDBIcd.h> // for RDB_MSG_t
30 #else
31  #include <VtdToolkit/viRDBIcd.h>
32 #endif
33 #include <cloe/core.hpp> // for Json, Error
34 
35 namespace vtd {
36 
44 class RdbError : public cloe::Error {
45  public:
46  using Error::Error;
47  virtual ~RdbError() noexcept = default;
48 };
49 
57  public:
58  virtual ~RdbTransceiver() = default;
59 
66  virtual bool has() const = 0;
67 
71  virtual std::vector<std::shared_ptr<RDB_MSG_t>> receive() = 0;
72 
79  virtual void send(const RDB_MSG_t* msg, size_t size) = 0;
80 
81  virtual void to_json(cloe::Json& j) const = 0;
82 
83  friend void to_json(cloe::Json& j, const RdbTransceiver& t) { t.to_json(j); }
84 };
85 
86 } // namespace vtd
Definition: rdb_transceiver.hpp:44
Definition: actuator_component.hpp:35
Definition: error.hpp:35
Definition: rdb_transceiver.hpp:56