Skip to content

Commit

Permalink
Merge pull request #24 from GMLC-TDC/helics3.4Update
Browse files Browse the repository at this point in the history
Helics3.4 update
  • Loading branch information
afisher1 authored Feb 9, 2023
2 parents 1ef9711 + 91af5c6 commit 1805e37
Show file tree
Hide file tree
Showing 5 changed files with 48 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "HELICS"
uuid = "81524022-8764-5038-b61c-08cb1f58760f"
authors = ["Dheepak Krishnamurthy <[email protected]>"]
version = "3.3.2"
version = "3.4.0"

[deps]
CEnum = "fa961155-64e5-5f13-b03f-caf6b980ea82"
Expand All @@ -13,7 +13,7 @@ Libdl = "8f399da3-3557-5675-b5ff-fb832c97cbdb"
CEnum = "^0.2"
DocStringExtensions = "^0.8"
julia = "^1.3"
HELICS_jll = "^3.3.2"
HELICS_jll = "^3.4.0"

[extras]
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
Expand Down
32 changes: 32 additions & 0 deletions src/api.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2047,6 +2047,23 @@ function helicsFederateGetSubscription(fed::Federate, key::String)::Subscription
return @invoke_and_check Lib.helicsFederateGetSubscription(fed, key)
end

"""
Get an [`Input`](@ref) object from an [`Input`](@ref) target
# Arguments
- `fed`: the value federate object to use to get the [`Publication`](@ref)
- `target`: the name of the [`Publication`](@ref) that an [`Input`](@ref) is targeting
# Returns
- a [`Input`](@ref) object, the object will not be valid and err will contain an error code if no input with the specified
key exists
"""
function helicsFederateGetInputByTarget(fed::Federate, target::String)::Input
return @invoke_and_check Lib.helicsFederateGetInputByTarget(fed, key)
end

"""
Publish raw bytes from string
Expand Down Expand Up @@ -2669,6 +2686,21 @@ function helicsSubscriptionGetTarget(ipt::Input)::String
return unsafe_string(Lib.helicsSubscriptionGetTarget(ipt))
end

"""
Get the target of an [`Input`](@ref)
# Arguments
- `ipt`: the [`Input`](@ref) to query
# Returns
- A string of the input target
"""
function helicsInputGetTarget(ipt::Input)::String
return unsafe_string(Lib.helicsInputGetTarget(ipt))
end

"""
Get the name of a [`Publication`](@ref)
Expand Down
2 changes: 2 additions & 0 deletions src/common.jl
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,8 @@ end
HELICS_HANDLE_OPTION_MULTIPLE_CONNECTIONS_ALLOWED = 409
HELICS_HANDLE_OPTION_BUFFER_DATA = 411
HELICS_HANDLE_OPTION_STRICT_TYPE_CHECKING = 414
HELICS_HANDLE_OPTION_RECEIVE_ONLY = 422
HELICS_HANDLE_OPTION_SOURCE_ONLY = 423
HELICS_HANDLE_OPTION_IGNORE_UNIT_MISMATCH = 447
HELICS_HANDLE_OPTION_ONLY_TRANSMIT_ON_CHANGE = 452
HELICS_HANDLE_OPTION_ONLY_UPDATE_ON_CHANGE = 454
Expand Down
4 changes: 4 additions & 0 deletions src/enums.jl
Original file line number Diff line number Diff line change
Expand Up @@ -375,6 +375,10 @@ HELICS_HANDLE_OPTION_MULTIPLE_CONNECTIONS_ALLOWED
HELICS_HANDLE_OPTION_BUFFER_DATA
"""specify that the types should be checked strictly for pub/sub and filters"""
HELICS_HANDLE_OPTION_STRICT_TYPE_CHECKING
"""specify that the handle is receive only"""
HELICS_HANDLE_OPTION_RECEIVE_ONLY
"""specify that the handle is source only"""
HELICS_HANDLE_OPTION_SOURCE_ONLY
"""specify that the mismatching units should be ignored"""
HELICS_HANDLE_OPTION_IGNORE_UNIT_MISMATCH
"""specify that an interface will only transmit on change (only applicable to publications)"""
Expand Down
8 changes: 8 additions & 0 deletions src/lib.jl
Original file line number Diff line number Diff line change
Expand Up @@ -878,6 +878,10 @@ function helicsFederateGetSubscription(fed, key, err)
ccall((:helicsFederateGetSubscription, libhelics), HelicsInput, (HelicsFederate, Cstring, Ptr{HelicsError}), fed, key, err)
end

function helicsFederateGetInputByTarget(fed, target, err)
ccall((:helicsFederateGetInputByTarget, libhelics), HelicsInput, (HelicsFederate, Cstring, Ptr{HelicsError}), fed, target, err)
end

function helicsFederateClearUpdates(fed)
ccall((:helicsFederateClearUpdates, libhelics), Cvoid, (HelicsFederate,), fed)
end
Expand Down Expand Up @@ -1078,6 +1082,10 @@ function helicsSubscriptionGetTarget(ipt)
ccall((:helicsSubscriptionGetTarget, libhelics), Cstring, (HelicsInput,), ipt)
end

function helicsInputGetTarget(ipt)
ccall((:helicsInputGetTarget, libhelics), Cstring, (HelicsInput,), ipt)
end

function helicsPublicationGetName(pub)
ccall((:helicsPublicationGetName, libhelics), Cstring, (HelicsPublication,), pub)
end
Expand Down

2 comments on commit 1805e37

@nightlark
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/77678

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v3.4.0 -m "<description of version>" 1805e3753a25878aa02153f3c55fcce9be059d22
git push origin v3.4.0

Please sign in to comment.