PPL  0.12.1
Variable.defs.hh
Go to the documentation of this file.
00001 /* Variable class declaration.
00002    Copyright (C) 2001-2010 Roberto Bagnara <bagnara@cs.unipr.it>
00003    Copyright (C) 2010-2012 BUGSENG srl (http://bugseng.com)
00004 
00005 This file is part of the Parma Polyhedra Library (PPL).
00006 
00007 The PPL is free software; you can redistribute it and/or modify it
00008 under the terms of the GNU General Public License as published by the
00009 Free Software Foundation; either version 3 of the License, or (at your
00010 option) any later version.
00011 
00012 The PPL is distributed in the hope that it will be useful, but WITHOUT
00013 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
00014 FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
00015 for more details.
00016 
00017 You should have received a copy of the GNU General Public License
00018 along with this program; if not, write to the Free Software Foundation,
00019 Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1307, USA.
00020 
00021 For the most up-to-date information see the Parma Polyhedra Library
00022 site: http://bugseng.com/products/ppl/ . */
00023 
00024 #ifndef PPL_Variable_defs_hh
00025 #define PPL_Variable_defs_hh 1
00026 
00027 #include "Variable.types.hh"
00028 #include "Init.types.hh"
00029 #include "globals.types.hh"
00030 #include <iosfwd>
00031 #include <set>
00032 
00033 namespace Parma_Polyhedra_Library {
00034 
00035 namespace IO_Operators {
00036 
00038 
00039 std::ostream&
00040 operator<<(std::ostream& s, const Variable v);
00041 
00042 } // namespace IO_Operators
00043 
00045 
00046 bool less(Variable v, Variable w);
00047 
00048 } // namespace Parma_Polyhedra_Library
00049 
00051 
00081 class Parma_Polyhedra_Library::Variable {
00082 
00083 public:
00085 
00090   explicit Variable(dimension_type i);
00091 
00093   dimension_type id() const;
00094 
00096   static dimension_type max_space_dimension();
00097 
00099 
00102   dimension_type space_dimension() const;
00103 
00105   memory_size_type total_memory_in_bytes() const;
00106 
00108   memory_size_type external_memory_in_bytes() const;
00109 
00111   bool OK() const;
00112 
00114   typedef void output_function_type(std::ostream& s, const Variable v);
00115 
00117   static void set_output_function(output_function_type* p);
00118 
00120   static output_function_type* get_output_function();
00121 
00123 
00124   struct Compare {
00126     bool operator()(Variable x, Variable y) const;
00127   };
00128 
00129 private:
00131   dimension_type varid;
00132 
00133   // The initialization class needs to set the default output function.
00134   friend class Init;
00135 
00136   friend std::ostream&
00137   Parma_Polyhedra_Library::IO_Operators::operator<<(std::ostream& s,
00138                                                     const Variable v);
00139 
00141   static output_function_type* current_output_function;
00142 
00144   static void default_output_function(std::ostream& s, const Variable v);
00145 };
00146 
00147 #include "Variable.inlines.hh"
00148 
00149 #endif // !defined(PPL_Variable_defs_hh)