basix_doc 0.1
/Users/mourrain/Devel/mmx/basix/src/tuple.cpp
Go to the documentation of this file.
00001 
00002 /******************************************************************************
00003 * MODULE     : tuple.cpp
00004 * DESCRIPTION: Syntactic tuple type constructor
00005 * COPYRIGHT  : (C) 2006  Joris van der Hoeven
00006 *******************************************************************************
00007 * This software falls under the GNU general public license and comes WITHOUT
00008 * ANY WARRANTY WHATSOEVER. See the file $TEXMACS_PATH/LICENSE for more details.
00009 * If you don't have this file, write to the Free Software Foundation, Inc.,
00010 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
00011 ******************************************************************************/
00012 
00013 #include <basix/tuple.hpp>
00014 namespace mmx {
00015 
00016 void
00017 tuple_type_info (nat& id, bool& mode) {
00018   static table<nat,nat> t (0);
00019   static table<nat,nat> u (0);
00020   if (mode == false) {
00021     mode= t->contains (id);
00022     id= read (t, id);
00023   }
00024   else {
00025     if (u->contains (id)) id= u[id];
00026     else {
00027       nat new_id= new_type_id ();
00028       t[new_id]= id;
00029       u[id]= new_id;
00030       id= new_id;
00031     }
00032   }
00033 }
00034 
00035 } // namespace mmx
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines