| helics 3.6.1

api-data.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
8 #ifndef HELICS_API_DATA_H_
9 #define HELICS_API_DATA_H_
10
16 #include "../helics_enums.h"
17
18 #include <stdint.h>
19 #ifdef __cplusplus
20 extern "C" {
21 #endif
22
26 typedef void* HelicsInput;
27 // typedef void* helics_input;
31 typedef void* HelicsPublication;
32 // typedef void* helics_publication;
36 // typedef void* helics_endpoint;
37 typedef void* HelicsEndpoint;
38
42 // typedef void* helics_filter;
43 typedef void* HelicsFilter;
44
48 typedef void* HelicsTranslator;
49
53 // typedef void* helics_core;
54 typedef void* HelicsCore;
55
59 // typedef void* helics_broker;
60 typedef void* HelicsBroker;
64 // typedef void* helics_federate;
65 typedef void* HelicsFederate;
66
70 // typedef void* helics_federate;
71 typedef void* HelicsApp;
72
76 // typedef void* helics_federate_info;
77 typedef void* HelicsFederateInfo;
78
82 // typedef void* helics_query;
83 typedef void* HelicsQuery;
84
88 typedef void* HelicsDataBuffer;
89
93 // typedef void* helics_query_buffer;
94 typedef void* HelicsQueryBuffer;
95
99 // typedef void* helics_message;
100 typedef void* HelicsMessage;
101
105 // typedef double helics_time;
106 typedef double HelicsTime;
107
108 const HelicsTime HELICS_TIME_ZERO = 0.0;
109 const HelicsTime HELICS_TIME_EPSILON = 1.0e-9;
110 const HelicsTime HELICS_TIME_INVALID = -1.785e39;
111 const HelicsTime HELICS_TIME_MAXTIME = HELICS_BIG_NUMBER;
117 // typedef int helics_bool;
118 typedef int HelicsBool;
119
120 const HelicsBool HELICS_TRUE = 1;
121 const HelicsBool HELICS_FALSE = 0;
126 typedef enum {
127 HELICS_ITERATION_REQUEST_NO_ITERATION = 0,
128 HELICS_ITERATION_REQUEST_FORCE_ITERATION = 1,
129 HELICS_ITERATION_REQUEST_ITERATE_IF_NEEDED = 2,
130 HELICS_ITERATION_REQUEST_HALT_OPERATIONS = 5,
131 HELICS_ITERATION_REQUEST_ERROR = 7
132 } HelicsIterationRequest;
133
137 typedef enum {
138 HELICS_ITERATION_RESULT_NEXT_STEP = 0,
139 HELICS_ITERATION_RESULT_ERROR = 1,
140 HELICS_ITERATION_RESULT_HALTED = 2,
141 HELICS_ITERATION_RESULT_ITERATING = 3
142 } HelicsIterationResult;
143
147 typedef enum {
148 HELICS_STATE_UNKNOWN = -1,
149 HELICS_STATE_STARTUP = 0,
150 HELICS_STATE_INITIALIZATION = 1,
151 HELICS_STATE_EXECUTION = 2,
152 HELICS_STATE_FINALIZE = 3,
153 HELICS_STATE_ERROR = 4,
154 /* the following states are for asynchronous operations */
155 HELICS_STATE_PENDING_INIT = 5,
156 HELICS_STATE_PENDING_EXEC = 6,
157 HELICS_STATE_PENDING_TIME = 7,
158 HELICS_STATE_PENDING_ITERATIVE_TIME = 8,
159 HELICS_STATE_PENDING_FINALIZE = 9,
160 HELICS_STATE_FINISHED = 10
161 } HelicsFederateState;
162
166 typedef struct HelicsComplex {
167 double real;
168 double imag;
169 } HelicsComplex;
170
177 typedef struct HelicsError {
178 int32_t error_code;
179 const char* message;
180 } HelicsError;
181
182 // typedef helics_error HelicsError;
183
184 #ifdef __cplusplus
185 } /* end of extern "C" { */
186 #endif
187
188 #endif
HelicsDataBuffer
void * HelicsDataBuffer
Definition: api-data.h:88
HelicsFederateInfo
void * HelicsFederateInfo
Definition: api-data.h:77
HelicsInput
void * HelicsInput
Definition: api-data.h:26
HelicsCore
void * HelicsCore
Definition: api-data.h:54
HELICS_TIME_EPSILON
const HelicsTime HELICS_TIME_EPSILON
Definition: api-data.h:109
HelicsPublication
void * HelicsPublication
Definition: api-data.h:31
HelicsError
struct HelicsError HelicsError
HelicsEndpoint
void * HelicsEndpoint
Definition: api-data.h:37
HelicsFilter
void * HelicsFilter
Definition: api-data.h:43
HelicsTime
double HelicsTime
Definition: api-data.h:106
HelicsApp
void * HelicsApp
Definition: api-data.h:71
HelicsIterationResult
HelicsIterationResult
Definition: api-data.h:137
HELICS_ITERATION_RESULT_ITERATING
@ HELICS_ITERATION_RESULT_ITERATING
Definition: api-data.h:141
HELICS_ITERATION_RESULT_HALTED
@ HELICS_ITERATION_RESULT_HALTED
Definition: api-data.h:140
HELICS_ITERATION_RESULT_NEXT_STEP
@ HELICS_ITERATION_RESULT_NEXT_STEP
Definition: api-data.h:138
HELICS_ITERATION_RESULT_ERROR
@ HELICS_ITERATION_RESULT_ERROR
Definition: api-data.h:139
HelicsTranslator
void * HelicsTranslator
Definition: api-data.h:48
HelicsMessage
void * HelicsMessage
Definition: api-data.h:100
HelicsBool
int HelicsBool
Definition: api-data.h:118
HelicsQuery
void * HelicsQuery
Definition: api-data.h:83
HelicsFederateState
HelicsFederateState
Definition: api-data.h:147
HELICS_STATE_PENDING_INIT
@ HELICS_STATE_PENDING_INIT
Definition: api-data.h:155
HELICS_STATE_PENDING_ITERATIVE_TIME
@ HELICS_STATE_PENDING_ITERATIVE_TIME
Definition: api-data.h:158
HELICS_STATE_EXECUTION
@ HELICS_STATE_EXECUTION
Definition: api-data.h:151
HELICS_STATE_INITIALIZATION
@ HELICS_STATE_INITIALIZATION
Definition: api-data.h:150
HELICS_STATE_FINALIZE
@ HELICS_STATE_FINALIZE
Definition: api-data.h:152
HELICS_STATE_ERROR
@ HELICS_STATE_ERROR
Definition: api-data.h:153
HELICS_STATE_PENDING_FINALIZE
@ HELICS_STATE_PENDING_FINALIZE
Definition: api-data.h:159
HELICS_STATE_PENDING_TIME
@ HELICS_STATE_PENDING_TIME
Definition: api-data.h:157
HELICS_STATE_STARTUP
@ HELICS_STATE_STARTUP
Definition: api-data.h:149
HELICS_STATE_PENDING_EXEC
@ HELICS_STATE_PENDING_EXEC
Definition: api-data.h:156
HELICS_STATE_FINISHED
@ HELICS_STATE_FINISHED
Definition: api-data.h:160
HelicsIterationRequest
HelicsIterationRequest
Definition: api-data.h:126
HELICS_ITERATION_REQUEST_FORCE_ITERATION
@ HELICS_ITERATION_REQUEST_FORCE_ITERATION
Definition: api-data.h:128
HELICS_ITERATION_REQUEST_ERROR
@ HELICS_ITERATION_REQUEST_ERROR
Definition: api-data.h:131
HELICS_ITERATION_REQUEST_HALT_OPERATIONS
@ HELICS_ITERATION_REQUEST_HALT_OPERATIONS
Definition: api-data.h:130
HELICS_ITERATION_REQUEST_ITERATE_IF_NEEDED
@ HELICS_ITERATION_REQUEST_ITERATE_IF_NEEDED
Definition: api-data.h:129
HELICS_ITERATION_REQUEST_NO_ITERATION
@ HELICS_ITERATION_REQUEST_NO_ITERATION
Definition: api-data.h:127
HelicsFederate
void * HelicsFederate
Definition: api-data.h:65
HELICS_FALSE
const HelicsBool HELICS_FALSE
Definition: api-data.h:121
HelicsComplex
struct HelicsComplex HelicsComplex
HELICS_TIME_MAXTIME
const HelicsTime HELICS_TIME_MAXTIME
Definition: api-data.h:111
HelicsQueryBuffer
void * HelicsQueryBuffer
Definition: api-data.h:94
HELICS_TIME_INVALID
const HelicsTime HELICS_TIME_INVALID
Definition: api-data.h:110
HELICS_TRUE
const HelicsBool HELICS_TRUE
Definition: api-data.h:120
HELICS_TIME_ZERO
const HelicsTime HELICS_TIME_ZERO
Definition: api-data.h:108
HelicsBroker
void * HelicsBroker
Definition: api-data.h:60
HelicsComplex
Definition: api-data.h:166
HelicsError
Definition: api-data.h:177
HelicsError::message
const char * message
Definition: api-data.h:179
HelicsError::error_code
int32_t error_code
Definition: api-data.h:178