Skip to content

Commit

Permalink
Add functions from v2.5.1
Browse files Browse the repository at this point in the history
  • Loading branch information
kdheepak committed Jun 12, 2020
1 parent 406bc5d commit 378be65
Show file tree
Hide file tree
Showing 4 changed files with 107 additions and 17 deletions.
14 changes: 7 additions & 7 deletions scripts/Manifest.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ version = "0.11.0"

[[DataStructures]]
deps = ["InteractiveUtils", "OrderedCollections"]
git-tree-sha1 = "7d7578b00789cf16c5f68fad71868e773edd58a2"
git-tree-sha1 = "af6d9c86e191c917c2276fbede1137e8ea20157f"
uuid = "864edb3b-99cc-5e75-8d2d-829cb0a9cfe8"
version = "0.17.16"
version = "0.17.17"

[[Dates]]
deps = ["Printf"]
Expand All @@ -38,13 +38,13 @@ version = "0.8.1"
deps = ["CEnum", "DocStringExtensions", "HELICS_jll", "Libdl"]
path = ".."
uuid = "81524022-8764-5038-b61c-08cb1f58760f"
version = "0.7.0"
version = "0.7.1"

[[HELICS_jll]]
deps = ["Libdl", "Pkg", "ZeroMQ_jll"]
git-tree-sha1 = "1ac0324914502afcf2170dad6190df0a037100bd"
git-tree-sha1 = "abb2dc9f3db4b5429690e6e5d80d5a32e033e165"
uuid = "ef3b0bb0-9dc6-5204-90f3-946fd7d0da3e"
version = "2.5.0+0"
version = "2.5.1+0"

[[InteractiveUtils]]
deps = ["Markdown"]
Expand Down Expand Up @@ -113,6 +113,6 @@ uuid = "4ec0a83e-493e-50e2-b9ac-8f72acf5a8f5"

[[ZeroMQ_jll]]
deps = ["Libdl", "Pkg"]
git-tree-sha1 = "42b0955a7ad0935d454d750fedd812d3f2836fde"
git-tree-sha1 = "733352667c60ce39dfd3017db9b798b288c87417"
uuid = "8f1865be-045e-5c20-9c9f-bfbfb0764568"
version = "4.3.2+2"
version = "4.3.2+4"
37 changes: 37 additions & 0 deletions src/api.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3963,3 +3963,40 @@ Check if a [`Input`](@ref) is valid.
function helicsInputIsValid(ipt)::Bool
Lib.helicsInputIsValid(ipt)
end


function helicsEndpointCreateMessageObject(endpoint::Endpoint)
@invoke_and_check Lib.helicsEndpointCreateMessageObject(endpoint)
end

function helicsMessageClone(message)
@invoke_and_check Lib.helicsMessageClone(message)
end

function helicsMessageFree(message)
Lib.helicsMessageFree(message)
end

function helicsGetBuildFlags()
unsafe_string(Lib.helicsGetBuildFlags())
end

function helicsGetCompilerVersion()
unsafe_string(Lib.helicsGetCompilerVersion())
end

function helicsGetFlagIndex(val::String)
Lib.helicsGetFlagIndex(val)
end

function helicsGetOptionValue(val::String)
Lib.helicsGetOptionValue(val)
end

function helicsQuerySetTarget(query::Query, target::String)
@invoke_and_check Lib.helicsQuerySetTarget(query, target)
end

function helicsQuerySetQueryString(query::Query, queryString::String)
@invoke_and_check Lib.helicsQuerySetQueryString(query, queryString)
end
21 changes: 19 additions & 2 deletions src/common.jl
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ const HELICS_DEPRECATED_NO_EXPORT = HELICS_NO_EXPORT
helics_data_type_boolean = 7
helics_data_type_time = 8
helics_data_type_raw = 25
helics_data_type_multi = 33
helics_data_type_any = 25262
end

Expand Down Expand Up @@ -170,6 +171,18 @@ end
helics_property_int_console_log_level = 274
end

