helics  3.5.3
Functions
MessageFilters.h File Reference

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

#include "helicsCore.h"

Go to the source code of this file.

Functions

HelicsFilter helicsFederateRegisterFilter (HelicsFederate fed, HelicsFilterTypes type, const char *name, HelicsError *err)
 
HelicsFilter helicsFederateRegisterGlobalFilter (HelicsFederate fed, HelicsFilterTypes type, const char *name, HelicsError *err)
 
HelicsFilter helicsFederateRegisterCloningFilter (HelicsFederate fed, const char *name, HelicsError *err)
 
HelicsFilter helicsFederateRegisterGlobalCloningFilter (HelicsFederate fed, const char *name, HelicsError *err)
 
HelicsFilter helicsCoreRegisterFilter (HelicsCore core, HelicsFilterTypes type, const char *name, HelicsError *err)
 
HelicsFilter helicsCoreRegisterCloningFilter (HelicsCore core, const char *name, HelicsError *err)
 
int helicsFederateGetFilterCount (HelicsFederate fed)
 
HelicsFilter helicsFederateGetFilter (HelicsFederate fed, const char *name, HelicsError *err)
 
HelicsFilter helicsFederateGetFilterByIndex (HelicsFederate fed, int index, HelicsError *err)
 
HelicsBool helicsFilterIsValid (HelicsFilter filt)
 
const char * helicsFilterGetName (HelicsFilter filt)
 
void helicsFilterSet (HelicsFilter filt, const char *prop, double val, HelicsError *err)
 
void helicsFilterSetString (HelicsFilter filt, const char *prop, const char *val, HelicsError *err)
 
void helicsFilterAddDestinationTarget (HelicsFilter filt, const char *dst, HelicsError *err)
 
void helicsFilterAddSourceTarget (HelicsFilter filt, const char *source, HelicsError *err)
 
void helicsFilterAddDeliveryEndpoint (HelicsFilter filt, const char *deliveryEndpoint, HelicsError *err)
 
void helicsFilterRemoveTarget (HelicsFilter filt, const char *target, HelicsError *err)
 
void helicsFilterRemoveDeliveryEndpoint (HelicsFilter filt, const char *deliveryEndpoint, HelicsError *err)
 
const char * helicsFilterGetInfo (HelicsFilter filt)
 
void helicsFilterSetInfo (HelicsFilter filt, const char *info, HelicsError *err)
 
const char * helicsFilterGetTag (HelicsFilter filt, const char *tagname)
 
void helicsFilterSetTag (HelicsFilter filt, const char *tagname, const char *tagvalue, HelicsError *err)
 
void helicsFilterSetOption (HelicsFilter filt, int option, int value, HelicsError *err)
 
int helicsFilterGetOption (HelicsFilter filt, int option)
 

Detailed Description

Functions related to message filters for the C api.

Function Documentation

◆ helicsCoreRegisterCloningFilter()

HelicsFilter helicsCoreRegisterCloningFilter ( HelicsCore  core,
const char *  name,
HelicsError 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).
[in,out]errA pointer to an error object for catching errors.
Returns
A HelicsFilter object.

References helics::make_cloning_filter().

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

◆ helicsCoreRegisterFilter()

HelicsFilter helicsCoreRegisterFilter ( HelicsCore  core,
HelicsFilterTypes  type,
const char *  name,
HelicsError 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 HelicsFilterTypes.
nameThe name of the filter (can be NULL).
[in,out]errA pointer to an error object for catching errors.
Returns
A HelicsFilter object.

References HELICS_FILTER_TYPE_CUSTOM, and helics::make_filter().

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

◆ helicsFederateGetFilter()

HelicsFilter helicsFederateGetFilter ( HelicsFederate  fed,
const char *  name,
HelicsError 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.
[in,out]errThe error object to complete if there is an error.
Returns
A HelicsFilter object, the object will not be valid and err will contain an error code if no filter with the specified name exists.

References HelicsError::error_code, HELICS_ERROR_INVALID_ARGUMENT, and HelicsError::message.

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

◆ helicsFederateGetFilterByIndex()

HelicsFilter helicsFederateGetFilterByIndex ( HelicsFederate  fed,
int  index,
HelicsError 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.
[in,out]errA pointer to an error object for catching errors.
Returns
A HelicsFilter, which will be NULL if an invalid index is given.

References HelicsError::error_code, HELICS_ERROR_INVALID_ARGUMENT, and HelicsError::message.

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

◆ helicsFederateGetFilterCount()

int helicsFederateGetFilterCount ( HelicsFederate  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.

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

◆ helicsFederateRegisterCloningFilter()

HelicsFilter helicsFederateRegisterCloningFilter ( HelicsFederate  fed,
const char *  name,
HelicsError 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).
[in,out]errA pointer to an error object for catching errors.
Returns
A HelicsFilter object.

References helics::make_cloning_filter().

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

◆ helicsFederateRegisterFilter()

HelicsFilter helicsFederateRegisterFilter ( HelicsFederate  fed,
HelicsFilterTypes  type,
const char *  name,
HelicsError 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 HelicsFilterTypes.
nameThe name of the filter (can be NULL).
[in,out]errA pointer to an error object for catching errors.
Returns
A HelicsFilter object.

References HELICS_FILTER_TYPE_CUSTOM, and helics::make_filter().

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

◆ helicsFederateRegisterGlobalCloningFilter()

HelicsFilter helicsFederateRegisterGlobalCloningFilter ( HelicsFederate  fed,
const char *  name,
HelicsError 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).
[in,out]errA pointer to an error object for catching errors.
Returns
A HelicsFilter object.

References helics::make_cloning_filter().

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

◆ helicsFederateRegisterGlobalFilter()

HelicsFilter helicsFederateRegisterGlobalFilter ( HelicsFederate  fed,
HelicsFilterTypes  type,
const char *  name,
HelicsError 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 HelicsFilterTypes.
nameThe name of the filter (can be NULL).
[in,out]errA pointer to an error object for catching errors.
Returns
A HelicsFilter object.

References helics::make_filter().

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

◆ helicsFilterAddDestinationTarget()

void helicsFilterAddDestinationTarget ( HelicsFilter  filt,
const char *  dst,
HelicsError 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.
[in,out]errA pointer to an error object for catching errors.

References helics::Interface::addDestinationTarget().

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

◆ helicsFilterAddSourceTarget()

void helicsFilterAddSourceTarget ( HelicsFilter  filt,
const char *  source,
HelicsError 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.
[in,out]errA pointer to an error object for catching errors.

References helics::Interface::addSourceTarget().

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

◆ helicsFilterGetName()

const char* helicsFilterGetName ( HelicsFilter  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

References helics::Interface::getName().

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

◆ helicsFilterIsValid()

HelicsBool helicsFilterIsValid ( HelicsFilter  filt)

Check if a filter is valid.

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

References HELICS_FALSE, HELICS_TRUE, and helics::Interface::isValid().

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

◆ helicsFilterSet()

void helicsFilterSet ( HelicsFilter  filt,
const char *  prop,
double  val,
HelicsError 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.
[in,out]errA pointer to an error object for catching errors.

References helics::Filter::set().

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

◆ helicsFilterSetString()

void helicsFilterSetString ( HelicsFilter  filt,
const char *  prop,
const char *  val,
HelicsError 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.
[in,out]errA pointer to an error object for catching errors.

References helics::Filter::setString().

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