00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #ifndef PPL_Interval_Info_inlines_hh
00025 #define PPL_Interval_Info_inlines_hh 1
00026
00027 #include <iomanip>
00028
00029 namespace Parma_Polyhedra_Library {
00030
00031 template <typename Policy>
00032 inline void
00033 Interval_Info_Null<Policy>::swap(Interval_Info_Null<Policy>&) {
00034 }
00035
00036 template <typename Policy>
00037 inline void
00038 Interval_Info_Null<Policy>::ascii_dump(std::ostream& s) const {
00039 }
00040
00041 template <typename Policy>
00042 inline bool
00043 Interval_Info_Null<Policy>::ascii_load(std::istream& s) {
00044 return true;
00045 }
00046
00047 template <typename Policy>
00048 inline void
00049 Interval_Info_Null_Open<Policy>::ascii_dump(std::ostream& s) const {
00050 s << (open ? "open" : "closed");
00051 }
00052
00053 template <typename Policy>
00054 inline bool
00055 Interval_Info_Null_Open<Policy>::ascii_load(std::istream& s) {
00056 std::string str;
00057 if (!(s >> str))
00058 return false;
00059 if (str == "open") {
00060 open = true;
00061 return true;
00062 }
00063 if (str == "closed") {
00064 open = false;
00065 return true;
00066 }
00067 return false;
00068 }
00069
00070 template <typename T, typename Policy>
00071 inline void
00072 Interval_Info_Bitset<T, Policy>::swap(Interval_Info_Bitset<T, Policy>& y) {
00073 std::swap(bitset, y.bitset);
00074 }
00075
00076 template <typename T, typename Policy>
00077 inline void
00078 Interval_Info_Bitset<T, Policy>::ascii_dump(std::ostream& s) const {
00079 std::ios_base::fmtflags old = s.flags();
00080 s << std::hex << bitset;
00081 s.flags(old);
00082 }
00083
00084 template <typename T, typename Policy>
00085 inline bool
00086 Interval_Info_Bitset<T, Policy>::ascii_load(std::istream& s) {
00087 std::ios_base::fmtflags old = s.flags();
00088 if (s >> std::hex >> bitset) {
00089 s.flags(old);
00090 return s;
00091 }
00092 else
00093 return false;
00094 }
00095
00096 }
00097
00098 namespace std {
00099
00100 #ifdef PPL_DOXYGEN_INCLUDE_IMPLEMENTATION_DETAILS
00101
00102 #endif // defined(PPL_DOXYGEN_INCLUDE_IMPLEMENTATION_DETAILS)
00103 template <typename Policy>
00104 inline void
00105 swap(Parma_Polyhedra_Library::Interval_Info_Null<Policy>& x,
00106 Parma_Polyhedra_Library::Interval_Info_Null<Policy>& y) {
00107 x.swap(y);
00108 }
00109
00110 #ifdef PPL_DOXYGEN_INCLUDE_IMPLEMENTATION_DETAILS
00111
00112 #endif // defined(PPL_DOXYGEN_INCLUDE_IMPLEMENTATION_DETAILS)
00113 template <typename T, typename Policy>
00114 inline void
00115 swap(Parma_Polyhedra_Library::Interval_Info_Bitset<T, Policy>& x,
00116 Parma_Polyhedra_Library::Interval_Info_Bitset<T, Policy>& y) {
00117 x.swap(y);
00118 }
00119
00120 }
00121
00122 #endif // !defined(PPL_Interval_Info_inlines_hh)