diff options
author | Thomas White <taw@physics.org> | 2024-02-02 16:39:30 +0100 |
---|---|---|
committer | Thomas White <taw@physics.org> | 2024-02-06 16:59:35 +0100 |
commit | 5398ff3bc10439b8e4642256b7d8b21e17ae7ce2 (patch) | |
tree | a47e46ff9164360f4a5088296ee9aeaf150c80e2 /julia | |
parent | e40d5e6cd2d0b98d700bab42c614f27cfe725d97 (diff) |
Julia: Constructor for RefList{MergedReflection}
Diffstat (limited to 'julia')
-rw-r--r-- | julia/CrystFEL/src/reflists.jl | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/julia/CrystFEL/src/reflists.jl b/julia/CrystFEL/src/reflists.jl index 1847b4cf..c5edb794 100644 --- a/julia/CrystFEL/src/reflists.jl +++ b/julia/CrystFEL/src/reflists.jl @@ -36,6 +36,17 @@ mutable struct UnmergedReflection <: Reflection end +function RefList{MergedReflection}(sym::SymOpList) + out = @ccall libcrystfel.reflist_new()::Ptr{InternalRefList} + if out == C_NULL + throw(ErrorException("Failed to create RefList")) + end + finalizer(RefList{MergedReflection}(out, sym)) do x + @ccall libcrystfel.reflist_free(x.internalptr::Ptr{InternalRefList})::Cvoid + end +end + + function Base.iterate(reflist::RefList{T}) where T rli = Ref{Ptr{InternalRefListIterator}}(C_NULL) |