$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 
29 #include <cloe/core.hpp> // for Json, Error
30 
31 #include "vtd_version.hpp"
32 #if (VTD_API_VERSION_EPOCH == 0)
33  #include <viRDBIcd.h> // for RDB_MSG_t
34 #else
35  #include <VtdToolkit/viRDBIcd.h>
36 #endif
37 
38 namespace vtd {
39 
47 class RdbError : public cloe::Error {
48  public:
49  using Error::Error;
50  virtual ~RdbError() noexcept = default;
51 };
52 
60  public:
61  virtual ~RdbTransceiver() = default;
62 
69  virtual bool has() const = 0;
70 
74  virtual std::vector<std::shared_ptr<RDB_MSG_t>> receive() = 0;
75 
82  virtual void send(const RDB_MSG_t* msg, size_t size) = 0;
83 
84  virtual void to_json(cloe::Json& j) const = 0;
85 
86  friend void to_json(cloe::Json& j, const RdbTransceiver& t) { t.to_json(j); }
87 };
88 
89 } // namespace vtd
Definition: error.hpp:35
Definition: rdb_transceiver.hpp:47
Definition: rdb_transceiver.hpp:59
virtual void send(const RDB_MSG_t *msg, size_t size)=0
virtual std::vector< std::shared_ptr< RDB_MSG_t > > receive()=0
virtual bool has() const =0