helics  2.8.1
Functions
MessageFilters.h File Reference

Functions related to message filters for the C api. More...

#include "helics.h"

Go to the source code of this file.

Functions

helics_filter helicsFederateRegisterFilter (helics_federate fed, helics_filter_type type, const char *name, helics_error *err)
 
helics_filter helicsFederateRegisterGlobalFilter (helics_federate fed, helics_filter_type type, const char *name, helics_error *err)
 
helics_filter helicsFederateRegisterCloningFilter (helics_federate fed, const char *name, helics_error *err)
 
helics_filter helicsFederateRegisterGlobalCloningFilter (helics_federate fed, const char *name, helics_error *err)
 
helics_filter helicsCoreRegisterFilter (helics_core core, helics_filter_type type, const char *name, helics_error *err)
 
helics_filter helicsCoreRegisterCloningFilter (helics_core core, const char *name, helics_error *err)
 
int helicsFederateGetFilterCount (helics_federate fed)
 
helics_filter helicsFederateGetFilter (helics_federate fed, const char *name, helics_error *err)
 
helics_filter helicsFederateGetFilterByIndex (helics_federate fed, int index, helics_error *err)
 
helics_bool helicsFilterIsValid (helics_filter filt)
 
const char * helicsFilterGetName (helics_filter filt)
 
void helicsFilterSet (helics_filter filt, const char *prop, double val, helics_error *err)
 
void helicsFilterSetString (helics_filter filt, const char *prop, const char *val, helics_error *err)
 
void helicsFilterAddDestinationTarget (helics_filter filt, const char *dst, helics_error *err)
 
void helicsFilterAddSourceTarget (helics_filter filt, const char *source, helics_error *err)
 
void helicsFilterAddDeliveryEndpoint (helics_filter filt, const char *deliveryEndpoint, helics_error *err)
 
void helicsFilterRemoveTarget (helics_filter filt, const char *target, helics_error *err)
 
void helicsFilterRemoveDeliveryEndpoint (helics_filter filt, const char *deliveryEndpoint, helics_error *err)
 
const char * helicsFilterGetInfo (helics_filter filt)
 
void helicsFilterSetInfo (helics_filter filt, const char *info, helics_error *err)
 
void helicsFilterSetOption (helics_filter filt, int option, int value, helics_error *err)
 
int helicsFilterGetOption (helics_filter filt, int option)
 

Detailed Description

Functions related to message filters for the C api.

Function Documentation

◆ helicsCoreRegisterCloningFilter()

helics_filter helicsCoreRegisterCloningFilter ( helics_core  core,
const char *  name,
helics_error err 
)

Create a cloning Filter on the specified core.

Cloning filters copy a message and send it to multiple locations, source and destination can be added through other functions.

Parameters
coreThe core to register through.
nameThe name of the filter (can be NULL). @forcpponly
[in,out]errA pointer to an error object for catching errors. @endforcpponly
Returns
A helics_filter object.

Referenced by helicscpp::Core::registerCloningFilter().

◆ helicsCoreRegisterFilter()

helics_filter helicsCoreRegisterFilter ( helics_core  core,
helics_filter_type  type,
const char *  name,
helics_error err 
)

Create a source Filter on the specified core.

Filters can be created through a federate or a core, linking through a federate allows a few extra features of name matching to function on the federate interface but otherwise equivalent behavior.

Parameters
coreThe core to register through.
typeThe type of filter to create /ref helics_filter_type.
nameThe name of the filter (can be NULL). @forcpponly
[in,out]errA pointer to an error object for catching errors. @endforcpponly
Returns
A helics_filter object.

Referenced by helicscpp::Core::registerFilter().

◆ helicsFederateGetFilter()

helics_filter helicsFederateGetFilter ( helics_federate  fed,
const char *  name,
helics_error err 
)

Get a filter by its name, typically already created via registerInterfaces file or something of that nature.

Parameters
fedThe federate object to use to get the filter.
nameThe name of the filter. @forcpponly
[in,out]errThe error object to complete if there is an error. @endforcpponly
Returns
A helics_filter object, the object will not be valid and err will contain an error code if no filter with the specified name exists.

Referenced by helicscpp::Federate::getFilter().

◆ helicsFederateGetFilterByIndex()

helics_filter helicsFederateGetFilterByIndex ( helics_federate  fed,
int  index,
helics_error err 
)

Get a filter by its index, typically already created via registerInterfaces file or something of that nature.

Parameters
fedThe federate object in which to create a publication.
indexThe index of the publication to get. @forcpponly
[in,out]errA pointer to an error object for catching errors. @endforcpponly
Returns
A helics_filter, which will be NULL if an invalid index is given.

Referenced by helicscpp::Federate::getFilter().

◆ helicsFederateGetFilterCount()

int helicsFederateGetFilterCount ( helics_federate  fed)

Get the number of filters registered through a federate.

