~ubuntu-branches/ubuntu/wily/rheolef/wily

« back to all changes in this revision

Viewing changes to skit/plib2/diststream.h

  • Committer: Package Import Robot
  • Author(s): Pierre Saramito, Pierre Saramito, Sylvestre Ledru
  • Date: 2013-04-30 11:29:51 UTC
  • mfrom: (1.2.1) (11.1.1 experimental)
  • Revision ID: package-import@ubuntu.com-20130430112951-g69nuqin77t75dek
Tags: 6.4-1
[ Pierre Saramito ]
* New upstream release 6.4 (major changes):
  - new powerful c++ expressions for FEM specifications
  - configure script improved (portability increased)
  - minor bug fixes
* control:
  - all architectures are considered (armel & armhf are back)
  - no more circular-dependency librheolef-dev <--> rheolef
* rules: add security compiler flags (hardening and -W,-l,relro)
* watch: include an updated version, thanks to B. Martens <bartm@debian.org>
* copyright: various file format fixes

[ Sylvestre Ledru ]
*  Standards-Version updated to 3.9.4

Show diffs side-by-side

added added

removed removed

Lines of Context:
45
45
       : _ptr_os(&os), _use_alloc(false), _comm(comm) {}
46
46
 
47
47
     odiststream (std::string filename, std::string suffix = "",
 
48
             bool use_gzip = true,
48
49
             const communicator& comm = communicator())
49
50
       : _ptr_os(0), _use_alloc(false), _comm()
50
51
       {
51
 
         open (filename, suffix, comm);
 
52
         open (filename, suffix, use_gzip, comm);
52
53
       }
53
 
 
54
54
     ~odiststream();
55
55
 
56
56
// modifiers:
57
57
 
58
58
     void open (std::string filename, std::string suffix = "",
 
59
             bool use_gzip = true,
59
60
             const communicator& comm = communicator());
60
 
 
 
61
     void flush();
61
62
     void close();
62
63
 
63
64
// accessors:
85
86
     bool          _use_alloc;
86
87
     communicator  _comm;
87
88
};
88
 
 
89
 
// standard i/o
90
 
 
 
89
// standard i/o:
91
90
# define define_sequential_odiststream_raw_macro(arg)   \
92
91
    inline                                              \
93
 
    odiststream&                                                \
 
92
    odiststream&                                        \
94
93
    operator << (odiststream& s, arg) {                 \
95
94
        if (s.nop()) return s; s.os() << x; return s;   \
96
95
    }
97
 
 
98
 
# define define_sequential_odiststream_macro(T)                 \
 
96
# define define_sequential_odiststream_macro(T)         \
99
97
    define_sequential_odiststream_raw_macro(const T& x)
100
98
 
101
99
# define define_distributed_odiststream_macro(T)        \
102
100
    inline                                              \
103
 
    odiststream&                                                \
 
101
    odiststream&                                        \
104
102
    operator << (odiststream& s, const T& x) {          \
105
103
        s.os() << x; return s;                          \
106
104
    }
246
244
idiststream&
247
245
operator>> (idiststream& ids, const catchmark& m)
248
246
{
249
 
    if (ids.nop()) return ids;
250
 
    ids.is() >> setmark(m.mark());
251
 
    std::string label = "#" + m.mark();
252
 
    if (!scatch(ids.is(),label)) {
253
 
        warning_macro ("catchmark: label `"<< label <<"' not found on input");
254
 
    }
255
 
    return ids;
 
247
  if (ids.nop()) return ids;
 
248
  ids.is() >> setmark(m.mark());
 
249
  std::string label = "#" + m.mark();
 
250
  if (!scatch(ids.is(),label)) {
 
251
    bool verbose  = iorheo::getverbose(ids.is());
 
252
    if (verbose) warning_macro ("catchmark: label `"<< label <<"' not found on input");
 
253
  }
 
254
  return ids;
256
255
}
257
256
inline
258
257
odiststream&