Bridge++  Version 1.5.4
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
io_format.h
Go to the documentation of this file.
1 
14 #ifndef IO_FORMAT_INCLUDED
15 #define IO_FORMAT_INCLUDED
16 
18 
35 namespace IO_Format {
36  class Format {
37  public:
38  virtual ~Format() {}
39 
40  virtual int nin() const = 0;
41  virtual int nex() const = 0;
42 
43  virtual void file_to_field(int& s, int& t, const int i, const int j) const = 0;
44  };
45 
46  class Trivial_Format : public Format {
47  public:
48  virtual ~Trivial_Format() {}
49 
50  virtual int nin() const { return 0; }
51  virtual int nex() const { return 0; }
52 
53  virtual void file_to_field(int& s, int& t, const int i, const int j) const
54  {
55  s = i;
56  t = j;
57  }
58  };
59 
60 //----------------------------------------------------------------
61 // predefined formats
62 
63  extern const Format *Trivial;
64 
65 //----------------------------------------------------------------
66 }
67 #endif /* IO_FORMAT_INCLUDED */
virtual void file_to_field(int &s, int &t, const int i, const int j) const =0
virtual int nex() const =0
virtual int nin() const
Definition: io_format.h:50
virtual int nin() const =0
virtual void file_to_field(int &s, int &t, const int i, const int j) const
Definition: io_format.h:53
virtual int nex() const
Definition: io_format.h:51
const Format * Trivial
Definition: io_format.cpp:27
virtual ~Format()
Definition: io_format.h:38