diff options
author | Thomas White <taw@physics.org> | 2024-02-07 11:23:54 +0100 |
---|---|---|
committer | Thomas White <taw@physics.org> | 2024-02-07 11:23:54 +0100 |
commit | bf126681d49c198dcec0e70e470a22d26dc31d55 (patch) | |
tree | 8d3252a9e7388f006df1ef861d0efeffd28a1f96 /julia/CrystFEL | |
parent | 2710d085345f766afd885a41050b8d98ccab74d3 (diff) |
Julia: Add push!(::RefList, hkl)
Diffstat (limited to 'julia/CrystFEL')
-rw-r--r-- | julia/CrystFEL/src/reflists.jl | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/julia/CrystFEL/src/reflists.jl b/julia/CrystFEL/src/reflists.jl index 6629b186..89967d6f 100644 --- a/julia/CrystFEL/src/reflists.jl +++ b/julia/CrystFEL/src/reflists.jl @@ -108,6 +108,21 @@ function Base.getindex(reflist::RefList{T}, indices) where T end +function Base.push!(reflist::RefList{T}, indices) where T + + refl = @ccall libcrystfel.add_refl(reflist.internalptr::Ptr{InternalRefList}, + indices[1]::Cint, + indices[2]::Cint, + indices[3]::Cint)::Ptr{InternalReflection} + + if refl == C_NULL + return nothing + else + return T(refl) + end +end + + function loadreflist(filename::AbstractString) psym = Ref{Cstring}() |