//
//  LKFAufenthaltAbtScoringData.swift
//  lkfc
//
//  Created by Alexander Holzer on 20.08.18.
//  Copyright © 2018 Alexander Holzer. All rights reserved.
//

import Foundation
@_implementationOnly import LibLKF   

public class LKFAufenthaltAbtScoringData {
    let _abt : LKFAufenthaltAbt
    let _sum: Double
    let _tp: Double
    let _lp: Double
    let _pos: String
    
    init (abt: LKFAufenthaltAbt) {
        _abt = abt
        let cline = UnsafeMutablePointer<CChar>.allocate(capacity:8)
        let tp = UnsafeMutablePointer<Double>.allocate(capacity: 1)
        let lp = UnsafeMutablePointer<Double>.allocate(capacity: 1)
        _sum = LibLKF.lkf_auf_get_abtscor(abt.aufenthalt.ptr, abt.index, cline, tp, lp)
        _tp = tp.pointee
        _lp = lp.pointee
        _pos = String(cString: cline)
        cline.deallocate()
        tp.deallocate()
        lp.deallocate()
    }
    
    var tp : Double {
        return _tp
    }
    
    var lp : Double {
        return _lp
    }
    
    var pos : String {
        return _pos
    }
    
    var sum : Double {
        return _sum
    }
}