@cenum helics_multi_input_mode::UInt32 begin
helics_multi_input_no_op = 0
helics_multi_input_vectorize_operation = 1
helics_multi_input_and_operation = 2
helics_multi_input_or_operation = 3
helics_multi_input_sum_operation = 4
helics_multi_input_diff_operation = 5
helics_multi_input_max_operation = 6
helics_multi_input_min_operation = 7
helics_multi_input_average_operation = 8
end

@cenum helics_handle_options::UInt32 begin
helics_handle_option_connection_required = 397
helics_handle_option_connection_optional = 402
Expand All @@ -178,9 +191,13 @@ end
helics_handle_option_buffer_data = 411
helics_handle_option_strict_type_checking = 414
helics_handle_option_ignore_unit_mismatch = 447
helics_handle_option_only_transmit_on_change = 6
helics_handle_option_only_update_on_change = 8
helics_handle_option_only_transmit_on_change = 452
helics_handle_option_only_update_on_change = 454
helics_handle_option_ignore_interrupts = 475
helics_handle_option_multi_input_handling_method = 507
helics_handle_option_input_priority_location = 510
helics_handle_option_clear_priority_list = 512
helics_handle_option_connections = 522
end

@cenum helics_filter_type::UInt32 begin
Expand Down
52 changes: 44 additions & 8 deletions src/lib.jl
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,10 @@ function helicsEndpointGetMessageObject(endpoint)
ccall((:helicsEndpointGetMessageObject, libhelicsSharedLib), helics_message_object, (helics_endpoint,), endpoint)
end

function helicsEndpointCreateMessageObject(endpoint, err)
ccall((:helicsEndpointCreateMessageObject, libhelicsSharedLib), helics_message_object, (helics_endpoint, Ptr{helics_error}), endpoint, err)
end

function helicsFederateGetMessage(fed)
ccall((:helicsFederateGetMessage, libhelicsSharedLib), helics_message, (helics_federate,), fed)
end
Expand Down Expand Up @@ -119,11 +123,11 @@ function helicsEndpointSetInfo(_end, info, err)
end

function helicsEndpointSetOption(_end, option, value, err)
ccall((:helicsEndpointSetOption, libhelicsSharedLib), Cvoid, (helics_endpoint, Cint, helics_bool, Ptr{helics_error}), _end, option, value, err)
ccall((:helicsEndpointSetOption, libhelicsSharedLib), Cvoid, (helics_endpoint, Cint, Cint, Ptr{helics_error}), _end, option, value, err)
end

function helicsEndpointGetOption(_end, option)
ccall((:helicsEndpointGetOption, libhelicsSharedLib), helics_bool, (helics_endpoint, Cint), _end, option)
ccall((:helicsEndpointGetOption, libhelicsSharedLib), Cint, (helics_endpoint, Cint), _end, option)
end

function helicsMessageGetSource(message)
Expand Down Expand Up @@ -229,6 +233,14 @@ end
function helicsMessageCopy(source_message, dest_message, err)
ccall((:helicsMessageCopy, libhelicsSharedLib), Cvoid, (helics_message_object, helics_message_object, Ptr{helics_error}), source_message, dest_message, err)
end

function helicsMessageClone(message, err)
ccall((:helicsMessageClone, libhelicsSharedLib), helics_message_object, (helics_message_object, Ptr{helics_error}), message, err)
end

function helicsMessageFree(message)
ccall((:helicsMessageFree, libhelicsSharedLib), Cvoid, (helics_message_object,), message)
end
# Julia wrapper for header: MessageFilters.h
# Automatically generated using Clang.jl

Expand Down Expand Up @@ -314,11 +326,11 @@ function helicsFilterSetInfo(filt, info, err)
end

function helicsFilterSetOption(filt, option, value, err)
ccall((:helicsFilterSetOption, libhelicsSharedLib), Cvoid, (helics_filter, Cint, helics_bool, Ptr{helics_error}), filt, option, value, err)
ccall((:helicsFilterSetOption, libhelicsSharedLib), Cvoid, (helics_filter, Cint, Cint, Ptr{helics_error}), filt, option, value, err)
end

function helicsFilterGetOption(filt, option)
ccall((:helicsFilterGetOption, libhelicsSharedLib), helics_bool, (helics_filter, Cint), filt, option)
ccall((:helicsFilterGetOption, libhelicsSharedLib), Cint, (helics_filter, Cint), filt, option)
end
# Julia wrapper for header: ValueFederate.h
# Automatically generated using Clang.jl
Expand Down Expand Up @@ -601,19 +613,19 @@ function helicsPublicationSetInfo(pub, info, err)
end

function helicsInputGetOption(inp, option)
ccall((:helicsInputGetOption, libhelicsSharedLib), helics_bool, (helics_input, Cint), inp, option)
ccall((:helicsInputGetOption, libhelicsSharedLib), Cint, (helics_input, Cint), inp, option)
end

function helicsInputSetOption(inp, option, value, err)
ccall((:helicsInputSetOption, libhelicsSharedLib), Cvoid, (helics_input, Cint, helics_bool, Ptr{helics_error}), inp, option, value, err)
ccall((:helicsInputSetOption, libhelicsSharedLib), Cvoid, (helics_input, Cint, Cint, Ptr{helics_error}), inp, option, value, err)
end

function helicsPublicationGetOption(pub, option)
ccall((:helicsPublicationGetOption, libhelicsSharedLib), helics_bool, (helics_publication, Cint), pub, option)
ccall((:helicsPublicationGetOption, libhelicsSharedLib), Cint, (helics_publication, Cint), pub, option)
end

function helicsPublicationSetOption(pub, option, val, err)
ccall((:helicsPublicationSetOption, libhelicsSharedLib), Cvoid, (helics_publication, Cint, helics_bool, Ptr{helics_error}), pub, option, val, err)
ccall((:helicsPublicationSetOption, libhelicsSharedLib), Cvoid, (helics_publication, Cint, Cint, Ptr{helics_error}), pub, option, val, err)
end

function helicsPublicationSetMinimumChange(pub, tolerance, err)
Expand Down Expand Up @@ -654,6 +666,14 @@ function helicsGetVersion()
ccall((:helicsGetVersion, libhelicsSharedLib), Cstring, ())
end

function helicsGetBuildFlags()
ccall((:helicsGetBuildFlags, libhelicsSharedLib), Cstring, ())
end

function helicsGetCompilerVersion()
ccall((:helicsGetCompilerVersion, libhelicsSharedLib), Cstring, ())
end

function helicsErrorInitialize()
ccall((:helicsErrorInitialize, libhelicsSharedLib), helics_error, ())
end
Expand Down Expand Up @@ -890,10 +910,18 @@ function helicsGetPropertyIndex(val)
ccall((:helicsGetPropertyIndex, libhelicsSharedLib), Cint, (Cstring,), val)
end

function helicsGetFlagIndex(val)
ccall((:helicsGetFlagIndex, libhelicsSharedLib), Cint, (Cstring,), val)
end

function helicsGetOptionIndex(val)
ccall((:helicsGetOptionIndex, libhelicsSharedLib), Cint, (Cstring,), val)
end

function helicsGetOptionValue(val)
ccall((:helicsGetOptionValue, libhelicsSharedLib), Cint, (Cstring,), val)
end

function helicsFederateInfoSetFlagOption(fi, flag, value, err)
ccall((:helicsFederateInfoSetFlagOption, libhelicsSharedLib), Cvoid, (helics_federate_info, Cint, helics_bool, Ptr{helics_error}), fi, flag, value, err)
end
Expand Down Expand Up @@ -1134,6 +1162,14 @@ function helicsQueryIsCompleted(query)
ccall((:helicsQueryIsCompleted, libhelicsSharedLib), helics_bool, (helics_query,), query)
end

function helicsQuerySetTarget(query, target, err)
ccall((:helicsQuerySetTarget, libhelicsSharedLib), Cvoid, (helics_query, Cstring, Ptr{helics_error}), query, target, err)
end

function helicsQuerySetQueryString(query, queryString, err)
ccall((:helicsQuerySetQueryString, libhelicsSharedLib), Cvoid, (helics_query, Cstring, Ptr{helics_error}), query, queryString, err)
end

function helicsQueryFree(query)
ccall((:helicsQueryFree, libhelicsSharedLib), Cvoid, (helics_query,), query)
end
Expand Down

0 comments on commit 378be65

Please sign in to comment.