helics  2.8.1
InprocComms.h
1 /*
2 Copyright (c) 2017-2021,
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:152
helics::inproc::InprocComms::~InprocComms
~InprocComms()
Definition: InprocComms.cpp:27
helics::BrokerFactory::cleanUpBrokers
size_t cleanUpBrokers()
Definition: BrokerFactory.cpp:266
helics::message_process_result::processed
@ processed
the message was used to update the current state
helics::BrokerFactory::copyBrokerIdentifier
bool copyBrokerIdentifier(const std::string &copyFromName, const std::string &copyToName)
Definition: BrokerFactory.cpp:290
helics::CommsInterface::name
std::string name
the name of the object
Definition: CommsInterface.hpp:123
helics::CommsInterface::connection_status::terminated
@ terminated
the connection has been terminated
helics::CommsInterface::logWarning
void logWarning(const std::string &message) const
Definition: CommsInterface.cpp:570
helics::CommsInterface::logError
void logError(const std::string &message) const
Definition: CommsInterface.cpp:579
helics::CommsInterface::thread_generation
thread_generation
Definition: CommsInterface.hpp:30
helics::CommsInterface::brokerInitString
std::string brokerInitString
the initialization string for any automatically generated broker
Definition: CommsInterface.hpp:128
helics::NetworkBrokerData
Definition: NetworkBrokerData.hpp:36
helics::CommsInterface::connectionTimeout
std::chrono::milliseconds connectionTimeout
Definition: CommsInterface.hpp:144
helics::CoreFactory::copyCoreIdentifier
bool copyCoreIdentifier(const std::string &copyFromName, const std::string &copyToName)
Definition: CoreFactory.cpp:342
helics::CommsInterface::txQueue
gmlc::containers::BlockingPriorityQueue< std::pair< route_id, ActionMessage > > txQueue
set of messages waiting to be transmitted
Definition: CommsInterface.hpp:153
helics::inproc::InprocComms
Definition: InprocComms.h:19
helics::inproc::InprocComms::InprocComms
InprocComms()
Definition: InprocComms.cpp:24
helics::core_type::INPROC
@ INPROC
core/broker using a stripped down in process core type
helics::CommsInterface::connection_status::error
@ error
some error occurred on the connection
helics::BrokerFactory::findBroker
std::shared_ptr< Broker > findBroker(const std::string &brokerName)
Definition: BrokerFactory.cpp:185
helics::CommsInterface::disconnect
void disconnect()
Definition: CommsInterface.cpp:384
helics::BrokerFactory::findJoinableBrokerOfType
std::shared_ptr< Broker > findJoinableBrokerOfType(core_type type)
Definition: BrokerFactory.cpp:217
helics::CoreFactory::findCore
std::shared_ptr< Core > findCore(const std::string &name)
Definition: CoreFactory.cpp:267
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
the identifier for the broker
Definition: CommsInterface.hpp:126
helics::prettyPrintString
std::string prettyPrintString(const ActionMessage &command)
Definition: ActionMessage.cpp:861
helics::isDisconnectCommand
bool isDisconnectCommand(const ActionMessage &command) noexcept
Definition: ActionMessage.hpp:276
helics::CommsInterface
Definition: CommsInterface.hpp:26
helics::BrokerFactory::create
std::shared_ptr< Broker > create(core_type type, const std::string &configureString)
Definition: BrokerFactory.cpp:100
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:140
helics::CommsInterface::autoBroker
bool autoBroker
the broker should be automatically generated if needed
Definition: CommsInterface.hpp:141
helics::interface_type::inproc
@ inproc
using inproc sockets for communications
helics::inproc::InprocComms::loadNetworkInfo
virtual void loadNetworkInfo(const NetworkBrokerData &netInfo) override
Definition: InprocComms.cpp:29
helics::CommsInterface::connection_status::connected
@ connected
we are connected