helics  3.3.0
InprocComms.h
1 /*
2 Copyright (c) 2017-2022,
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 #include "helics/helics-config.h"
11 
12 #include <future>
13 #include <set>
14 #include <string>
15 
16 namespace helics {
17 namespace inproc {
19  class InprocComms final: public CommsInterface {
20  public:
22  InprocComms();
24  ~InprocComms();
25 
26  virtual void loadNetworkInfo(const NetworkBrokerData& netInfo) override;
27 
28  private:
29  virtual void queue_rx_function() override;
30  virtual void queue_tx_function() override;
31  public:
33  int getPort() const { return -1; }
34 
35  std::string getAddress() const;
36  };
37 
38 } // namespace inproc
39 } // namespace helics
helics::CommsInterface::brokerTargetAddress
std::string brokerTargetAddress
the base for the broker address
Definition: CommsInterface.hpp:125
helics::CommsInterface::propertyLock
bool propertyLock()
Definition: CommsInterface.cpp:153
helics::inproc::InprocComms::~InprocComms
~InprocComms()
Definition: InprocComms.cpp:27
helics::CommsInterface::observer
bool observer
true for connections that are for observation only
Definition: CommsInterface.hpp:144
helics::message_process_result::processed
@ processed
the message was used to update the current state
helics::CommsInterface::name
std::string name
the name of the object
Definition: CommsInterface.hpp:123
helics::CoreFactory::findCore
std::shared_ptr< Core > findCore(std::string_view name)
Definition: CoreFactory.cpp:304
helics::CommsInterface::thread_generation
thread_generation
Definition: CommsInterface.hpp:29
helics::CoreType::INPROC
@ INPROC
core/broker using a stripped down in process core type
helics::BrokerFactory::cleanUpBrokers
size_t cleanUpBrokers()
Definition: BrokerFactory.cpp:266
helics::CommsInterface::brokerInitString
std::string brokerInitString
the initialization string for any automatically generated broker
Definition: CommsInterface.hpp:128
helics::NetworkBrokerData
Definition: NetworkBrokerData.hpp:23
helics::CommsInterface::connectionTimeout
std::chrono::milliseconds connectionTimeout
Definition: CommsInterface.hpp:146
helics::CommsInterface::logError
void logError(std::string_view message) const
Definition: CommsInterface.cpp:581
helics::BrokerFactory::create
std::shared_ptr< Broker > create(CoreType type, std::string_view configureString)
Definition: BrokerFactory.cpp:99
helics::CommsInterface::txQueue
gmlc::containers::BlockingPriorityQueue< std::pair< route_id, ActionMessage > > txQueue
set of messages waiting to be transmitted
Definition: CommsInterface.hpp:155
helics::BrokerFactory::copyBrokerIdentifier
bool copyBrokerIdentifier(std::string_view copyFromName, std::string_view copyToName)
Definition: BrokerFactory.cpp:297
helics::inproc::InprocComms
Definition: InprocComms.h:19
helics::inproc::InprocComms::InprocComms
InprocComms()
Definition: InprocComms.cpp:24
helics::isIgnoreableCommand
bool isIgnoreableCommand(const ActionMessage &command) noexcept
Definition: ActionMessage.hpp:317
helics::BrokerFactory::findBroker
std::shared_ptr< Broker > findBroker(std::string_view brokerName)
Definition: BrokerFactory.cpp:183
helics::CoreFactory::copyCoreIdentifier
bool copyCoreIdentifier(std::string_view copyFromName, std::string_view copyToName)
Definition: CoreFactory.cpp:387
helics::CommsInterface::ConnectionStatus::ERRORED
@ ERRORED
some ERRORED occurred on the connection
helics::CommsInterface::disconnect
void disconnect()
Definition: CommsInterface.cpp:385
helics::CommsInterface::ConnectionStatus::TERMINATED
@ TERMINATED
the connection has been TERMINATED
helics::CommsInterface::logWarning
void logWarning(std::string_view message) const
Definition: CommsInterface.cpp:572
helics::inproc::InprocComms::getPort
int getPort() const
Definition: InprocComms.h:33
helics::CommsInterface::localTargetAddress
std::string localTargetAddress
the base for the receive address
Definition: CommsInterface.hpp:124
helics::CommsInterface::brokerName
std::string brokerName
Definition: CommsInterface.hpp:126
helics::prettyPrintString
std::string prettyPrintString(const ActionMessage &command)
Definition: ActionMessage.cpp:846
helics::CommsInterface
Definition: CommsInterface.hpp:25
helics::isProtocolCommand
bool isProtocolCommand(const ActionMessage &command) noexcept
Definition: ActionMessage.hpp:226
helics
the main namespace for the helics co-simulation library User functions will be in the helics namespac...
Definition: AsyncFedCallInfo.hpp:14
helics::CommsInterface::loadNetworkInfo
virtual void loadNetworkInfo(const NetworkBrokerData &netInfo)
Definition: CommsInterface.cpp:104
helics::CommsInterface::serverMode
bool serverMode
some comms have a server mode and non-server mode
Definition: CommsInterface.hpp:141
helics::CommsInterface::autoBroker
bool autoBroker
the broker should be automatically generated if needed
Definition: CommsInterface.hpp:142
helics::inproc::InprocComms::loadNetworkInfo
virtual void loadNetworkInfo(const NetworkBrokerData &netInfo) override
Definition: InprocComms.cpp:32
helics::BrokerFactory::findJoinableBrokerOfType
std::shared_ptr< Broker > findJoinableBrokerOfType(CoreType type)
Definition: BrokerFactory.cpp:211
helics::CommsInterface::ConnectionStatus::CONNECTED
@ CONNECTED
we are CONNECTED