29#ifndef __GyotoFactory_H_
30#define __GyotoFactory_H_
41#ifndef XERCES_INCLUDE_WCHAR_H
42#define XERCES_INCLUDE_WCHAR_H 0
45#include <xercesc/sax/ErrorHandler.hpp>
46#include <xercesc/dom/DOM.hpp>
47#include <xercesc/parsers/XercesDOMParser.hpp>
56 class FactoryMessenger;
57 namespace Spectrometer {
254 void write(
const char*
const fname=0);
285 void setContent(std::string content, xercesc::DOMElement *el);
309 xercesc::DOMElement *pel);
322 xercesc::DOMElement *pel);
335 xercesc::DOMElement *pel);
348 xercesc::DOMElement *pel);
361 xercesc::DOMElement *pel);
377 xercesc::DOMElement*pel);
393 xercesc::DOMElement* pel,
396 void setParameter(std::string name, std::vector<double>
const &val,
397 xercesc::DOMElement* pel,
400 void setParameter(std::string name, std::vector<unsigned long>
const &val,
401 xercesc::DOMElement* pel,
Compile-time configuration.
Spectrum of a simple object (e.g. Star)
XML input/output.
Definition: GyotoFactory.h:115
void setParameter(std::string name, double val[], size_t nelem, xercesc::DOMElement *pel, FactoryMessenger **child=NULL)
Create new XML element with array content.
xercesc::DOMElement * gg_el_
XML element representing the Metric.
Definition: GyotoFactory.h:136
Factory(char *filename)
Constructor for reading a file.
Gyoto::SmartPointer< Gyoto::Astrobj::Generic > astrobj()
Find Astrobj element, instantiate it and get it.
std::string fullPath(std::string relpath)
Transform relative path into absolute path.
void setContent(std::string content, xercesc::DOMElement *el)
Set text content of XML element.
std::string format()
Get constructed XML representation as std::string.
xercesc::XercesDOMParser * parser_
Xerces parser.
Definition: GyotoFactory.h:127
xercesc::DOMDocument * doc_
The document being read or written.
Definition: GyotoFactory.h:123
void setParameter(std::string name, unsigned int value, xercesc::DOMElement *pel)
Create new XML element with integer value.
SmartPointer< Metric::Generic > gg_
The Metric read from or written to Factory::doc_.
Definition: GyotoFactory.h:146
Factory(SmartPointer< Scenery > sc)
Constructor for saving (or printing) a Scenery.
std::string filename_
XML file name, if actually reading from or writting to file.
Definition: GyotoFactory.h:158
Factory(SmartPointer< Spectrum::Generic > sp)
Constructor for saving (or printing) a Spectrum.
xercesc::DOMDocument * getDoc()
Get Factory::doc_.
void setParameter(std::string name, long value, xercesc::DOMElement *pel)
Create new XML element with integer value.
Gyoto::SmartPointer< Gyoto::Spectrometer::Generic > spectrometer()
Find Spectrometer element, instantiate it and get it.
void setParameter(std::string name, std::string value, xercesc::DOMElement *pel)
Create new XML element with string content.
const std::string kind()
Get Factory::kind_.
Factory(SmartPointer< Screen > screen)
Constructor for saving (or printing) a Screen.
SmartPointer< Screen > screen_
The Screen read from or written to Factory::doc_.
Definition: GyotoFactory.h:148
Gyoto::SmartPointer< Gyoto::Screen > screen()
Find Screen element, instantiate it and get it.
SmartPointer< Scenery > scenery_
The Scenery read from or written to Factory::doc_.
Definition: GyotoFactory.h:144
std::string kind_
Kind of root element (Scenery, Metric etc.)
Definition: GyotoFactory.h:160
Factory(SmartPointer< Astrobj::Generic > ao)
Constructor for saving (or printing) an Astrobj.
Factory(SmartPointer< Photon > photon)
Constructor for saving (or printing) a Photon.
xercesc::DOMImplementation * impl_
Xerces implementation.
Definition: GyotoFactory.h:131
void metric(SmartPointer< Metric::Generic > gg, xercesc::DOMElement *el)
Set Metric for this document.
Factory(SmartPointer< Metric::Generic > gg)
Constructor for saving (or printing) a Metric.
xercesc::ErrorHandler * reporter_
Xerces error handler.
Definition: GyotoFactory.h:121
xercesc::DOMElement * ph_el_
XML element representing the Photon.
Definition: GyotoFactory.h:140
void screen(SmartPointer< Screen > scr, xercesc::DOMElement *el)
Set Screen for this document.
xercesc::DOMElement * getRoot()
Get Factory::root_.
void write(const char *const fname=0)
Write constructed XML representation to file.
SmartPointer< Photon > photon_
The Photon read from or written to Factory::doc_.
Definition: GyotoFactory.h:152
xercesc::DOMXPathNSResolver * resolver_
Xerces resolver.
Definition: GyotoFactory.h:129
xercesc::DOMElement * root_
Root element in Factory::doc_.
Definition: GyotoFactory.h:125
Gyoto::SmartPointer< Gyoto::Scenery > scenery()
Find Scenery element, instantiate it and get it.
SmartPointer< Spectrometer::Generic > spectro_
The Spectrometer read from or written to Factory::doc_.
Definition: GyotoFactory.h:154
Factory(SmartPointer< Spectrometer::Generic > Spectrometer)
Constructor for saving (or printing) a Spectrometer.
void setParameter(std::string name, double value, xercesc::DOMElement *pel)
Create new XML element with double value.
Gyoto::SmartPointer< Gyoto::Photon > photon()
Find Photon element, instantiate it and get it.
SmartPointer< Astrobj::Generic > obj_
The Astrobj read from or written to Factory::doc_.
Definition: GyotoFactory.h:150
void astrobj(SmartPointer< Astrobj::Generic > ao, xercesc::DOMElement *el)
Set Astrobj for this document.
Gyoto::SmartPointer< Gyoto::Spectrum::Generic > spectrum()
Find Photon element, instantiate it and get it.
Gyoto::SmartPointer< Gyoto::Metric::Generic > metric()
Find Metric element, instantiate it and get it.
void setReporter(xercesc::ErrorHandler *)
Set Xerces reporter.
xercesc::DOMElement * obj_el_
XML element representing the Astrobj.
Definition: GyotoFactory.h:138
void setParameter(std::string name, unsigned long value, xercesc::DOMElement *pel)
Create new XML element with integer value.
void setParameter(std::string name, int value, xercesc::DOMElement *pel)
Create new XML element with integer value.
void setParameter(std::string name, xercesc::DOMElement *pel)
Create new XML element without content.
Factory / SmartPointee::Subcontractor_t interface.
Definition: GyotoFactoryMessenger.h:92
Pointers performing reference counting.
Definition: GyotoSmartPointer.h:135
Namespace for the Gyoto library.
Definition: GyotoAstrobj.h:43