Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
io.h File Reference
#include <iostream>
#include <CGAL/IO/io_tags.h>
#include <CGAL/IO/Color.h>
#include <CGAL/Object.h>
Include dependency graph for io.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  IO
 

Functions

IO::Mode get_mode (std::ios &i)
 
IO::Mode set_ascii_mode (std::ios &i)
 
IO::Mode set_binary_mode (std::ios &i)
 
IO::Mode set_pretty_mode (std::ios &i)
 
IO::Mode set_mode (std::ios &i, IO::Mode m)
 
bool is_pretty (std::ios &i)
 
bool is_ascii (std::ios &i)
 
bool is_binary (std::ios &i)
 
io_Read_write io_tag (char)
 
template<class T >
void write (std::ostream &os, const T &t, const io_Read_write &)
 
template<class T >
void write (std::ostream &os, const T &t, const io_Operator &)
 
template<class T >
void write (std::ostream &os, const T &t, const io_Extract_insert &)
 
template<class T >
void write (std::ostream &os, const T &t)
 
template<class T >
void read (std::istream &is, T &t, const io_Read_write &)
 
template<class T >
void read (std::istream &is, T &t, const io_Operator &)
 
template<class T >
void read (std::istream &is, T &t, const io_Extract_insert &)
 
template<class T >
void read (std::istream &is, T &t)
 
std::ostream & operator<< (std::ostream &out, const Color &col)
 
std::istream & operator>> (std::istream &is, Color &col)
 

Function Documentation

IO::Mode get_mode ( std::ios &  i)

Definition at line 64 of file io.C.

References IO::mode.

Referenced by set_ascii_mode(), set_binary_mode(), set_mode(), and set_pretty_mode().

65 {
66  return static_cast<IO::Mode>(i.iword(IO::mode));
67 }
Mode
Definition: io.h:64
blockLoc i
Definition: read.cpp:79
static int mode
Definition: io.h:63

Here is the caller graph for this function:

io_Read_write io_tag ( char  )
inline

Definition at line 90 of file io.h.

90 { return io_Read_write(); }
bool is_ascii ( std::ios &  i)

Definition at line 111 of file io.C.

References IO::ASCII, and IO::mode.

112 {
113  return i.iword(IO::mode) == IO::ASCII;
114 }
Definition: io.h:64
blockLoc i
Definition: read.cpp:79
static int mode
Definition: io.h:63
bool is_binary ( std::ios &  i)

Definition at line 118 of file io.C.

References IO::BINARY, and IO::mode.

119 {
120  return i.iword(IO::mode) == IO::BINARY;
121 }
blockLoc i
Definition: read.cpp:79
static int mode
Definition: io.h:63
Definition: io.h:64
bool is_pretty ( std::ios &  i)

Definition at line 105 of file io.C.

References IO::mode, and IO::PRETTY.

106 {
107  return i.iword(IO::mode) == IO::PRETTY;
108 }
Definition: io.h:64
blockLoc i
Definition: read.cpp:79
static int mode
Definition: io.h:63
std::ostream& operator<< ( std::ostream &  out,
const Color col 
)
inline

Definition at line 166 of file io.h.

References IO::ASCII, IO::BINARY, Color::blue(), Color::green(), IO::mode, Color::red(), and write().

167 {
168  switch(out.iword(IO::mode)) {
169  case IO::ASCII :
170  return out << static_cast<int>(col.red()) << ' '
171  << static_cast<int>(col.green()) << ' '
172  << static_cast<int>(col.blue());
173  case IO::BINARY :
174  write(out, static_cast<int>(col.red()));
175  write(out, static_cast<int>(col.green()));
176  write(out, static_cast<int>(col.blue()));
177  return out;
178  default:
179  return out << "Color(" << static_cast<int>(col.red()) << ", "
180  << static_cast<int>(col.green()) << ", "
181  << static_cast<int>(col.blue()) << ')';
182  }
183 }
unsigned char blue() const
Definition: Color.h:74
Definition: io.h:64
void write(std::ostream &os, const T &t, const io_Read_write &)
Definition: io.h:96
static int mode
Definition: io.h:63
Definition: io.h:64
unsigned char green() const
Definition: Color.h:73
unsigned char red() const
Definition: Color.h:72

Here is the call graph for this function:

std::istream& operator>> ( std::istream &  is,
Color col 
)
inline

Definition at line 186 of file io.h.

References IO::ASCII, IO::BINARY, IO::mode, and read().

187 {
188  int r, g, b;
189  switch(is.iword(IO::mode)) {
190  case IO::ASCII :
191  is >> r >> g >> b;
192  break;
193  case IO::BINARY :
194  read(is, r);
195  read(is, g);
196  read(is, b);
197  break;
198  default:
199  std::cerr << "" << std::endl;
200  std::cerr << "Stream must be in ascii or binary mode" << std::endl;
201  break;
202  }
203  col = Color(r,g,b);
204  return is;
205 }
Definition: io.h:64
static int mode
Definition: io.h:63
Definition: io.h:64
Color
Definition: rfc_basic.h:48
void read(std::istream &is, T &t, const io_Read_write &)
Definition: io.h:132

