TxtObservationIO.h
Go to the documentation of this file.
1 // (C) Copyright Renaud Detry 2007-2015.
2 // Distributed under the GNU General Public License and under the
3 // BSD 3-Clause License (See accompanying file LICENSE.txt).
4 
5 /** @file */
6 
7 #ifndef NUKLEI_TXTOBSERVATIONSERIAL_H
8 #define NUKLEI_TXTOBSERVATIONSERIAL_H
9 
10 
11 #include <nuklei/Definitions.h>
12 #include <nuklei/ObservationIO.h>
13 #include <nuklei/TxtObservation.h>
15 
16 namespace nuklei {
17 
18 
20  {
21  public:
22  TxtReader(const std::string &observationFileName);
23  ~TxtReader();
24 
25  Observation::Type type() const { return Observation::TXT; }
26 
27  void reset();
28 
29  protected:
30  void init_();
31  NUKLEI_UNIQUE_PTR<Observation> readObservation_();
32  private:
33  std::ifstream in_;
34  std::string observationFileName;
35  };
36 
37 
39  {
40  public:
41  TxtWriter(const std::string &observationFileName);
42  ~TxtWriter();
43 
44  Observation::Type type() const { return Observation::TXT; }
45 
46  void init();
47  void reset();
48 
49  NUKLEI_UNIQUE_PTR<Observation> templateObservation() const
50  { return NUKLEI_UNIQUE_PTR<Observation>(NUKLEI_MOVE(new TxtObservation)); }
51 
52  void writeObservation(const Observation &o);
53  void writeBuffer();
54 
55  private:
56  std::string observationFileName_;
57  KernelCollection points_;
58  };
59 
60 
61 }
62 
63 #endif
64 
Definition: Observation.h:17
Public namespace.
Definition: Color.cpp:9
This class acts as a vector-like container for kernels. It also provides methods related to kernel de...
Base class for kernel reader and point reader classes.
Definition: ObservationIO.h:34
Base class for kernel writer and point writer classes.
© Copyright 2007-2013 Renaud Detry.
Distributed under the terms of the GNU General Public License (GPL).
(See accompanying file LICENSE.txt or copy at http://www.gnu.org/copyleft/gpl.html.)
Revised Sun Sep 13 2020 19:10:06.