helics  2.8.1
Public Member Functions | List of all members
helics::CoreApp Class Reference

#include <CoreApp.hpp>

Public Member Functions

 CoreApp ()=default
 
 CoreApp (std::vector< std::string > args)
 
 CoreApp (core_type ctype, std::vector< std::string > args)
 
 CoreApp (core_type ctype, const std::string &coreName, std::vector< std::string > args)
 
 CoreApp (int argc, char *argv[])
 
 CoreApp (core_type ctype, const std::string &coreName, int argc, char *argv[])
 
 CoreApp (core_type ctype, int argc, char *argv[])
 
 CoreApp (const std::string &argString)
 
 CoreApp (core_type ctype, const std::string &argString)
 
 CoreApp (core_type ctype, const std::string &coreName, const std::string &argString)
 
 CoreApp (std::shared_ptr< Core > cr)
 
bool isConnected () const
 
bool connect ()
 
bool isOpenToNewFederates () const
 
void forceTerminate ()
 
bool waitForDisconnect (std::chrono::milliseconds waitTime=std::chrono::milliseconds(0))
 
void dataLink (const std::string &source, const std::string &target)
 
void addSourceFilterToEndpoint (const std::string &filter, const std::string &endpoint)
 
void addDestinationFilterToEndpoint (const std::string &filter, const std::string &endpoint)
 
void makeConnections (const std::string &file)
 
const std::string & getIdentifier () const
 
const std::string & getAddress () const
 
std::string query (const std::string &target, const std::string &queryStr, helics_sequencing_mode mode=helics_sequencing_mode_fast)
 
void setGlobal (const std::string &valueName, const std::string &value)
 
void setLogFile (const std::string &logFile)
 
void setLoggingLevel (int loglevel)
 
void setReadyToInit ()
 
void haltInit ()
 
CoreAppoperator-> ()
 
const CoreAppoperator-> () const
 
std::shared_ptr< CoregetCopyofCorePointer () const
 
void reset ()
 
void globalError (int32_t errorCode, const std::string &errorString)
 

Detailed Description

class implementing a Core object. This object is meant to a be a very simple core executor with a similar interface to the other apps

Constructor & Destructor Documentation

◆ CoreApp() [1/11]

helics::CoreApp::CoreApp ( )
default

default constructor

◆ CoreApp() [2/11]

helics::CoreApp::CoreApp ( std::vector< std::string >  args)
explicit

construct from command line arguments in a vector

Parameters
argsthe command line arguments to pass in a reverse vector

References helics::DEFAULT.

◆ CoreApp() [3/11]

helics::CoreApp::CoreApp ( core_type  ctype,
std::vector< std::string >  args 
)

construct from command line arguments in a vector

Parameters
ctypethe type of core to create
argsthe command line arguments to pass in a reverse vector

◆ CoreApp() [4/11]

helics::CoreApp::CoreApp ( core_type  ctype,
const std::string &  coreName,
std::vector< std::string >  args 
)

construct from command line arguments in a vector

Parameters
ctypethe type of core to create
coreNamethe name of the core to use
argsthe command line arguments to pass in a reverse vector

◆ CoreApp() [5/11]

helics::CoreApp::CoreApp ( int  argc,
char *  argv[] 
)

construct from command line arguments

Parameters
argcthe number of arguments
argvthe strings in the input

References helics::DEFAULT.

◆ CoreApp() [6/11]

helics::CoreApp::CoreApp ( core_type  ctype,
const std::string &  coreName,
int  argc,
char *  argv[] 
)

construct from command line arguments

Parameters
ctypethe type of core to create
coreNamethe name of the core to use
argcthe number of arguments
argvthe strings in the input

◆ CoreApp() [7/11]

helics::CoreApp::CoreApp ( core_type  ctype,
int  argc,
char *  argv[] 
)

construct from command line arguments

Parameters
ctypethe type of core to create
argcthe number of arguments
argvthe strings in the input

◆ CoreApp() [8/11]

helics::CoreApp::CoreApp ( const std::string &  argString)
explicit

construct from command line arguments parsed as a single string

Parameters
argStringa merged string with all the arguments

References helics::CoreFactory::findCore().

◆ CoreApp() [9/11]

helics::CoreApp::CoreApp ( core_type  ctype,
const std::string &  argString 
)

