OffObservationIO.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_OFFOBSERVATIONSERIAL_H
8 #define NUKLEI_OFFOBSERVATIONSERIAL_H
9 
10 
11 #include <nuklei/Definitions.h>
12 #include <nuklei/ObservationIO.h>
13 #include <nuklei/OffObservation.h>
14 
15 namespace nuklei {
16 
17 
19  {
20  public:
21  OffReader(const std::string &observationFileName);
22  ~OffReader();
23 
24  Observation::Type type() const { return Observation::OFF; }
25 
26  void reset();
27 
28  protected:
29  void init_();
30  NUKLEI_UNIQUE_PTR<Observation> readObservation_();
31  private:
32  std::ifstream in_;
33  std::string observationFileName;
34  int count_;
35  };
36 
37 
39  {
40  public:
41  OffWriter(const std::string &observationFileName);
42  ~OffWriter();
43 
44  Observation::Type type() const { return Observation::OFF; }
45 
46  void init();
47  void reset();
48 
49  NUKLEI_UNIQUE_PTR<Observation> templateObservation() const
50  { return NUKLEI_UNIQUE_PTR<Observation>(NUKLEI_MOVE(new OffObservation)); }
51 
52  void writeObservation(const Observation &o);
53  void writeBuffer();
54 
55  private:
56  std::string observationFileName_;
57  std::vector<Vector3> points_;
58  };
59 
60 
61 }
62 
63 #endif
64 
Definition: Observation.h:17
Public namespace.
Definition: Color.cpp:9
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.