Back to index

texmacs  1.0.7.15
space.hpp
Go to the documentation of this file.
00001 
00002 /******************************************************************************
00003 * MODULE     : space.hpp
00004 * DESCRIPTION: spacing
00005 * COPYRIGHT  : (C) 1999  Joris van der Hoeven
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 SPACE_H
00013 #define SPACE_H
00014 #include "tree.hpp"
00015 
00016 class space_rep: concrete_struct {
00017 public:
00018   SI min;
00019   SI def;
00020   SI max;
00021 
00022   space_rep (SI def);
00023   space_rep (SI min, SI def, SI max);
00024 
00025   friend class space;
00026 };
00027 
00028 class space {
00029   CONCRETE(space);
00030   space (SI def=0);
00031   space (SI min, SI def, SI max);
00032   operator tree ();
00033   inline void operator += (space spc) {
00034     rep->min += spc->min;
00035     rep->def += spc->def;
00036     rep->max += spc->max; }
00037 };
00038 CONCRETE_CODE(space);
00039 
00040 bool operator == (space spc1, space spc2);
00041 bool operator != (space spc1, space spc2);
00042 tm_ostream& operator << (tm_ostream& out, space spc);
00043 space copy (space spc);
00044 space operator + (space spc1, space spc2);
00045 space operator - (space spc1, space spc2);
00046 space operator * (int i, space spc);
00047 space operator / (space spc, int i);
00048 space max (space spc1, space spc2);
00049 
00050 #endif // defined SPACE_H