Skip to content

Commit 1805e37

Browse files
authored
Merge pull request #24 from GMLC-TDC/helics3.4Update
Helics3.4 update
2 parents 1ef9711 + 91af5c6 commit 1805e37

File tree

5 files changed

+48
-2
lines changed

5 files changed

+48
-2
lines changed

Project.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "HELICS"
22
uuid = "81524022-8764-5038-b61c-08cb1f58760f"
33
authors = ["Dheepak Krishnamurthy <[email protected]>"]
4-
version = "3.3.2"
4+
version = "3.4.0"
55

66
[deps]
77
CEnum = "fa961155-64e5-5f13-b03f-caf6b980ea82"
@@ -13,7 +13,7 @@ Libdl = "8f399da3-3557-5675-b5ff-fb832c97cbdb"
1313
CEnum = "^0.2"
1414
DocStringExtensions = "^0.8"
1515
julia = "^1.3"
16-
HELICS_jll = "^3.3.2"
16+
HELICS_jll = "^3.4.0"
1717

1818
[extras]
1919
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

src/api.jl

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2047,6 +2047,23 @@ function helicsFederateGetSubscription(fed::Federate, key::String)::Subscription
20472047
return @invoke_and_check Lib.helicsFederateGetSubscription(fed, key)
20482048
end
20492049

2050+
"""
2051+
Get an [`Input`](@ref) object from an [`Input`](@ref) target
2052+
2053+
# Arguments
2054+
2055+
- `fed`: the value federate object to use to get the [`Publication`](@ref)
2056+
- `target`: the name of the [`Publication`](@ref) that an [`Input`](@ref) is targeting
2057+
2058+
# Returns
2059+
2060+
- a [`Input`](@ref) object, the object will not be valid and err will contain an error code if no input with the specified
2061+
key exists
2062+
"""
2063+
function helicsFederateGetInputByTarget(fed::Federate, target::String)::Input
2064+
return @invoke_and_check Lib.helicsFederateGetInputByTarget(fed, key)
2065+
end
2066+
20502067
"""
20512068
Publish raw bytes from string
20522069
@@ -2669,6 +2686,21 @@ function helicsSubscriptionGetTarget(ipt::Input)::String
26692686
return unsafe_string(Lib.helicsSubscriptionGetTarget(ipt))
26702687
end
26712688

2689+
"""
2690+
Get the target of an [`Input`](@ref)
2691+
2692+
# Arguments
2693+
2694+
- `ipt`: the [`Input`](@ref) to query
2695+
2696+
# Returns
2697+
2698+
- A string of the input target
2699+
"""
2700+
function helicsInputGetTarget(ipt::Input)::String
2701+
return unsafe_string(Lib.helicsInputGetTarget(ipt))
2702+
end
2703+
26722704
"""
26732705
Get the name of a [`Publication`](@ref)
26742706

src/common.jl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,8 @@ end
159159
HELICS_HANDLE_OPTION_MULTIPLE_CONNECTIONS_ALLOWED = 409
160160
HELICS_HANDLE_OPTION_BUFFER_DATA = 411
161161
HELICS_HANDLE_OPTION_STRICT_TYPE_CHECKING = 414
162+
HELICS_HANDLE_OPTION_RECEIVE_ONLY = 422
163+
HELICS_HANDLE_OPTION_SOURCE_ONLY = 423
162164
HELICS_HANDLE_OPTION_IGNORE_UNIT_MISMATCH = 447
163165
HELICS_HANDLE_OPTION_ONLY_TRANSMIT_ON_CHANGE = 452
164166
HELICS_HANDLE_OPTION_ONLY_UPDATE_ON_CHANGE = 454

src/enums.jl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -375,6 +375,10 @@ HELICS_HANDLE_OPTION_MULTIPLE_CONNECTIONS_ALLOWED
375375
HELICS_HANDLE_OPTION_BUFFER_DATA
376376
"""specify that the types should be checked strictly for pub/sub and filters"""
377377
HELICS_HANDLE_OPTION_STRICT_TYPE_CHECKING
378+
"""specify that the handle is receive only"""
379+
HELICS_HANDLE_OPTION_RECEIVE_ONLY
380+
"""specify that the handle is source only"""
381+
HELICS_HANDLE_OPTION_SOURCE_ONLY
378382
"""specify that the mismatching units should be ignored"""
379383
HELICS_HANDLE_OPTION_IGNORE_UNIT_MISMATCH
380384
"""specify that an interface will only transmit on change (only applicable to publications)"""

src/lib.jl

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -878,6 +878,10 @@ function helicsFederateGetSubscription(fed, key, err)
878878
ccall((:helicsFederateGetSubscription, libhelics), HelicsInput, (HelicsFederate, Cstring, Ptr{HelicsError}), fed, key, err)
879879
end
880880

881+
function helicsFederateGetInputByTarget(fed, target, err)
882+
ccall((:helicsFederateGetInputByTarget, libhelics), HelicsInput, (HelicsFederate, Cstring, Ptr{HelicsError}), fed, target, err)
883+
end
884+
881885
function helicsFederateClearUpdates(fed)
882886
ccall((:helicsFederateClearUpdates, libhelics), Cvoid, (HelicsFederate,), fed)
883887
end
@@ -1078,6 +1082,10 @@ function helicsSubscriptionGetTarget(ipt)
10781082
ccall((:helicsSubscriptionGetTarget, libhelics), Cstring, (HelicsInput,), ipt)
10791083
end
10801084

1085+
function helicsInputGetTarget(ipt)
1086+
ccall((:helicsInputGetTarget, libhelics), Cstring, (HelicsInput,), ipt)
1087+
end
1088+
10811089
function helicsPublicationGetName(pub)
10821090
ccall((:helicsPublicationGetName, libhelics), Cstring, (HelicsPublication,), pub)
10831091
end

0 commit comments

Comments
 (0)