| helics 3.6.1

MessageFederate.h
Go to the documentation of this file.
1 /*
2 Copyright (c) 2017-2025,
3 Battelle Memorial Institute; Lawrence Livermore National Security, LLC; Alliance for Sustainable Energy, LLC. See the top-level NOTICE for
4 additional details. All rights reserved.
5 SPDX-License-Identifier: BSD-3-Clause
6 */
7
13 #ifndef HELICS_APISHARED_MESSAGE_FEDERATE_FUNCTIONS_H_
14 #define HELICS_APISHARED_MESSAGE_FEDERATE_FUNCTIONS_H_
15
16 #include "helicsCore.h"
17
18 #ifdef __cplusplus
19 extern "C" {
20 #endif
21
22 /* MessageFederate Calls*/
23
40 HELICS_EXPORT HelicsEndpoint helicsFederateRegisterEndpoint(HelicsFederate fed, const char* name, const char* type, HelicsError* err);
41
57 HELICS_EXPORT HelicsEndpoint helicsFederateRegisterGlobalEndpoint(HelicsFederate fed, const char* name, const char* type, HelicsError* err);
58
76 HELICS_EXPORT HelicsEndpoint helicsFederateRegisterTargetedEndpoint(HelicsFederate fed,
77 const char* name,
78 const char* type,
79 HelicsError* err);
80
97 HELICS_EXPORT HelicsEndpoint helicsFederateRegisterGlobalTargetedEndpoint(HelicsFederate fed,
98 const char* name,
99 const char* type,
100 HelicsError* err);
101
115 HELICS_EXPORT HelicsEndpoint helicsFederateGetEndpoint(HelicsFederate fed, const char* name, HelicsError* err);
116
130 HELICS_EXPORT HelicsEndpoint helicsFederateGetEndpointByIndex(HelicsFederate fed, int index, HelicsError* err);
131
139 HELICS_EXPORT HelicsBool helicsEndpointIsValid(HelicsEndpoint endpoint);
140
149 HELICS_EXPORT void helicsEndpointSetDefaultDestination(HelicsEndpoint endpoint, const char* dst, HelicsError* err);
150
158 HELICS_EXPORT const char* helicsEndpointGetDefaultDestination(HelicsEndpoint endpoint);
159
167 HELICS_EXPORT void helicsEndpointSendString(HelicsEndpoint endpoint, const char* message, HelicsError* err);
168
179 HELICS_EXPORT void helicsEndpointSendStringTo(HelicsEndpoint endpoint, const char* message, const char* dst, HelicsError* err);
180
194 HELICS_EXPORT void
195 helicsEndpointSendStringToAt(HelicsEndpoint endpoint, const char* message, const char* dst, HelicsTime time, HelicsError* err);
196
209 HELICS_EXPORT void helicsEndpointSendStringAt(HelicsEndpoint endpoint, const char* message, HelicsTime time, HelicsError* err);
210
220 HELICS_EXPORT void helicsEndpointSendBytes(HelicsEndpoint endpoint, const void* data, int inputDataLength, HelicsError* err);
221
233 HELICS_EXPORT void
234 helicsEndpointSendBytesTo(HelicsEndpoint endpoint, const void* data, int inputDataLength, const char* dst, HelicsError* err);
235
251 HELICS_EXPORT void helicsEndpointSendBytesToAt(HelicsEndpoint endpoint,
252 const void* data,
253 int inputDataLength,
254 const char* dst,
255 HelicsTime time,
256 HelicsError* err);
257
272 HELICS_EXPORT void
273 helicsEndpointSendBytesAt(HelicsEndpoint endpoint, const void* data, int inputDataLength, HelicsTime time, HelicsError* err);
274
283 HELICS_EXPORT void helicsEndpointSendMessage(HelicsEndpoint endpoint, HelicsMessage message, HelicsError* err);
284
294 HELICS_EXPORT void helicsEndpointSendMessageZeroCopy(HelicsEndpoint endpoint, HelicsMessage message, HelicsError* err);
295
304 HELICS_EXPORT void helicsEndpointSubscribe(HelicsEndpoint endpoint, const char* key, HelicsError* err);
305
313 HELICS_EXPORT HelicsBool helicsFederateHasMessage(HelicsFederate fed);
314
322 HELICS_EXPORT HelicsBool helicsEndpointHasMessage(HelicsEndpoint endpoint);
323
329 HELICS_EXPORT int helicsFederatePendingMessageCount(HelicsFederate fed);
330
336 HELICS_EXPORT int helicsEndpointPendingMessageCount(HelicsEndpoint endpoint);
337
345 HELICS_EXPORT HelicsMessage helicsEndpointGetMessage(HelicsEndpoint endpoint);
346
359 HELICS_EXPORT HelicsMessage helicsEndpointCreateMessage(HelicsEndpoint endpoint, HelicsError* err);
360
368 HELICS_EXPORT void helicsEndpointClearMessages(HelicsEndpoint endpoint);
369
379 HELICS_EXPORT HelicsMessage helicsFederateGetMessage(HelicsFederate fed);
380
393 HELICS_EXPORT HelicsMessage helicsFederateCreateMessage(HelicsFederate fed, HelicsError* err);
394
402 HELICS_EXPORT void helicsFederateClearMessages(HelicsFederate fed);
403
411 HELICS_EXPORT const char* helicsEndpointGetType(HelicsEndpoint endpoint);
412
420 HELICS_EXPORT const char* helicsEndpointGetName(HelicsEndpoint endpoint);
421
429 HELICS_EXPORT int helicsFederateGetEndpointCount(HelicsFederate fed);
430
438 HELICS_EXPORT const char* helicsEndpointGetInfo(HelicsEndpoint end);
439
449 HELICS_EXPORT void helicsEndpointSetInfo(HelicsEndpoint endpoint, const char* info, HelicsError* err);
450
458 HELICS_EXPORT const char* helicsEndpointGetTag(HelicsEndpoint endpoint, const char* tagname);
459
470 HELICS_EXPORT void helicsEndpointSetTag(HelicsEndpoint endpoint, const char* tagname, const char* tagvalue, HelicsError* err);
471
482 HELICS_EXPORT void helicsEndpointSetOption(HelicsEndpoint endpoint, int option, int value, HelicsError* err);
483
491 HELICS_EXPORT int helicsEndpointGetOption(HelicsEndpoint endpoint, int option);
492
502 HELICS_EXPORT void helicsEndpointAddSourceTarget(HelicsEndpoint endpoint, const char* targetEndpoint, HelicsError* err);
503
513 HELICS_EXPORT void helicsEndpointAddDestinationTarget(HelicsEndpoint endpoint, const char* targetEndpoint, HelicsError* err);
514
524 HELICS_EXPORT void helicsEndpointRemoveTarget(HelicsEndpoint endpoint, const char* targetEndpoint, HelicsError* err);
525
535 HELICS_EXPORT void helicsEndpointAddSourceFilter(HelicsEndpoint endpoint, const char* filterName, HelicsError* err);
536
545 HELICS_EXPORT void helicsEndpointAddDestinationFilter(HelicsEndpoint endpoint, const char* filterName, HelicsError* err);
546
560 HELICS_EXPORT const char* helicsMessageGetSource(HelicsMessage message);
561
569 HELICS_EXPORT const char* helicsMessageGetDestination(HelicsMessage message);
570
578 HELICS_EXPORT const char* helicsMessageGetOriginalSource(HelicsMessage message);
579
587 HELICS_EXPORT const char* helicsMessageGetOriginalDestination(HelicsMessage message);
588
596 HELICS_EXPORT HelicsTime helicsMessageGetTime(HelicsMessage message);
597
605 HELICS_EXPORT const char* helicsMessageGetString(HelicsMessage message);
606
614 HELICS_EXPORT int helicsMessageGetMessageID(HelicsMessage message);
615
624 HELICS_EXPORT HelicsBool helicsMessageGetFlagOption(HelicsMessage message, int flag);
625
633 HELICS_EXPORT int helicsMessageGetByteCount(HelicsMessage message);
634
645 HELICS_EXPORT void helicsMessageGetBytes(HelicsMessage message, void* data, int maxMessageLength, int* actualSize, HelicsError* err);
646
654 HELICS_EXPORT void* helicsMessageGetBytesPointer(HelicsMessage message);
655
663 HELICS_EXPORT HelicsDataBuffer helicsMessageDataBuffer(HelicsMessage message, HelicsError* err);
664
672 HELICS_EXPORT HelicsBool helicsMessageIsValid(HelicsMessage message);
673
682 HELICS_EXPORT void helicsMessageSetSource(HelicsMessage message, const char* src, HelicsError* err);
683
692 HELICS_EXPORT void helicsMessageSetDestination(HelicsMessage message, const char* dst, HelicsError* err);
693
702 HELICS_EXPORT void helicsMessageSetOriginalSource(HelicsMessage message, const char* src, HelicsError* err);
703
712 HELICS_EXPORT void helicsMessageSetOriginalDestination(HelicsMessage message, const char* dst, HelicsError* err);
713
722 HELICS_EXPORT void helicsMessageSetTime(HelicsMessage message, HelicsTime time, HelicsError* err);
723
735 HELICS_EXPORT void helicsMessageResize(HelicsMessage message, int newSize, HelicsError* err);
736
747 HELICS_EXPORT void helicsMessageReserve(HelicsMessage message, int reserveSize, HelicsError* err);
748
759 HELICS_EXPORT void helicsMessageSetMessageID(HelicsMessage message, int32_t messageID, HelicsError* err);
760
766 HELICS_EXPORT void helicsMessageClearFlags(HelicsMessage message);
767
777 HELICS_EXPORT void helicsMessageSetFlagOption(HelicsMessage message, int flag, HelicsBool flagValue, HelicsError* err);
778
787 HELICS_EXPORT void helicsMessageSetString(HelicsMessage message, const char* data, HelicsError* err);
788
798 HELICS_EXPORT void helicsMessageSetData(HelicsMessage message, const void* data, int inputDataLength, HelicsError* err);
799
808 HELICS_EXPORT void helicsMessageSetDataBuffer(HelicsMessage message, HelicsDataBuffer data, HelicsError* err);
809
819 HELICS_EXPORT void helicsMessageAppendData(HelicsMessage message, const void* data, int inputDataLength, HelicsError* err);
820
829 HELICS_EXPORT void helicsMessageCopy(HelicsMessage src_message, HelicsMessage dst_message, HelicsError* err);
830
838 HELICS_EXPORT HelicsMessage helicsMessageClone(HelicsMessage message, HelicsError* err);
839
847 HELICS_EXPORT void helicsMessageFree(HelicsMessage message);
848
856 HELICS_EXPORT void helicsMessageClear(HelicsMessage message, HelicsError* err);
857
859 #ifdef __cplusplus
860 } /* end of extern "C" { */
861 #endif
862
863 #endif /*HELICS_APISHARED_MESSAGE_FEDERATE_FUNCTIONS_H_*/
helicsFederateRegisterGlobalEndpoint
HelicsEndpoint helicsFederateRegisterGlobalEndpoint(HelicsFederate fed, const char *name, const char *type, HelicsError *err)
Definition: MessageFederateExport.cpp:118
helicsEndpointAddDestinationFilter
void helicsEndpointAddDestinationFilter(HelicsEndpoint endpoint, const char *filterName, HelicsError *err)
Definition: MessageFederateExport.cpp:851
helicsEndpointSendStringTo
void helicsEndpointSendStringTo(HelicsEndpoint endpoint, const char *message, const char *dst, HelicsError *err)
Definition: MessageFederateExport.cpp:260
helicsEndpointSetDefaultDestination
void helicsEndpointSetDefaultDestination(HelicsEndpoint endpoint, const char *dst, HelicsError *err)
Definition: MessageFederateExport.cpp:215
helicsEndpointSendStringAt
void helicsEndpointSendStringAt(HelicsEndpoint endpoint, const char *message, HelicsTime time, HelicsError *err)
Definition: MessageFederateExport.cpp:274
helicsEndpointIsValid
HelicsBool helicsEndpointIsValid(HelicsEndpoint endpoint)
Definition: MessageFederateExport.cpp:206
helicsEndpointAddSourceTarget
void helicsEndpointAddSourceTarget(HelicsEndpoint endpoint, const char *targetEndpoint, HelicsError *err)
Definition: MessageFederateExport.cpp:787
helicsEndpointCreateMessage
HelicsMessage helicsEndpointCreateMessage(HelicsEndpoint endpoint, HelicsError *err)
Definition: MessageFederateExport.cpp:596
helicsEndpointSendBytes
void helicsEndpointSendBytes(HelicsEndpoint endpoint, const void *data, int inputDataLength, HelicsError *err)
Definition: MessageFederateExport.cpp:302
helicsEndpointSubscribe
void helicsEndpointSubscribe(HelicsEndpoint endpoint, const char *key, HelicsError *err)
Definition: MessageFederateExport.cpp:419
helicsEndpointSendMessageZeroCopy
void helicsEndpointSendMessageZeroCopy(HelicsEndpoint endpoint, HelicsMessage message, HelicsError *err)
Definition: MessageFederateExport.cpp:399
helicsEndpointSetOption
void helicsEndpointSetOption(HelicsEndpoint endpoint, int option, int value, HelicsError *err)
Definition: MessageFederateExport.cpp:771
helicsEndpointPendingMessageCount
int helicsEndpointPendingMessageCount(HelicsEndpoint endpoint)
Definition: MessageFederateExport.cpp:463
helicsEndpointGetInfo
const char * helicsEndpointGetInfo(HelicsEndpoint end)
Definition: MessageFederateExport.cpp:689
helicsEndpointGetOption
int helicsEndpointGetOption(HelicsEndpoint endpoint, int option)
Definition: MessageFederateExport.cpp:755
helicsEndpointGetTag
const char * helicsEndpointGetTag(HelicsEndpoint endpoint, const char *tagname)
Definition: MessageFederateExport.cpp:722
helicsEndpointSendBytesAt
void helicsEndpointSendBytesAt(HelicsEndpoint endpoint, const void *data, int inputDataLength, HelicsTime time, HelicsError *err)
Definition: MessageFederateExport.cpp:338
helicsFederateRegisterTargetedEndpoint
HelicsEndpoint helicsFederateRegisterTargetedEndpoint(HelicsFederate fed, const char *name, const char *type, HelicsError *err)
Definition: MessageFederateExport.cpp:97
helicsEndpointGetName
const char * helicsEndpointGetName(HelicsEndpoint endpoint)
Definition: MessageFederateExport.cpp:669
helicsFederateRegisterEndpoint
HelicsEndpoint helicsFederateRegisterEndpoint(HelicsFederate fed, const char *name, const char *type, HelicsError *err)
Definition: MessageFederateExport.cpp:76
helicsEndpointRemoveTarget
void helicsEndpointRemoveTarget(HelicsEndpoint endpoint, const char *targetEndpoint, HelicsError *err)
Definition: MessageFederateExport.cpp:819
helicsEndpointHasMessage
HelicsBool helicsEndpointHasMessage(HelicsEndpoint endpoint)
Definition: MessageFederateExport.cpp:445
helicsEndpointSendMessage
void helicsEndpointSendMessage(HelicsEndpoint endpoint, HelicsMessage message, HelicsError *err)
Definition: MessageFederateExport.cpp:381
helicsEndpointSetTag
void helicsEndpointSetTag(HelicsEndpoint endpoint, const char *tagname, const char *tagvalue, HelicsError *err)
Definition: MessageFederateExport.cpp:739
helicsEndpointGetType
const char * helicsEndpointGetType(HelicsEndpoint endpoint)
Definition: MessageFederateExport.cpp:651
helicsEndpointSendString
void helicsEndpointSendString(HelicsEndpoint endpoint, const char *message, HelicsError *err)
Definition: MessageFederateExport.cpp:242
helicsFederateGetMessage
HelicsMessage helicsFederateGetMessage(HelicsFederate fed)
Definition: MessageFederateExport.cpp:569
helicsFederateHasMessage
HelicsBool helicsFederateHasMessage(HelicsFederate fed)
Definition: MessageFederateExport.cpp:436
helicsEndpointGetDefaultDestination
const char * helicsEndpointGetDefaultDestination(HelicsEndpoint endpoint)
Definition: MessageFederateExport.cpp:232
helicsEndpointClearMessages
void helicsEndpointClearMessages(HelicsEndpoint endpoint)
Definition: MessageFederateExport.cpp:617
helicsEndpointSendBytesTo
void helicsEndpointSendBytesTo(HelicsEndpoint endpoint, const void *data, int inputDataLength, const char *dst, HelicsError *err)
Definition: MessageFederateExport.cpp:320
helicsFederateGetEndpointCount
int helicsFederateGetEndpointCount(HelicsFederate fed)
Definition: MessageFederateExport.cpp:679
helicsFederateClearMessages
void helicsFederateClearMessages(HelicsFederate fed)
Definition: MessageFederateExport.cpp:608
helicsFederateGetEndpoint
HelicsEndpoint helicsFederateGetEndpoint(HelicsFederate fed, const char *name, HelicsError *err)
Definition: MessageFederateExport.cpp:161
helicsEndpointGetMessage
HelicsMessage helicsEndpointGetMessage(HelicsEndpoint endpoint)
Definition: MessageFederateExport.cpp:553
helicsFederateCreateMessage
HelicsMessage helicsFederateCreateMessage(HelicsFederate fed, HelicsError *err)
Definition: MessageFederateExport.cpp:587
helicsFederateRegisterGlobalTargetedEndpoint
HelicsEndpoint helicsFederateRegisterGlobalTargetedEndpoint(HelicsFederate fed, const char *name, const char *type, HelicsError *err)
Definition: MessageFederateExport.cpp:138
helicsEndpointSendStringToAt
void helicsEndpointSendStringToAt(HelicsEndpoint endpoint, const char *message, const char *dst, HelicsTime time, HelicsError *err)
Definition: MessageFederateExport.cpp:288
helicsEndpointAddSourceFilter
void helicsEndpointAddSourceFilter(HelicsEndpoint endpoint, const char *filterName, HelicsError *err)
Definition: MessageFederateExport.cpp:835
helicsFederatePendingMessageCount
int helicsFederatePendingMessageCount(HelicsFederate fed)
Definition: MessageFederateExport.cpp:454
helicsFederateGetEndpointByIndex
HelicsEndpoint helicsFederateGetEndpointByIndex(HelicsFederate fed, int index, HelicsError *err)
Definition: MessageFederateExport.cpp:184
helicsEndpointSendBytesToAt
void helicsEndpointSendBytesToAt(HelicsEndpoint endpoint, const void *data, int inputDataLength, const char *dst, HelicsTime time, HelicsError *err)
Definition: MessageFederateExport.cpp:356
helicsEndpointSetInfo
void helicsEndpointSetInfo(HelicsEndpoint endpoint, const char *info, HelicsError *err)
Definition: MessageFederateExport.cpp:706
helicsEndpointAddDestinationTarget
void helicsEndpointAddDestinationTarget(HelicsEndpoint endpoint, const char *targetEndpoint, HelicsError *err)
Definition: MessageFederateExport.cpp:803
HelicsDataBuffer
void * HelicsDataBuffer
Definition: api-data.h:88
HelicsEndpoint
void * HelicsEndpoint
Definition: api-data.h:37
HelicsTime
double HelicsTime
Definition: api-data.h:106
HelicsMessage
void * HelicsMessage
Definition: api-data.h:100
HelicsBool
int HelicsBool
Definition: api-data.h:118
HelicsFederate
void * HelicsFederate
Definition: api-data.h:65
helicsMessageGetString
const char * helicsMessageGetString(HelicsMessage message)
Definition: MessageFederateExport.cpp:980
helicsMessageGetOriginalSource
const char * helicsMessageGetOriginalSource(HelicsMessage message)
Definition: MessageFederateExport.cpp:931
helicsMessageAppendData
void helicsMessageAppendData(HelicsMessage message, const void *data, int inputDataLength, HelicsError *err)
Definition: MessageFederateExport.cpp:1190
helicsMessageClone
HelicsMessage helicsMessageClone(HelicsMessage message, HelicsError *err)
Definition: MessageFederateExport.cpp:1228
helicsMessageSetFlagOption
void helicsMessageSetFlagOption(HelicsMessage message, int flag, HelicsBool flagValue, HelicsError *err)
Definition: MessageFederateExport.cpp:1139
helicsMessageGetByteCount
int helicsMessageGetByteCount(HelicsMessage message)
Definition: MessageFederateExport.cpp:991
helicsMessageSetDestination
void helicsMessageSetDestination(HelicsMessage message, const char *dst, HelicsError *err)
Definition: MessageFederateExport.cpp:1060
helicsMessageResize
void helicsMessageResize(HelicsMessage message, int newSize, HelicsError *err)
Definition: MessageFederateExport.cpp:1093
helicsMessageClearFlags
void helicsMessageClearFlags(HelicsMessage message)
Definition: MessageFederateExport.cpp:1130
helicsMessageSetData
void helicsMessageSetData(HelicsMessage message, const void *data, int inputDataLength, HelicsError *err)
Definition: MessageFederateExport.cpp:1167
helicsMessageGetSource
const char * helicsMessageGetSource(HelicsMessage message)
Definition: MessageFederateExport.cpp:913
helicsMessageSetDataBuffer
void helicsMessageSetDataBuffer(HelicsMessage message, HelicsDataBuffer data, HelicsError *err)
Definition: MessageFederateExport.cpp:1176
helicsMessageGetFlagOption
HelicsBool helicsMessageGetFlagOption(HelicsMessage message, int flag)
Definition: MessageFederateExport.cpp:967
helicsMessageGetBytesPointer
void * helicsMessageGetBytesPointer(HelicsMessage message)
Definition: MessageFederateExport.cpp:1024
helicsMessageSetString
void helicsMessageSetString(HelicsMessage message, const char *data, HelicsError *err)
Definition: MessageFederateExport.cpp:1157
helicsMessageDataBuffer
HelicsDataBuffer helicsMessageDataBuffer(HelicsMessage message, HelicsError *err)
Definition: MessageFederateExport.cpp:1033
helicsMessageFree
void helicsMessageFree(HelicsMessage message)
Definition: MessageFederateExport.cpp:1252
helicsMessageGetMessageID
int helicsMessageGetMessageID(HelicsMessage message)
Definition: MessageFederateExport.cpp:958
helicsMessageClear
void helicsMessageClear(HelicsMessage message, HelicsError *err)
Definition: MessageFederateExport.cpp:1199
helicsMessageGetDestination
const char * helicsMessageGetDestination(HelicsMessage message)
Definition: MessageFederateExport.cpp:922
helicsMessageSetSource
void helicsMessageSetSource(HelicsMessage message, const char *src, HelicsError *err)
Definition: MessageFederateExport.cpp:1051
helicsMessageSetTime
void helicsMessageSetTime(HelicsMessage message, HelicsTime time, HelicsError *err)
Definition: MessageFederateExport.cpp:1084
helicsMessageSetOriginalDestination
void helicsMessageSetOriginalDestination(HelicsMessage message, const char *dst, HelicsError *err)
Definition: MessageFederateExport.cpp:1076
helicsMessageGetOriginalDestination
const char * helicsMessageGetOriginalDestination(HelicsMessage message)
Definition: MessageFederateExport.cpp:940
helicsMessageCopy
void helicsMessageCopy(HelicsMessage src_message, HelicsMessage dst_message, HelicsError *err)
Definition: MessageFederateExport.cpp:1208
helicsMessageReserve
void helicsMessageReserve(HelicsMessage message, int reserveSize, HelicsError *err)
Definition: MessageFederateExport.cpp:1107
helicsMessageSetOriginalSource
void helicsMessageSetOriginalSource(HelicsMessage message, const char *src, HelicsError *err)
Definition: MessageFederateExport.cpp:1068
helicsMessageGetTime
HelicsTime helicsMessageGetTime(HelicsMessage message)
Definition: MessageFederateExport.cpp:949
helicsMessageSetMessageID
void helicsMessageSetMessageID(HelicsMessage message, int32_t messageID, HelicsError *err)
Definition: MessageFederateExport.cpp:1121
helicsMessageIsValid
HelicsBool helicsMessageIsValid(HelicsMessage message)
Definition: MessageFederateExport.cpp:1042
helicsMessageGetBytes
void helicsMessageGetBytes(HelicsMessage message, void *data, int maxMessageLength, int *actualSize, HelicsError *err)
Definition: MessageFederateExport.cpp:1000
helicsCore.h
Common functions for the HELICS C api.
HelicsError
Definition: api-data.h:177