;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;
;;; LUSH Lisp Universal Shell
;;;   Copyright (C) 2002 Leon Bottou, Yann Le Cun, AT&T Corp, NECI.
;;; Includes parts of TL3:
;;;   Copyright (C) 1987-1999 Leon Bottou and Neuristique.
;;; Includes selected parts of SN3.2:
;;;   Copyright (C) 1991-2001 AT&T Corp.
;;;
;;; Includes information derived from the GSL (Gnu Scientific Library)
;;;   header files which are copyrighted and distributed under the GPL
;;;   by their respective authors.
;;;
;;; This program is free software; you can redistribute it and/or modify
;;; it under the terms of the GNU General Public License as published by
;;; the Free Software Foundation; either version 2 of the License, or
;;; (at your option) any later version.
;;;
;;; This program is distributed in the hope that it will be useful,
;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
;;; GNU General Public License for more details.
;;;
;;; You should have received a copy of the GNU General Public License
;;; along with this program; if not, write to the Free Software
;;; Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, USA
;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

(libload "torch/torch-config")
(libload "torch/level0")


#? *** torchlist

;; dummy function that adds torch header files in C file
(eval `(de dummy_torchlist () ,torch-cpheader-cmd ()))

#? * torch_memoryxfilelist
;;.TYPE CLASS
#? (==> <torch_memoryxfilelist> get_nodes)
#? (==> <torch_memoryxfilelist> set_nodes <s>)
#? (==> <torch_memoryxfilelist> get_n_nodes)
#? (==> <torch_memoryxfilelist> set_n_nodes <s>)
#? (new torch_memoryxfilelist <flag>>
#? (==> <torch_memoryxfilelist> add <s>)
#? (==> <torch_memoryxfilelist> addnode <node>)
#? (==> <torch_memoryxfilelist> -destructor)

#? * torch_preprocessinglist
;;.TYPE CLASS
#? (==> <torch_preprocessinglist> get_nodes)
#? (==> <torch_preprocessinglist> set_nodes <s>)
#? (==> <torch_preprocessinglist> get_n_nodes)
#? (==> <torch_preprocessinglist> set_n_nodes <s>)
#? (new torch_preprocessinglist <flag>>
#? (==> <torch_preprocessinglist> add <s>)
#? (==> <torch_preprocessinglist> addnode <node>)
#? (==> <torch_preprocessinglist> -destructor)

#? * torch_sequencelist
;;.TYPE CLASS
#? (==> <torch_sequencelist> get_nodes)
#? (==> <torch_sequencelist> set_nodes <s>)
#? (==> <torch_sequencelist> get_n_nodes)
#? (==> <torch_sequencelist> set_n_nodes <s>)
#? (new torch_sequencelist <flag>>
#? (==> <torch_sequencelist> add <s>)
#? (==> <torch_sequencelist> addnode <node>)
#? (==> <torch_sequencelist> -destructor)

#? * torch_measurerlist
;;.TYPE CLASS
#? (==> <torch_measurerlist> get_nodes)
#? (==> <torch_measurerlist> set_nodes <s>)
#? (==> <torch_measurerlist> get_n_nodes)
#? (==> <torch_measurerlist> set_n_nodes <s>)
#? (new torch_measurerlist <flag>>
#? (==> <torch_measurerlist> add <s>)
#? (==> <torch_measurerlist> addnode <node>)
#? (==> <torch_measurerlist> -destructor)

#? * (dummy_torchlist)

;; ********************************************************



(defclass torch_MemoryXFileList torch_Object)

(defmethod torch_MemoryXFileList get_nodes ()
  (gptr #{ ((Torch::MemoryXFileList *)$p)->nodes #} ))

(defmethod torch_MemoryXFileList set_nodes ( s )
  ((-gptr- "Torch::MemoryXFileNode **") s)
  #{ ((Torch::MemoryXFileList *)$p)->nodes = $s;  #} 
  ())

(defmethod torch_MemoryXFileList get_n_nodes ()
  (int #{  ((Torch::MemoryXFileList *)$p)->n_nodes #} ))

(defmethod torch_MemoryXFileList set_n_nodes ( s )
  ((-int-) s)
  #{  ((Torch::MemoryXFileList *)$p)->n_nodes = $s;  #} 
  ())

(defmethod torch_MemoryXFileList torch_MemoryXFileList ( flag )
  ((-bool-) flag)
  #{  if($flag == 0) {
             $shell_flag = 0;
             $p = new Torch::MemoryXFileList();
      }
  #}
  ())

(defmethod torch_MemoryXFileList add ( s )
  ((-gptr- "Torch::MemoryXFileList *") s)
  #{  ((Torch::MemoryXFileList *)$p)->add($s); #}
  ())

(defmethod torch_MemoryXFileList addNode ( node )
  ((-gptr- "Torch::MemoryXFileNode *") node)
  #{  ((Torch::MemoryXFileList *)$p)->addNode($node); #}
  ())

(defmethod torch_MemoryXFileList -destructor ()
  #{ if( $shell_flag == 0) delete ((Torch::MemoryXFileList *)$p); #}
  ())


(defclass torch_PreProcessingList torch_Object)

(defmethod torch_PreProcessingList get_nodes ()
  (gptr #{ ((Torch::PreProcessingList *)$p)->nodes #} ))

(defmethod torch_PreProcessingList set_nodes ( s )
  ((-gptr- "Torch::PreProcessing **") s)
  #{ ((Torch::PreProcessingList *)$p)->nodes = $s;  #} 
  ())

(defmethod torch_PreProcessingList get_n_nodes ()
  (int #{  ((Torch::PreProcessingList *)$p)->n_nodes #} ))

(defmethod torch_PreProcessingList set_n_nodes ( s )
  ((-int-) s)
  #{  ((Torch::PreProcessingList *)$p)->n_nodes = $s;  #} 
  ())

(defmethod torch_PreProcessingList torch_PreProcessingList ( flag )
  ((-bool-) flag)
  #{  if($flag == 0) {
             $shell_flag = 0;
             $p = new Torch::PreProcessingList();
      }
  #}
  ())

(defmethod torch_PreProcessingList add ( s )
  ((-gptr- "Torch::PreProcessingList *") s)
  #{  ((Torch::PreProcessingList *)$p)->add($s); #}
  ())

(defmethod torch_PreProcessingList addNode ( node )
  ((-gptr- "Torch::PreProcessing *") node)
  #{  ((Torch::PreProcessingList *)$p)->addNode($node); #}
  ())

(defmethod torch_PreProcessingList -destructor ()
  #{ if( $shell_flag == 0) delete ((Torch::PreProcessingList *)$p); #}
  ())



(defclass torch_SequenceList torch_Object)

(defmethod torch_SequenceList get_nodes ()
  (gptr #{ ((Torch::SequenceList *)$p)->nodes #} ))

(defmethod torch_SequenceList set_nodes ( s )
  ((-gptr- "Torch::Sequence **") s)
  #{ ((Torch::SequenceList *)$p)->nodes = $s;  #} 
  ())

(defmethod torch_SequenceList get_n_nodes ()
  (int #{  ((Torch::SequenceList *)$p)->n_nodes #} ))

(defmethod torch_SequenceList set_n_nodes ( s )
  ((-int-) s)
  #{  ((Torch::SequenceList *)$p)->n_nodes = $s;  #} 
  ())

(defmethod torch_SequenceList torch_SequenceList ( flag )
  ((-bool-) flag)
  #{  if($flag == 0) {
             $shell_flag = 0;
             $p = new Torch::SequenceList();
      }
  #}
  ())

(defmethod torch_SequenceList add ( s )
  ((-gptr- "Torch::SequenceList *") s)
  #{  ((Torch::SequenceList *)$p)->add($s); #}
  ())

(defmethod torch_SequenceList addNode ( node )
  ((-gptr- "Torch::Sequence *") node)
  #{  ((Torch::SequenceList *)$p)->addNode($node); #}
  ())

(defmethod torch_SequenceList -destructor ()
  #{ if( $shell_flag == 0) delete ((Torch::SequenceList *)$p); #}
  ())



(defclass torch_MeasurerList torch_Object)

(defmethod torch_MeasurerList get_nodes ()
  (gptr #{ ((Torch::MeasurerList *)$p)->nodes #} ))

(defmethod torch_MeasurerList set_nodes ( s )
  ((-gptr- "Torch::Measurer **") s)
  #{ ((Torch::MeasurerList *)$p)->nodes = $s;  #} 
  ())

(defmethod torch_MeasurerList get_n_nodes ()
  (int #{  ((Torch::MeasurerList *)$p)->n_nodes #} ))

(defmethod torch_MeasurerList set_n_nodes ( s )
  ((-int-) s)
  #{  ((Torch::MeasurerList *)$p)->n_nodes = $s;  #} 
  ())

(defmethod torch_MeasurerList torch_MeasurerList ( flag )
  ((-bool-) flag)
  #{  if($flag == 0) {
             $shell_flag = 0;
             $p = new Torch::MeasurerList();
      }
  #}
  ())

(defmethod torch_MeasurerList add ( s )
  ((-gptr- "Torch::MeasurerList *") s)
  #{  ((Torch::MeasurerList *)$p)->add($s); #}
  ())

(defmethod torch_MeasurerList addNode ( node )
  ((-gptr- "Torch::Measurer *") node)
  #{  ((Torch::MeasurerList *)$p)->addNode($node); #}
  ())

(defmethod torch_MeasurerList -destructor ()
  #{ if( $shell_flag == 0) delete ((Torch::MeasurerList *)$p); #}
  ())

;; ********************************************************

(dhc-make-with-c++ () (list torch-libtorch) 
  dummy_torchlist
  (torch_memoryxfilelist  -destructor  addnode  add  torch_memoryxfilelist  set_n_nodes  get_n_nodes  set_nodes  get_nodes)
  (torch_preprocessinglist  -destructor  addnode  add  torch_preprocessinglist  set_n_nodes  get_n_nodes  set_nodes  get_nodes)
  (torch_sequencelist  -destructor  addnode  add  torch_sequencelist  set_n_nodes  get_n_nodes  set_nodes  get_nodes)
  (torch_measurerlist  -destructor  addnode  add  torch_measurerlist  set_n_nodes  get_n_nodes  set_nodes  get_nodes)
)
