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