helics  3.5.1
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
helics::NetworkCore< COMMS, baseline > Class Template Reference
+ Inheritance diagram for helics::NetworkCore< COMMS, baseline >:

Public Member Functions

 NetworkCore () noexcept
 
 NetworkCore (std::string_view broker_name)
 
virtual std::string generateLocalAddressString () const override
 
- Public Member Functions inherited from helics::CommsBroker< COMMS, CommonCore >
 CommsBroker () noexcept
 
 CommsBroker (bool arg) noexcept
 
 CommsBroker (std::string_view obj_name)
 
 ~CommsBroker ()
 
virtual void transmit (route_id rid, const ActionMessage &cmd) override
 
virtual void transmit (route_id rid, ActionMessage &&cmd) override
 
virtual void addRoute (route_id rid, int interfaceId, std::string_view routeInfo) override
 
virtual void removeRoute (route_id rid) override
 
COMMS * getCommsObjectPointer ()
 
- Public Member Functions inherited from helics::CommonCore
 CommonCore () noexcept
 
 CommonCore (bool arg) noexcept
 
 CommonCore (std::string_view coreName)
 
virtual ~CommonCore () override
 
virtual void configure (std::string_view configureString) override final
 
virtual void configureFromArgs (int argc, char *argv[]) override final
 
virtual void configureFromVector (std::vector< std::string > args) override final
 
virtual bool isConfigured () const override final
 
virtual bool isOpenToNewFederates () const override final
 
virtual bool hasError () const override final
 
virtual void globalError (LocalFederateId federateID, int errorCode, std::string_view errorString) override final
 
virtual void localError (LocalFederateId federateID, int errorCode, std::string_view errorString) override final
 
virtual int getErrorCode () const override final
 
virtual std::string getErrorMessage () const override final
 
virtual void finalize (LocalFederateId federateID) override final
 
virtual bool enterInitializingMode (LocalFederateId federateID, IterationRequest request) override final
 
virtual void setCoreReadyToInit () override final
 
virtual iteration_time enterExecutingMode (LocalFederateId federateID, IterationRequest iterate=NO_ITERATION) override final
 
virtual LocalFederateId registerFederate (std::string_view name, const CoreFederateInfo &info) override final
 
virtual const std::string & getFederateName (LocalFederateId federateID) const override final
 
virtual LocalFederateId getFederateId (std::string_view name) const override final
 
virtual int32_t getFederationSize () override final
 
virtual Time timeRequest (LocalFederateId federateID, Time next) override final
 
virtual iteration_time requestTimeIterative (LocalFederateId federateID, Time next, IterationRequest iterate) override final
 
virtual void processCommunications (LocalFederateId federateID, std::chrono::milliseconds msToWait) override final
 
virtual Time getCurrentTime (LocalFederateId federateID) const override final
 
virtual void setTimeProperty (LocalFederateId federateID, int32_t property, Time time) override final
 
virtual void setIntegerProperty (LocalFederateId federateID, int32_t property, int16_t propertyValue) override final
 
virtual Time getTimeProperty (LocalFederateId federateID, int32_t property) const override final
 
virtual int16_t getIntegerProperty (LocalFederateId federateID, int32_t property) const override final
 
virtual void setFlagOption (LocalFederateId federateID, int32_t flag, bool flagValue=true) override final
 
virtual bool getFlagOption (LocalFederateId federateID, int32_t flag) const override final
 
virtual InterfaceHandle registerPublication (LocalFederateId federateID, std::string_view key, std::string_view type, std::string_view units) override final
 
virtual InterfaceHandle getPublication (LocalFederateId federateID, std::string_view key) const override final
 
virtual InterfaceHandle registerInput (LocalFederateId federateID, std::string_view key, std::string_view type, std::string_view units) override final
 
virtual InterfaceHandle getInput (LocalFederateId federateID, std::string_view key) const override final
 
virtual const std::string & getHandleName (InterfaceHandle handle) const override final
 
virtual void setHandleOption (InterfaceHandle handle, int32_t option, int32_t option_value) override final
 
