/* ----------------------------------------------------------------------------
 * This file was automatically generated by SWIG (http://www.swig.org).
 * Version 1.3.35
 *
 * Do not make changes to this file unless you know what you are doing--modify
 * the SWIG interface file instead.
 * ----------------------------------------------------------------------------- */

namespace FreeSWITCH.Native {

using System;
using System.Runtime.InteropServices;

public class switch_rtp_crypto_key : IDisposable {
  private HandleRef swigCPtr;
  protected bool swigCMemOwn;

  internal switch_rtp_crypto_key(IntPtr cPtr, bool cMemoryOwn) {
    swigCMemOwn = cMemoryOwn;
    swigCPtr = new HandleRef(this, cPtr);
  }

  internal static HandleRef getCPtr(switch_rtp_crypto_key obj) {
    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
  }

  ~switch_rtp_crypto_key() {
    Dispose();
  }

  public virtual void Dispose() {
    lock(this) {
      if(swigCPtr.Handle != IntPtr.Zero && swigCMemOwn) {
        swigCMemOwn = false;
        freeswitchPINVOKE.delete_switch_rtp_crypto_key(swigCPtr);
      }
      swigCPtr = new HandleRef(null, IntPtr.Zero);
      GC.SuppressFinalize(this);
    }
  }

  public uint index {
    set {
      freeswitchPINVOKE.switch_rtp_crypto_key_index_set(swigCPtr, value);
    } 
    get {
      uint ret = freeswitchPINVOKE.switch_rtp_crypto_key_index_get(swigCPtr);
      return ret;
    } 
  }

  public switch_rtp_crypto_key_type_t type {
    set {
      freeswitchPINVOKE.switch_rtp_crypto_key_type_set(swigCPtr, (int)value);
    } 
    get {
      switch_rtp_crypto_key_type_t ret = (switch_rtp_crypto_key_type_t)freeswitchPINVOKE.switch_rtp_crypto_key_type_get(swigCPtr);
      return ret;
    } 
  }

  public SWIGTYPE_p_unsigned_char key {
    set {
      freeswitchPINVOKE.switch_rtp_crypto_key_key_set(swigCPtr, SWIGTYPE_p_unsigned_char.getCPtr(value));
    } 
    get {
      IntPtr cPtr = freeswitchPINVOKE.switch_rtp_crypto_key_key_get(swigCPtr);
      SWIGTYPE_p_unsigned_char ret = (cPtr == IntPtr.Zero) ? null : new SWIGTYPE_p_unsigned_char(cPtr, false);
      return ret;
    } 
  }

  public SWIGTYPE_p_switch_size_t keylen {
    set {
      freeswitchPINVOKE.switch_rtp_crypto_key_keylen_set(swigCPtr, SWIGTYPE_p_switch_size_t.getCPtr(value));
      if (freeswitchPINVOKE.SWIGPendingException.Pending) throw freeswitchPINVOKE.SWIGPendingException.Retrieve();
    } 
    get {
      SWIGTYPE_p_switch_size_t ret = new SWIGTYPE_p_switch_size_t(freeswitchPINVOKE.switch_rtp_crypto_key_keylen_get(swigCPtr), true);
      if (freeswitchPINVOKE.SWIGPendingException.Pending) throw freeswitchPINVOKE.SWIGPendingException.Retrieve();
      return ret;
    } 
  }

  public switch_rtp_crypto_key next {
    set {
      freeswitchPINVOKE.switch_rtp_crypto_key_next_set(swigCPtr, switch_rtp_crypto_key.getCPtr(value));
    } 
    get {
      IntPtr cPtr = freeswitchPINVOKE.switch_rtp_crypto_key_next_get(swigCPtr);
      switch_rtp_crypto_key ret = (cPtr == IntPtr.Zero) ? null : new switch_rtp_crypto_key(cPtr, false);
      return ret;
    } 
  }

  public switch_rtp_crypto_key() : this(freeswitchPINVOKE.new_switch_rtp_crypto_key(), true) {
  }

}

}
