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

namespace RakNet {

using System;
using System.Runtime.InteropServices;

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

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

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

  ~Cell() {
    Dispose();
  }

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

 	public void Get(out string output)
 	{
 		string temp=new String('c', (int) this.i);
 		output=GetHelper(temp);
 	}
 
  public Cell() : this(RakNetPINVOKE.new_Cell__SWIG_0(), true) {
  }

  public void Clear() {
    RakNetPINVOKE.Cell_Clear(swigCPtr);
  }

  public void Set(int input) {
    RakNetPINVOKE.Cell_Set__SWIG_0(swigCPtr, input);
  }

  public void Set(uint input) {
    RakNetPINVOKE.Cell_Set__SWIG_1(swigCPtr, input);
  }

  public void Set(double input) {
    RakNetPINVOKE.Cell_Set__SWIG_2(swigCPtr, input);
  }

  public void Set(string input) {
    RakNetPINVOKE.Cell_Set__SWIG_3(swigCPtr, input);
  }

  public void Get(out int output) {
    RakNetPINVOKE.Cell_Get__SWIG_0(swigCPtr, out output);
  }

  public void Get(out double output) {
    RakNetPINVOKE.Cell_Get__SWIG_1(swigCPtr, out output);
  }

  public RakString ToString(Table.ColumnType columnType) {
    RakString ret = new RakString(RakNetPINVOKE.Cell_ToString(swigCPtr, (int)columnType), true);
    return ret;
  }

  public Cell CopyData(Cell input) {
    Cell ret = new Cell(RakNetPINVOKE.Cell_CopyData(swigCPtr, Cell.getCPtr(input)), false);
    if (RakNetPINVOKE.SWIGPendingException.Pending) throw RakNetPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public Cell(Cell input) : this(RakNetPINVOKE.new_Cell__SWIG_1(Cell.getCPtr(input)), true) {
    if (RakNetPINVOKE.SWIGPendingException.Pending) throw RakNetPINVOKE.SWIGPendingException.Retrieve();
  }

  public Table.ColumnType EstimateColumnType() {
    Table.ColumnType ret = (Table.ColumnType)RakNetPINVOKE.Cell_EstimateColumnType(swigCPtr);
    return ret;
  }

  public bool isEmpty {
    set {
      RakNetPINVOKE.Cell_isEmpty_set(swigCPtr, value);
    } 
    get {
      bool ret = RakNetPINVOKE.Cell_isEmpty_get(swigCPtr);
      return ret;
    } 
  }

  public double i {
    set {
      RakNetPINVOKE.Cell_i_set(swigCPtr, value);
    } 
    get {
      double ret = RakNetPINVOKE.Cell_i_get(swigCPtr);
      return ret;
    } 
  }

  public void Set(byte[] inByteArray, int inputLength) {
    RakNetPINVOKE.Cell_Set__SWIG_4(swigCPtr, inByteArray, inputLength);
  }

  public void Get(byte[] inOutByteArray, out int outputLength) {
    RakNetPINVOKE.Cell_Get__SWIG_2(swigCPtr, inOutByteArray, out outputLength);
  }

  private string GetHelper(string output) {
    string ret = RakNetPINVOKE.Cell_GetHelper(swigCPtr, output);
    return ret;
  }

}

}