construct from command line arguments parsed as a single string

Parameters
ctypethe type of core to create
argStringa merged string with all the arguments

◆ CoreApp() [10/11]

helics::CoreApp::CoreApp ( core_type  ctype,
const std::string &  coreName,
const std::string &  argString 
)

construct from command line arguments parsed as a single string

Parameters
ctypethe type of core to create
coreNamethe name of the core to use or create
argStringa merged string with all the arguments

◆ CoreApp() [11/11]

helics::CoreApp::CoreApp ( std::shared_ptr< Core cr)
explicit

create a CoreApp from a core pointer

Member Function Documentation

◆ addDestinationFilterToEndpoint()

void helics::CoreApp::addDestinationFilterToEndpoint ( const std::string &  filter,
const std::string &  endpoint 
)

add a destination Filter to an endpoint

◆ addSourceFilterToEndpoint()

void helics::CoreApp::addSourceFilterToEndpoint ( const std::string &  filter,
const std::string &  endpoint 
)

add a source Filter to an endpoint

◆ connect()

bool helics::CoreApp::connect ( )

connect the Core to its broker

◆ dataLink()

void helics::CoreApp::dataLink ( const std::string &  source,
const std::string &  target 
)

link a publication and input

◆ forceTerminate()

void helics::CoreApp::forceTerminate ( )

forceably disconnect the core

Referenced by helics::CoreKeeper::forceTerminate().

◆ getAddress()

const std::string & helics::CoreApp::getAddress ( ) const

get the network address of the core

◆ getCopyofCorePointer()

std::shared_ptr<Core> helics::CoreApp::getCopyofCorePointer ( ) const
inline

get a copy of the core pointer

Referenced by helics::make_cloning_filter(), and helics::make_filter().

◆ getIdentifier()

const std::string & helics::CoreApp::getIdentifier ( ) const

get the identifier of the core

◆ globalError()

void helics::CoreApp::globalError ( int32_t  errorCode,
const std::string &  errorString 
)

generate a global error on a core

References helics::local_core_id().

◆ haltInit()

void helics::CoreApp::haltInit ( )

tell the core to pause init even if otherwise ready

References helics_flag_delay_init_entry, and helics::local_core_id().

◆ isConnected()

bool helics::CoreApp::isConnected ( ) const

check if the Core is running

Referenced by helics::CoreKeeper::isConnected(), and helics::CoreKeeper::~CoreKeeper().

◆ isOpenToNewFederates()

bool helics::CoreApp::isOpenToNewFederates ( ) const

check if the broker is ready to accept new federates or cores

◆ makeConnections()

void helics::CoreApp::makeConnections ( const std::string &  file)

make connections from a core using a file

◆ query()

std::string helics::CoreApp::query ( const std::string &  target,
const std::string &  queryStr,
helics_sequencing_mode  mode = helics_sequencing_mode_fast 
)

make a query at the core

Parameters
targetthe target of the query "federation", "parent", "core","broker" or a specific named object
queryStrthe query to make
modedefaults to fast (asynchronous) meaning the query goes into priority channels, ordered (synchronous) means slower queries but has more ordering guarantees
Returns
a string containing the query results

make a query at the core

◆ reset()

void helics::CoreApp::reset ( )

reset the app to default state

◆ setGlobal()

void helics::CoreApp::setGlobal ( const std::string &  valueName,
const std::string &  value 
)

set a federation global value

this overwrites any previous value for this name globals can be queried with a target of "global" and queryStr of the value to Query

Parameters
valueNamethe name of the global to set
valuethe value of the global

◆ setLogFile()

void helics::CoreApp::setLogFile ( const std::string &  logFile)

set the log file to use for the core

◆ setLoggingLevel()

void helics::CoreApp::setLoggingLevel ( int  loglevel)

set the minimum log level to use in the core

◆ setReadyToInit()

void helics::CoreApp::setReadyToInit ( )

tell the core that is ready to enter initialization mode

◆ waitForDisconnect()

bool helics::CoreApp::waitForDisconnect ( std::chrono::milliseconds  waitTime = std::chrono::milliseconds(0))

wait for the core to normally disconnect for a certain amount of time

Referenced by helics::CoreKeeper::~CoreKeeper().


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