| helics 3.6.1

IpcComms.h
1 /*
2 Copyright (c) 2017-2025,
3 Battelle Memorial Institute; Lawrence Livermore National Security, LLC; Alliance for Sustainable
4 Energy, LLC. See the top-level NOTICE for additional details. All rights reserved.
5 SPDX-License-Identifier: BSD-3-Clause
6 */
7 #pragma once
8
9 #include "../CommsInterface.hpp"
10
11 #include <atomic>
12 #include <string>
13
14 namespace helics {
15 namespace ipc {
17 class IpcComms final: public CommsInterface {
18 public:
20 IpcComms();
22 ~IpcComms();
23
24 virtual void loadNetworkInfo(const NetworkBrokerData& netInfo) override;
25
26 private:
27 std::atomic<int> ipcbackchannel{
28 0};
29 virtual void queue_rx_function() override;
30 virtual void queue_tx_function() override;
31 virtual void closeReceiver() override;
32
33 public:
35 int getPort() const { return -1; }
36
37 std::string getAddress() const;
38 };
39
40 #define IPC_BACKCHANNEL_TRY_RESET 2
41 #define IPC_BACKCHANNEL_DISCONNECT 4
42
43 } // namespace ipc
44 } // namespace helics
helics::CommsInterface
Definition: CommsInterface.hpp:25
helics::NetworkBrokerData
Definition: NetworkBrokerData.hpp:23
helics::ipc::IpcComms
Definition: IpcComms.h:17
helics::ipc::IpcComms::IpcComms
IpcComms()
Definition: IpcComms.cpp:31
helics::ipc::IpcComms::getPort
int getPort() const
Definition: IpcComms.h:35
helics::ipc::IpcComms::loadNetworkInfo
virtual void loadNetworkInfo(const NetworkBrokerData &netInfo) override
Definition: IpcComms.cpp:42
helics::ipc::IpcComms::~IpcComms
~IpcComms()
Definition: IpcComms.cpp:37
helics
the main namespace for the helics co-simulation library User functions will be in the helics namespac...
Definition: AsyncFedCallInfo.hpp:14