Go to the documentation of this file.
7 #ifndef NUKLEI_OBSERVATIONSERIAL_H
8 #define NUKLEI_OBSERVATIONSERIAL_H
11 #include <boost/utility.hpp>
20 class KernelCollection;
39 NUKLEI_UNIQUE_PTR<Observation> readObservation();
40 NUKLEI_UNIQUE_PTR<KernelCollection> readObservations();
43 virtual Observation::Type type()
const = 0;
45 void registerType(Observation::Type t)
47 oc.type_ = nameFromType<Observation>(t);
52 oc.type_ =
typeid(reader).name();
58 virtual void addRegionOfInterest(boost::shared_ptr<RegionOfInterest> roi);
61 virtual void init() { registerType(*
this); init_(); }
62 virtual void reset() = 0;
66 typedef std::map<std::string, unsigned> map_t;
67 typedef std::list<std::string> list_t;
71 void incLabel(
const std::string &label);
75 friend std::ostream& operator<<(std::ostream &out,
const Counter &c);
81 static NUKLEI_UNIQUE_PTR<ObservationReader>
82 createReader(
const std::string& arg);
83 static NUKLEI_UNIQUE_PTR<ObservationReader>
84 createReader(
const std::string& arg,
const Observation::Type t);
86 virtual NUKLEI_UNIQUE_PTR<Observation> readObservation_() = 0;
87 virtual void init_() = 0;
90 boost::shared_ptr<RegionOfInterest> roi_;
112 Observation::Type& t);
121 const Observation::Type& t);
141 Observation::Type& t);
153 const Observation::Type& t);
161 virtual void writeObservation(
const Observation &o) = 0;
164 virtual void writeBuffer() = 0;
165 virtual void init() = 0;
166 virtual void reset() = 0;
167 virtual NUKLEI_UNIQUE_PTR<Observation> templateObservation()
const = 0;
169 virtual Observation::Type type()
const = 0;
171 static NUKLEI_UNIQUE_PTR<ObservationWriter>
172 createWriter(
const std::string& arg,
const Observation::Type t);
180 const Observation::Type &t = Observation::NUKLEI);
185 const Observation::Type &t = Observation::NUKLEI);
void writeObservations(ObservationWriter &w, const KernelCollection &kc)
Writes the content of kc using the provided writer w.
This class acts as a vector-like container for kernels. It also provides methods related to kernel de...
kernel::base::ptr readSingleObservationWithSpecificFormat(const std::string &s, const Observation::Type &t)
Reads a single observation from file s (no automatic type detection), and returns it.
Polymorphic kernel class.
NUKLEI_UNIQUE_PTR< kernel::base > ptr
NUKLEI_UNIQUE_PTR for kernel::base.
Base class for kernel reader and point reader classes.
void readObservations(ObservationReader &r, KernelCollection &kc)
Reads the data available from the reader r and stores it into kc.
kernel::base::ptr readSingleObservation(const std::string &s)
Reads a single observation from file s (with automatic type detection), and returns it.
void readObservationsWithSpecificFormat(const std::string &s, KernelCollection &kc, const Observation::Type &t)
Reads the file s (no automatic type detection) and stores the read data into kc.
Base class for kernel writer and point writer classes.
void writeSingleObservation(const std::string &s, const kernel::base &k, const Observation::Type &t=Observation::NUKLEI)
Writes k to file s, using file format t.
Obsolete – use boost::optional and boost::none instead.