Here is the call graph for this function:

void read ( std::istream &  is,
T &  t,
const io_Read_write  
)
inline

Definition at line 132 of file io.h.

Referenced by operator>>(), tpz_ordered::parse_data(), tpz_fequad::parse_data(), read(), and RFC_Pane_base::read_binary().

133 {
134  is.read((char*)&t, sizeof(t));
135 }

Here is the caller graph for this function:

void read ( std::istream &  is,
T &  t,
const io_Operator  
)
inline

Definition at line 141 of file io.h.

142 {
143  is >> t;
144 }
void read ( std::istream &  is,
T &  t,
const io_Extract_insert  
)
inline

Definition at line 150 of file io.h.

151 {
152  extract(is, t);
153 }
void read ( std::istream &  is,
T &  t 
)
inline

Definition at line 159 of file io.h.

References io_tag(), and read().

160 {
161  read(is, t, io_tag(t));
162 }
io_Operator io_tag(double)
Definition: double.h:200
void read(std::istream &is, T &t, const io_Read_write &)
Definition: io.h:132

Here is the call graph for this function:

IO::Mode set_ascii_mode ( std::ios &  i)

Definition at line 70 of file io.C.

References IO::ASCII, get_mode(), and IO::mode.

Referenced by Overlay::write_inodes_tec(), Overlay::write_inodes_vec(), Overlay::write_overlay_off(), and RFC_Pane_base::write_tec_ascii().

71 {
72  IO::Mode m = get_mode(i);
73  i.iword(IO::mode) = IO::ASCII;
74  return m;
75 }
IO::Mode get_mode(std::ios &i)
Definition: io.C:64
Definition: io.h:64
Mode
Definition: io.h:64
blockLoc i
Definition: read.cpp:79
static int mode
Definition: io.h:63

Here is the call graph for this function:

Here is the caller graph for this function:

IO::Mode set_binary_mode ( std::ios &  i)

Definition at line 79 of file io.C.

References IO::BINARY, get_mode(), and IO::mode.

80 {
81  IO::Mode m = get_mode(i);
82  i.iword(IO::mode) = IO::BINARY;
83  return m;
84 }
IO::Mode get_mode(std::ios &i)
Definition: io.C:64
Mode
Definition: io.h:64
blockLoc i
Definition: read.cpp:79
static int mode
Definition: io.h:63
Definition: io.h:64

Here is the call graph for this function:

IO::Mode set_mode ( std::ios &  i,
IO::Mode  m 
)

Definition at line 97 of file io.C.

References get_mode(), and IO::mode.

98 {
99  IO::Mode old = get_mode(i);
100  i.iword(IO::mode) = m;
101  return old;
102 }
IO::Mode get_mode(std::ios &i)
Definition: io.C:64
Mode
Definition: io.h:64
blockLoc i
Definition: read.cpp:79
static int mode
Definition: io.h:63

Here is the call graph for this function:

IO::Mode set_pretty_mode ( std::ios &  i)

Definition at line 88 of file io.C.

References get_mode(), IO::mode, and IO::PRETTY.

89 {
90  IO::Mode m = get_mode(i);
91  i.iword(IO::mode) = IO::PRETTY;
92  return m;
93 }
IO::Mode get_mode(std::ios &i)
Definition: io.C:64
Definition: io.h:64
Mode
Definition: io.h:64
blockLoc i
Definition: read.cpp:79
static int mode
Definition: io.h:63

Here is the call graph for this function:

void write ( std::ostream &  os,
const T &  t,
const io_Read_write  
)
inline

Definition at line 96 of file io.h.

Referenced by operator<<(), write(), and RFC_Pane_base::write_binary().

97 {
98  os.write((char*)&t, sizeof(t));
99 }

Here is the caller graph for this function:

void write ( std::ostream &  os,
const T &  t,
const io_Operator  
)
inline

Definition at line 105 of file io.h.

106 {
107  os << t;
108 }
void write ( std::ostream &  os,
const T &  t,
const io_Extract_insert  
)
inline

Definition at line 114 of file io.h.

115 {
116  insert(os, t);
117 }
void write ( std::ostream &  os,
const T &  t 
)
inline

Definition at line 123 of file io.h.

References io_tag(), and write().

124 {
125  write(os, t, io_tag(t));
126 }
io_Operator io_tag(double)
Definition: double.h:200
void write(std::ostream &os, const T &t, const io_Read_write &)
Definition: io.h:96

Here is the call graph for this function: