GOAT (Geometrical optics application tool) 0.1
Loading...
Searching...
No Matches
storageBackend.h
Go to the documentation of this file.
1// goat/storage/IStorageInterfaces.hpp
2#pragma once
3
4#include <string>
5#include <memory>
6#include "superarray.h"
7
8
9namespace GOAT {
10 namespace raytracing
11 {
12 class Scene; // Forward?Deklaration deines Datenmodells
13 typedef struct pulseParameters
14 {
15 double pulseWidth = 100.0;
16 double spatialResolution = 1.0;
17 int numReflex = 0;
18 double wvl = 1.0;
19 double repRate = 10.0;
21 double time = 100;
22 };
23 }
24
25
26
27 namespace storage
28 {
29
30
34
35 class IReader {
36 public:
37 virtual ~IReader() = default;
38
40
41 virtual void read(const std::string& filename) = 0;
42 };
43
45 using ReaderFactory = std::unique_ptr<IReader>(*)();
46
48 void registerReader(const std::string& name, ReaderFactory factory);
49
51 std::unique_ptr<IReader> createReader(const std::string& name);
52
53
54 // ------------------------------------------------------------------------
55 // Writer?Interface
56 // ------------------------------------------------------------------------
57 class IWriter {
58 public:
59 virtual ~IWriter() = default;
60
62 virtual void write(
63 const GOAT::raytracing::Scene& scene,
64 GOAT::raytracing::SuperArray<GOAT::maths::Vector<std::complex<double>>>* sa,
65 raytracing::pulseParameters& pp, // gleiche cv/ref-Qualifizierung
66 const std::string& filename
67 ) = 0;
68 };
69
71 using WriterFactory = std::unique_ptr<IWriter>(*)();
72
74 void registerWriter(const std::string& name, WriterFactory factory);
75
77 std::unique_ptr<IWriter> createWriter(const std::string& name);
78
79 } // namespace storage
80} // namespace GOAT
Template class for threedimensional vectors.
Definition vector.h:57
Class defining a scene with lightsources and objects. This is a container used to inform the Raytrace...
Definition raytrace.h:28
Template class to store arbitrary information in a 3D-grid This template class provides a virtual 3D-...
Definition superarray.h:26
virtual void read(const std::string &filename)=0
Reads the file filename and returns a Scene object.
virtual ~IReader()=default
virtual ~IWriter()=default
virtual void write(const GOAT::raytracing::Scene &scene, GOAT::raytracing::SuperArray< GOAT::maths::Vector< std::complex< double > > > *sa, raytracing::pulseParameters &pp, const std::string &filename)=0
Schreibt das Scene?Objekt in die Datei filename.
Raytracer used for ultrashort pulse calculation with raytracing only.
Definition asphericLens.h:6
std::unique_ptr< IWriter >(*)() WriterFactory
Funktionszeiger-Typ für Writer?Factories (erzeugt std::unique_ptr<IWriter>)
void registerReader(const std::string &name, ReaderFactory factory)
Registriert eine Reader?Factory unter dem Schlüssel name
std::unique_ptr< IReader >(*)() ReaderFactory
Funktionszeiger-Typ für Reader?Factories (erzeugt std::unique_ptr<IReader>)
void registerWriter(const std::string &name, WriterFactory factory)
Registriert eine Writer?Factory unter dem Schlüssel name
std::unique_ptr< IReader > createReader(const std::string &name)
Erzeugt per String?Lookup den passenden Reader.
std::unique_ptr< IWriter > createWriter(const std::string &name)
Erzeugt per String?Lookup den passende Writer.
This class is used for the iray class. This class is intended for internal use only....
Definition fresnel.h:7