IisObservationIO.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_IIS_OBSERVATIONSERIAL_H
8 #define NUKLEI_IIS_OBSERVATIONSERIAL_H
9 
10 
11 #include <boost/ptr_container/ptr_list.hpp>
12 #include <nuklei/Definitions.h>
13 #include <nuklei/ObservationIO.h>
14 #include <nuklei/IisObservation.h>
15 
16 #ifdef NUKLEI_USE_TICPP
17 namespace ticpp {
18  class Document;
19  class Node;
20  class Element;
21  template < class T > class Iterator;
22 }
23 #endif
24 
25 namespace nuklei {
26 
28  {
29  public:
30  IisReader(const std::string &observationFileName);
31  ~IisReader();
32 
33  Observation::Type type() const { return Observation::IIS; }
34 
35  void reset();
36 
37  protected:
38  void init_();
39  NUKLEI_UNIQUE_PTR<Observation> readObservation_();
40  std::string observationFileName_;
41  private:
42 #ifdef NUKLEI_USE_TICPP
43  boost::shared_ptr<ticpp::Document> in_;
44  typedef ticpp::Iterator< ticpp::Element > ElementIterator;
45  boost::shared_ptr<ElementIterator> e_;
46 #endif
47  };
48 
50  {
51  public:
52  IisWriter(const std::string &observationFileName);
53  ~IisWriter();
54 
55  Observation::Type type() const { return Observation::IIS; }
56 
57  void init();
58  void reset();
59 
60  NUKLEI_UNIQUE_PTR<Observation> templateObservation() const
61  { return NUKLEI_UNIQUE_PTR<Observation>(NUKLEI_MOVE(new IisObservation)); }
62 
63  void writeObservation(const Observation &o);
64  void writeBuffer();
65 
66  private:
67  std::string observationFileName_;
68 #ifdef NUKLEI_USE_TICPP
69  boost::shared_ptr<ticpp::Document> out_;
70  ticpp::Element* kc_;
71 #endif
72  coord_t totalWeight_;
73  };
74 
75 }
76 
77 #endif
78 
Definition: Observation.h:17
Public namespace.
Definition: Color.cpp:9
Base class for kernel reader and point reader classes.
Definition: ObservationIO.h:34
double coord_t
Type for point coordinates.
Definition: Definitions.h:25
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.