Parameters
fedThe federate object to use to get the filter.
Returns
A count of the number of filters registered through a federate.

◆ helicsFederateRegisterCloningFilter()

helics_filter helicsFederateRegisterCloningFilter ( helics_federate  fed,
const char *  name,
helics_error err 
)

Create a cloning Filter on the specified federate.

Cloning filters copy a message and send it to multiple locations, source and destination can be added through other functions.

Parameters
fedThe federate to register through.
nameThe name of the filter (can be NULL). @forcpponly
[in,out]errA pointer to an error object for catching errors. @endforcpponly
Returns
A helics_filter object.

Referenced by helicscpp::Federate::registerCloningFilter().

◆ helicsFederateRegisterFilter()

helics_filter helicsFederateRegisterFilter ( helics_federate  fed,
helics_filter_type  type,
const char *  name,
helics_error err 
)

Create a source Filter on the specified federate.

Filters can be created through a federate or a core, linking through a federate allows a few extra features of name matching to function on the federate interface but otherwise equivalent behavior

Parameters
fedThe federate to register through.
typeThe type of filter to create /ref helics_filter_type.
nameThe name of the filter (can be NULL). @forcpponly
[in,out]errA pointer to an error object for catching errors. @endforcpponly
Returns
A helics_filter object.

Referenced by helicscpp::Federate::registerFilter().

◆ helicsFederateRegisterGlobalCloningFilter()

helics_filter helicsFederateRegisterGlobalCloningFilter ( helics_federate  fed,
const char *  name,
helics_error err 
)

Create a global cloning Filter on the specified federate.

Cloning filters copy a message and send it to multiple locations, source and destination can be added through other functions.

Parameters
fedThe federate to register through.
nameThe name of the filter (can be NULL). @forcpponly
[in,out]errA pointer to an error object for catching errors. @endforcpponly
Returns
A helics_filter object.

Referenced by helicscpp::Federate::registerGlobalCloningFilter().

◆ helicsFederateRegisterGlobalFilter()

helics_filter helicsFederateRegisterGlobalFilter ( helics_federate  fed,
helics_filter_type  type,
const char *  name,
helics_error err 
)

Create a global source filter through a federate.

Filters can be created through a federate or a core, linking through a federate allows a few extra features of name matching to function on the federate interface but otherwise equivalent behavior.

Parameters
fedThe federate to register through.
typeThe type of filter to create /ref helics_filter_type.
nameThe name of the filter (can be NULL). @forcpponly
[in,out]errA pointer to an error object for catching errors. @endforcpponly
Returns
A helics_filter object.

Referenced by helicscpp::Federate::registerGlobalFilter().

◆ helicsFilterAddDestinationTarget()

void helicsFilterAddDestinationTarget ( helics_filter  filt,
const char *  dst,
helics_error err 
)

Add a destination target to a filter.

All messages going to a destination are copied to the delivery address(es).

Parameters
filtThe given filter to add a destination target to.
dstThe name of the endpoint to add as a destination target. @forcpponly
[in,out]errA pointer to an error object for catching errors. @endforcpponly

Referenced by helicscpp::Filter::addDestinationTarget().

◆ helicsFilterAddSourceTarget()

void helicsFilterAddSourceTarget ( helics_filter  filt,
const char *  source,
helics_error err 
)

Add a source target to a filter.

All messages coming from a source are copied to the delivery address(es).

Parameters
filtThe given filter.
sourceThe name of the endpoint to add as a source target. @forcpponly.
[in,out]errA pointer to an error object for catching errors. @endforcpponly

Referenced by helicscpp::Filter::addSourceTarget().

◆ helicsFilterGetName()

const char* helicsFilterGetName ( helics_filter  filt)

Get the name of the filter and store in the given string.

Parameters
filtThe given filter.
Returns
A string with the name of the filter.

get the name of the filter

Referenced by helicscpp::Filter::getName().

◆ helicsFilterIsValid()

helics_bool helicsFilterIsValid ( helics_filter  filt)

Check if a filter is valid.

Parameters
filtThe filter object to check.
Returns
helics_true if the Filter object represents a valid filter.

Referenced by helicscpp::Filter::isValid().

◆ helicsFilterSet()

void helicsFilterSet ( helics_filter  filt,
const char *  prop,
double  val,
helics_error err 
)

Set a property on a filter.

Parameters
filtThe filter to modify.
propA string containing the property to set.
valA numerical value for the property. @forcpponly
[in,out]errA pointer to an error object for catching errors. @endforcpponly

Referenced by helicscpp::Filter::set().

◆ helicsFilterSetString()

void helicsFilterSetString ( helics_filter  filt,
const char *  prop,
const char *  val,
helics_error err 
)

Set a string property on a filter.

Parameters
filtThe filter to modify.
propA string containing the property to set.
valA string containing the new value. @forcpponly
[in,out]errA pointer to an error object for catching errors. @endforcpponly

Referenced by helicscpp::Filter::setString().