PPL  1.2
Variable_defs.hh
Go to the documentation of this file.
1 /* Variable class declaration.
2  Copyright (C) 2001-2010 Roberto Bagnara <bagnara@cs.unipr.it>
3  Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com)
4 
5 This file is part of the Parma Polyhedra Library (PPL).
6 
7 The PPL is free software; you can redistribute it and/or modify it
8 under the terms of the GNU General Public License as published by the
9 Free Software Foundation; either version 3 of the License, or (at your
10 option) any later version.
11 
12 The PPL is distributed in the hope that it will be useful, but WITHOUT
13 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
14 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
15 for more details.
16 
17 You should have received a copy of the GNU General Public License
18 along with this program; if not, write to the Free Software Foundation,
19 Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1307, USA.
20 
21 For the most up-to-date information see the Parma Polyhedra Library
22 site: http://bugseng.com/products/ppl/ . */
23 
24 #ifndef PPL_Variable_defs_hh
25 #define PPL_Variable_defs_hh 1
26 
27 #include "Variable_types.hh"
28 #include "Init_types.hh"
29 #include "globals_types.hh"
30 #include <iosfwd>
31 #include <set>
32 
33 namespace Parma_Polyhedra_Library {
34 
35 namespace IO_Operators {
36 
38 
39 std::ostream&
40 operator<<(std::ostream& s, const Variable v);
41 
42 } // namespace IO_Operators
43 
45 
46 bool less(Variable v, Variable w);
47 
49 void
50 swap(Variable& x, Variable& y);
51 
52 } // namespace Parma_Polyhedra_Library
53 
55 
86 
87 public:
89 
94  explicit Variable(dimension_type i);
95 
97  dimension_type id() const;
98 
101 
103 
107 
110 
113 
115  bool OK() const;
116 
118  typedef void output_function_type(std::ostream& s, const Variable v);
119 
121  static void default_output_function(std::ostream& s, const Variable v);
122 
125 
128 
130 
131  struct Compare {
133  bool operator()(Variable x, Variable y) const;
134  };
135 
137  void m_swap(Variable& v);
138 
139 private:
142 
143  // The initialization class needs to set the default output function.
144  friend class Init;
145 
146  friend std::ostream&
148  const Variable v);
149 
152 
153 };
154 
155 #include "Variable_inlines.hh"
156 
157 #endif // !defined(PPL_Variable_defs_hh)
void swap(CO_Tree &x, CO_Tree &y)
size_t dimension_type
An unsigned integral type for representing space dimensions.
dimension_type varid
The index of the Cartesian axis.
Variable(dimension_type i)
Builds the variable corresponding to the Cartesian axis of index i.
static output_function_type * get_output_function()
Returns the pointer to the current output function.
std::ostream & operator<<(std::ostream &s, const Ask_Tell< D > &x)
static dimension_type max_space_dimension()
Returns the maximum space dimension a Variable can handle.
bool OK() const
Checks if all the invariants are satisfied.
Definition: Variable.cc:34
void output_function_type(std::ostream &s, const Variable v)
Type of output functions.
dimension_type id() const
Returns the index of the Cartesian axis associated to the variable.
static output_function_type * current_output_function
Pointer to the current output function.
A dimension of the vector space.
dimension_type space_dimension() const
Returns the dimension of the vector space enclosing *this.
bool operator()(Variable x, Variable y) const
Returns true if and only if x comes before y.
void m_swap(Variable &v)
Swaps *this and v.
memory_size_type total_memory_in_bytes() const
Returns the total size in bytes of the memory occupied by *this.
memory_size_type external_memory_in_bytes() const
Returns the size in bytes of the memory managed by *this.
static void default_output_function(std::ostream &s, const Variable v)
The default output function.
Definition: Variable.cc:39
Class for initialization and finalization.
Definition: Init_defs.hh:72
Binary predicate defining the total ordering on variables.
The entire library is confined to this namespace.
Definition: version.hh:61
size_t memory_size_type
An unsigned integral type for representing memory size in bytes.
static void set_output_function(output_function_type *p)
Sets the output function to be used for printing Variable objects.