virtual int32_t getHandleOption (InterfaceHandle handle, int32_t option) const override final
 
virtual void closeHandle (InterfaceHandle handle) override final
 
virtual void removeTarget (InterfaceHandle handle, std::string_view targetToRemove) override final
 
virtual void addDestinationTarget (InterfaceHandle handle, std::string_view dest, InterfaceType hint) override final
 
virtual void addSourceTarget (InterfaceHandle handle, std::string_view name, InterfaceType hint) override final
 
virtual const std::string & getDestinationTargets (InterfaceHandle handle) const override final
 
virtual const std::string & getSourceTargets (InterfaceHandle handle) const override final
 
virtual const std::string & getInjectionUnits (InterfaceHandle handle) const override final
 
virtual const std::string & getExtractionUnits (InterfaceHandle handle) const override final
 
virtual const std::string & getInjectionType (InterfaceHandle handle) const override final
 
virtual const std::string & getExtractionType (InterfaceHandle handle) const override final
 
virtual void setValue (InterfaceHandle handle, const char *data, uint64_t len) override final
 
virtual const std::shared_ptr< const SmallBuffer > & getValue (InterfaceHandle handle, uint32_t *inputIndex) override final
 
virtual const std::vector< std::shared_ptr< const SmallBuffer > > & getAllValues (InterfaceHandle handle) override final
 
virtual const std::vector< InterfaceHandle > & getValueUpdates (LocalFederateId federateID) override final
 
virtual InterfaceHandle registerEndpoint (LocalFederateId federateID, std::string_view name, std::string_view type) override final
 
virtual InterfaceHandle registerTargetedEndpoint (LocalFederateId federateID, std::string_view name, std::string_view type) override final
 
virtual InterfaceHandle getEndpoint (LocalFederateId federateID, std::string_view name) const override final
 
virtual InterfaceHandle registerDataSink (LocalFederateId federateID, std::string_view name) override final
 
virtual InterfaceHandle getDataSink (LocalFederateId federateID, std::string_view name) const override final
 
virtual InterfaceHandle registerFilter (std::string_view filterName, std::string_view type_in, std::string_view type_out) override final
 
virtual InterfaceHandle registerCloningFilter (std::string_view filterName, std::string_view type_in, std::string_view type_out) override final
 
virtual InterfaceHandle registerTranslator (std::string_view translatorName, std::string_view endpointType, std::string_view units) override final
 
virtual InterfaceHandle getFilter (std::string_view name) const override final
 
virtual InterfaceHandle getTranslator (std::string_view name) const override final
 
virtual void addDependency (LocalFederateId federateID, std::string_view federateName) override final
 
virtual void linkEndpoints (std::string_view source, std::string_view dest) override final
 
virtual void addAlias (std::string_view interfaceKey, std::string_view alias) override final
 
virtual void makeConnections (const std::string &file) override final
 
virtual void dataLink (std::string_view source, std::string_view target) override final
 
virtual void addSourceFilterToEndpoint (std::string_view filter, std::string_view endpoint) override final
 
virtual void addDestinationFilterToEndpoint (std::string_view filter, std::string_view endpoint) override final
 
virtual void send (InterfaceHandle sourceHandle, const void *data, uint64_t length) override final
 
virtual void sendAt (InterfaceHandle sourceHandle, const void *data, uint64_t length, Time time) override final
 
virtual void sendTo (InterfaceHandle sourceHandle, const void *data, uint64_t length, std::string_view destination) override final
 
virtual void sendToAt (InterfaceHandle sourceHandle, const void *data, uint64_t length, std::string_view destination, Time time) override final
 
virtual void sendMessage (InterfaceHandle sourceHandle, std::unique_ptr< Message > message) override final
 
virtual uint64_t receiveCount (InterfaceHandle destination) override final
 
virtual std::unique_ptr< Messagereceive (InterfaceHandle destination) override final
 
virtual std::unique_ptr< MessagereceiveAny (LocalFederateId federateID, InterfaceHandle &endpoint_id) override final
 
virtual uint64_t receiveCountAny (LocalFederateId federateID) override final
 
virtual void logMessage (LocalFederateId federateID, int logLevel, std::string_view messageToLog) override final
 
virtual void setFilterOperator (InterfaceHandle filter, std::shared_ptr< FilterOperator > callback) override final
 
virtual void setTranslatorOperator (InterfaceHandle translator, std::shared_ptr< TranslatorOperator > callbacks) override final
 
virtual void setFederateOperator (LocalFederateId federateID, std::shared_ptr< FederateOperator > callback) override
 
void setIdentifier (std::string_view name)
 
virtual const std::string & getIdentifier () const override final
 
virtual const std::string & getAddress () const override final
 
const std::string & getFederateNameNoThrow (GlobalFederateId federateID) const noexcept
 
virtual void setLoggingLevel (int logLevel) override
 
virtual void setLoggingCallback (LocalFederateId federateID, std::function< void(int, std::string_view, std::string_view)> logFunction) override final
 
virtual void setLogFile (std::string_view lfile) override final
 
virtual std::string query (std::string_view target, std::string_view queryStr, HelicsSequencingModes mode) override
 
virtual void setQueryCallback (LocalFederateId federateID, std::function< std::string(std::string_view)> queryFunction, int order) override
 
virtual void setGlobal (std::string_view valueName, std::string_view value) override
 
virtual void sendCommand (std::string_view target, std::string_view commandStr, std::string_view source, HelicsSequencingModes mode) override
 
virtual std::pair< std::string, std::string > getCommand (LocalFederateId federateID) override
 
virtual std::pair< std::string, std::string > waitCommand (LocalFederateId federateID) override
 
virtual bool connect () override final
 
virtual bool isConnected () const override final
 
virtual void disconnect () override final
 
virtual bool waitForDisconnect (std::chrono::milliseconds msToWait=std::chrono::milliseconds(0)) const override final
 
void unregister ()
 
virtual void processDisconnect (bool skipUnregister=false) override final
 
void checkInFlightQueriesForDisconnect ()
 
virtual void setInterfaceInfo (InterfaceHandle handle, std::string_view info) override final
 
virtual const std::string & getInterfaceInfo (InterfaceHandle handle) const override final
 
virtual void setInterfaceTag (InterfaceHandle handle, std::string_view tag, std::string_view value) override final
 
virtual const std::string & getInterfaceTag (InterfaceHandle handle, std::string_view tag) const override final
 
virtual void setFederateTag (LocalFederateId fid, std::string_view tag, std::string_view value) override final
 
virtual const std::string & getFederateTag (LocalFederateId fid, std::string_view tag) const override final
 
- Public Member Functions inherited from helics::Core
 Core ()=default
 
virtual ~Core ()=default
 
virtual void globalError (LocalFederateId federateID, int32_t errorCode, std::string_view errorString)=0
 
virtual void localError (LocalFederateId federateID, int32_t errorCode, std::string_view errorString)=0
 
- Public Member Functions inherited from helics::BrokerBase
 BrokerBase (bool DisableQueue=false) noexcept
 
 BrokerBase (std::string_view broker_name, bool DisableQueue=false)
 
int parseArgs (int argc, char *argv[])
 
int parseArgs (std::vector< std::string > args)
 
int parseArgs (std::string_view initializationString)
 
virtual void configureBase ()
 
void addActionMessage (const ActionMessage &message)
 
void addActionMessage (ActionMessage &&message)
 
void setLoggerFunction (std::function< void(int level, std::string_view identifier, std::string_view message)> logFunction)
 
void logFlush ()
 
bool isRunning () const
 
void setLogLevel (int32_t level)
 
void setLogLevels (int32_t consoleLevel, int32_t fileLevel)
 
GlobalBrokerId getGlobalId () const
 
std::function< void(int, std::string_view, std::string_view)> getLoggingCallback () const
 
void joinAllThreads ()
 
std::size_t currentMessageCounter () const
 

Protected Member Functions

virtual std::shared_ptr< helicsCLI11AppgenerateCLI () override
 
virtual bool brokerConnect () override
 
- Protected Member Functions inherited from helics::CommonCore
virtual void processCommand (ActionMessage &&command) override final
 
virtual void processPriorityCommand (ActionMessage &&command) override final
 
FederateStategetFederateAt (LocalFederateId federateID) const
 
FederateStategetFederate (std::string_view federateName) const
 
FederateStategetHandleFederate (InterfaceHandle handle)
 
const BasicHandleInfogetHandleInfo (InterfaceHandle handle) const
 
const BasicHandleInfogetLocalEndpoint (std::string_view name) const
 
bool allInitReady () const
 
bool allDisconnected () const
 
OperatingState minFederateState () const
 
virtual double getSimulationTime () const override
 
- Protected Member Functions inherited from helics::BrokerBase
void setTickForwarding (TickForwardingReasons reason, bool value=true)
 
BrokerState getBrokerState () const
 
bool setBrokerState (BrokerState newState)
 
bool transitionBrokerState (BrokerState expectedState, BrokerState newState)
 
bool sendToLogger (GlobalFederateId federateID, int logLevel, std::string_view name, std::string_view message, bool fromRemote=false) const
 
void saveProfilingData (std::string_view message)
 
void writeProfilingData ()
 
void generateNewIdentifier ()
 
void setErrorState (int eCode, std::string_view estring)
 
void setLoggingFile (std::string_view lfile)
 
bool getFlagValue (int32_t flag) const
 
std::pair< bool, std::vector< std::string_view > > processBaseCommands (ActionMessage &command)
 
void addBaseInformation (Json::Value &base, bool hasParent) const
 

Protected Attributes

std::mutex dataMutex
 mutex protecting the configuration information
 
NetworkBrokerData netInfo {baseline}
 structure containing the networking information
 
- Protected Attributes inherited from helics::CommsBroker< COMMS, CommonCore >
std::atomic< int > disconnectionStage
 the stage of disconnection
 
std::unique_ptr< COMMS > comms
 the actual comms object
 
std::atomic< bool > brokerInitialized
 atomic protecting local initialization
 
- Protected Attributes inherited from helics::BrokerBase
std::atomic< GlobalBrokerIdglobal_id {parent_broker_id}
 
GlobalBrokerId global_broker_id_local {}
 
GlobalBrokerId higher_broker_id {0}
 the id code of the broker 1 level about this broker
 
std::atomic< int32_t > maxLogLevel {HELICS_LOG_LEVEL_NO_PRINT}
 
int32_t minFederateCount {1}
 
int32_t minBrokerCount {0}
 
int32_t maxFederateCount {(std::numeric_limits<int32_t>::max)()}
 
int32_t maxBrokerCount {(std::numeric_limits<int32_t>::max)()}
 
int32_t minChildCount {0}
 
int32_t maxIterationCount {10000}
 the maximum number of iterative loops that are allowed
 
Time tickTimer {5.0}
 the length of each heartbeat tick
 
Time timeout {30.0}
 timeout to wait to establish a broker connection before giving up
 
Time networkTimeout {-1.0}
 timeout to establish a socket connection before giving up
 
Time queryTimeout {15.0}
 
Time errorDelay {0.0}
 time to delay before terminating after error state
 
Time grantTimeout {-1.0}
 timeout for triggering diagnostic action waiting for a time grant
 
Time maxCoSimDuration {-1.0}
 the maximum lifetime (wall clock time) of the co-simulation
 
std::string identifier
 an identifier for the broker
 
std::string brokerKey
 
std::string address
 network location of the broker
 
std::thread queueProcessingThread
 
std::atomic< bool > haltOperations {false}
 flag indicating that no further message should be processed
 
bool restrictive_time_policy {false}
 flag indicating the broker should use a conservative time policy
 
bool terminate_on_error {false}
 flag indicating that the federation should halt on any error
 
bool debugging {false}
 flag indicating operation in a user debugging mode
 
