scc 2026.07
SystemC components library
i_server.h
1/*******************************************************************************
2 * Copyright 2026 MINRES Technologies 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
17#ifndef TLM_SCC_TCP4TLM_I_SERVER_H_
18#define TLM_SCC_TCP4TLM_I_SERVER_H_
19
20#include "serialized_connection.h"
21#include <boost/asio.hpp>
22
23namespace scc {
24namespace tcp4tlm {
25
26template <typename REQ, typename RESP> struct i_server {
27 virtual ~i_server() {}
28 virtual boost::asio::io_context& get_io_service() = 0;
29 virtual void server_send_completed(std::shared_ptr<connection<RESP, REQ>>& con, bool established = false) = 0;
30 virtual void server_receive_completed(std::shared_ptr<connection<RESP, REQ>>& con, const REQ* const result) = 0;
31 virtual bool is_shutdown_requested() { return false; }
32};
33
34} // namespace tcp4tlm
35} // namespace scc
36
37#endif // TLM_SCC_TCP4TLM_I_SERVER_H_
The connection class provides FlatBuffers framing primitives on top of a socket.
SCC TLM utilities.