CrdObservationIO.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_CRDOBSERVATIONSERIAL_H
8 #define NUKLEI_CRDOBSERVATIONSERIAL_H
9 
10 
11 #include <nuklei/Definitions.h>
12 #include <nuklei/ObservationIO.h>
13 #include <nuklei/CrdObservation.h>
14 
15 namespace nuklei {
16 
17 
19  {
20  public:
21  CrdReader(const std::string &observationFileName);
22  ~CrdReader();
23 
24  Observation::Type type() const { return Observation::CRD; }
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  };
35 
36 
38  {
39  public:
40  CrdWriter(const std::string &observationFileName, bool syncpc = false);
41  ~CrdWriter();
42 
43  Observation::Type type() const { return Observation::CRD; }
44 
45  void init();
46  void reset();
47 
48  NUKLEI_UNIQUE_PTR<Observation> templateObservation() const
49  { return NUKLEI_UNIQUE_PTR<Observation>(NUKLEI_MOVE(new CrdObservation)); }
50 
51  void writeObservation(const Observation &o);
52  void writeBuffer();
53 
54  private:
55  std::string observationFileName_;
56  bool syncpc_; // write "syncpc" on the first line.
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.