bool observer {false}
 flag indicating that the broker is an observer only
 
bool globalTime {false}
 flag indicating that the broker should use a global time coordinator
 
bool asyncTime {false}
 flag indicating the use of async time keeping
 
bool dynamicFederation {false}
 flag indicating that the broker supports dynamic federates
 
bool disableDynamicSources {false}
 flag disabling dynamic data sources
 
std::unique_ptr< BaseTimeCoordinatortimeCoord
 object managing the time control
 
gmlc::containers::BlockingPriorityQueue< ActionMessageactionQueue
 primary routing queue
 
std::shared_ptr< LogManagermLogManager
 object to handle the logging considerations
 
bool noAutomaticID {false}
 the broker should not automatically generate an ID
 
bool hasTimeDependency {false}
 
bool enteredExecutionMode {false}
 flag indicating that the broker has entered execution mode
 
bool waitingForBrokerPingReply {false}
 flag indicating we are waiting for a ping reply
 
bool hasFilters {false}
 flag indicating filters come through the broker
 
bool no_ping {false}
 indicator that the broker is not very responsive to ping requests
 
bool uuid_like {false}
 will be set to true if the name looks like a uuid
 
bool useJsonSerialization {false}
 
bool enable_profiling {false}
 indicator that profiling is enabled
 
bool allowRemoteControl {true}
 
decltype(std::chrono::steady_clock::now()) errorTimeStart
 time when the error condition started; related to the errorDelay
 
decltype(std::chrono::steady_clock::now()) disconnectTime
 time when the disconnect started
 
std::atomic< int > lastErrorCode {0}
 storage for last error code
 
std::string lastErrorString
 storage for last error string
 

Additional Inherited Members

- Protected Types inherited from helics::BrokerBase
enum class  BrokerState : int16_t {
  CREATED = -10 , CONFIGURING = -7 , CONFIGURED = -6 , CONNECTING = -4 ,
  CONNECTED = -3 , INITIALIZING = -1 , OPERATING = 0 , CONNECTED_ERROR = 3 ,
  TERMINATING = 4 , TERMINATING_ERROR = 5 , TERMINATED = 6 , ERRORED = 7
}
 
enum class  TickForwardingReasons : uint32_t {
  NONE = 0 , NO_COMMS = 0x01 , PING_RESPONSE = 0x02 , QUERY_TIMEOUT = 0x04 ,
  GRANT_TIMEOUT = 0x08 , DISCONNECT_TIMEOUT = 0x10
}
 
- Static Protected Member Functions inherited from helics::BrokerBase
static bool isReasonForTick (std::uint32_t code, TickForwardingReasons reason)
 
- Static Protected Attributes inherited from helics::BrokerBase
static constexpr double mInvalidSimulationTime {-98763.2}
 

Constructor & Destructor Documentation

◆ NetworkCore()

template<class COMMS , InterfaceTypes baseline>
helics::NetworkCore< COMMS, baseline >::NetworkCore
noexcept

default constructor

Member Function Documentation

◆ brokerConnect()

template<class COMMS , InterfaceTypes baseline>
bool helics::NetworkCore< COMMS, baseline >::brokerConnect ( )
overrideprotectedvirtual

implementation details of the connection process

Implements helics::CommonCore.

◆ generateCLI()

template<class COMMS , InterfaceTypes baseline>
std::shared_ptr< helicsCLI11App > helics::NetworkCore< COMMS, baseline >::generateCLI
overrideprotectedvirtual

generate a CLI11 Application for subprocesses for processing of command line arguments

Reimplemented from helics::BrokerBase.

Reimplemented in helics::tcp::TcpCoreSS.

Referenced by helics::tcp::TcpCoreSS::generateCLI().

◆ generateLocalAddressString()

template<class COMMS , InterfaceTypes baseline>
std::string helics::NetworkCore< COMMS, baseline >::generateLocalAddressString ( ) const
overridevirtual

generate the local address information

Implements helics::BrokerBase.


The documentation for this class was generated from the following files: