Back to index

texmacs  1.0.7.15
object.hpp
Go to the documentation of this file.
00001 
00002 /******************************************************************************
00003  * MODULE     : object.hpp
00004  * DESCRIPTION: Implementation of scheme objects
00005  * COPYRIGHT  : (C) 1999-2011 Joris van der Hoeven and Massimiliano Gubinelli
00006  *******************************************************************************
00007  * This software falls under the GNU general public license version 3 or later.
00008  * It comes WITHOUT ANY WARRANTY WHATSOEVER. For details, see the file LICENSE
00009  * in the root directory or <http://www.gnu.org/licenses/gpl-3.0.html>.
00010  ******************************************************************************/
00011 
00012 #ifndef OBJECT_H
00013 #define OBJECT_H
00014 
00015 
00016 #include "scheme.hpp" // interface to texmacs
00017 //#include "../Tiny/tinytmscm_tm.hpp" // interface to TinyScheme
00018 #include "../Guile/guile_tm.hpp" // interface to guile
00019 
00020 
00021 
00022 class tmscm_object_rep: public object_rep {
00023        tmscm  handle;
00024 
00025        tmscm_object_rep (tmscm  obj);
00026        ~tmscm_object_rep ();
00027 
00028        friend class object;
00029   friend tmscm  object_to_tmscm  (object o);
00030   friend object tmscm_to_object (tmscm  obj);
00031   template<typename C, typename A1> friend C* tm_new (const A1& a1); 
00032 };
00033 
00034 inline tmscm  object_to_tmscm  (object o) {
00035   tmscm_object_rep *oo = static_cast<tmscm_object_rep*>(o.operator->());
00036   return tmscm_caar (oo->handle);
00037   //return tmscm_caar ((tmscm )o->lookup ()); 
00038 }
00039 inline object tmscm_to_object (tmscm  obj) { return tm_new<tmscm_object_rep> (obj); }
00040 
00041 
00042 #endif // defined OBJECT_H