Skip to content

AbstractState struct #23

Description

@longemen3000

when using PropsSI, a new abstract state is created with each call. one option would be to do something like:

mutable struct AbstractState #mutable, to register finalizers
  handle::Clong
  function AbstractState(x::Integer)
    res = new(Clong(x))
    finalizer(AbstractState_free,res) #register finalizer, to free up memory when `AbstractState` goes out of scope
    return res
  end
end

function AbstractState_free(x::AbstractState)
  return AbstractState_free(x.handle)
end

function PropsSI(val1,prop1,val2,prop2,fluid::AbstractState)
  # do low level call, fluid is mutated
end

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions