1 #ifdef GYOTO_USE_XERCES
29 #ifndef __GyotoFactory_H_
30 #define __GyotoFactory_H_
39 #ifndef XERCES_INCLUDE_WCHAR_H
40 #define XERCES_INCLUDE_WCHAR_H 0
43 #include <xercesc/sax/ErrorHandler.hpp>
44 #include <xercesc/dom/DOM.hpp>
45 #include <xercesc/parsers/XercesDOMParser.hpp>
54 class FactoryMessenger;
55 namespace Spectrometer {
186 xercesc::DOMElement *
getRoot();
188 xercesc::DOMDocument*
getDoc();
245 void write(
const char*
const fname=0);
276 void setContent(std::string content, xercesc::DOMElement *el);
287 void setParameter(std::string name, xercesc::DOMElement *pel);
300 xercesc::DOMElement *pel);
313 xercesc::DOMElement *pel);
326 xercesc::DOMElement *pel);
339 xercesc::DOMElement *pel);
351 void setParameter(std::string name,
unsigned long value,
352 xercesc::DOMElement *pel);
368 xercesc::DOMElement*pel);
383 void setParameter(std::string name,
double val[],
size_t nelem,
384 xercesc::DOMElement* pel,
392 std::string
fullPath(std::string relpath);
xercesc::DOMImplementation * impl_
Xerces implementation.
Definition: GyotoFactory.h:129
Gyoto::SmartPointer< Gyoto::Scenery > getScenery()
Find Scenery element, instanciate it and get it.
std::string filename_
XML file name, if actually reading from or writting to file.
Definition: GyotoFactory.h:156
std::string format()
Get constructed XML representation as std::string.
SmartPointer< Screen > screen_
The Screen read from or written to Factory::doc_.
Definition: GyotoFactory.h:146
Factory(char *filename)
Constructor for reading a file.
void setParameter(std::string name, xercesc::DOMElement *pel)
Create new XML element without content.
void setAstrobj(SmartPointer< Astrobj::Generic > ao, xercesc::DOMElement *el)
Set Astrobj for this document.
void setScreen(SmartPointer< Screen > scr, xercesc::DOMElement *el)
Set Screen for this document.
SmartPointer< Photon > photon_
The Photon read from or written to Factory::doc_.
Definition: GyotoFactory.h:150
Factory / SmartPointee::Subcontractor_t interface.
Definition: GyotoFactoryMessenger.h:91
xercesc::DOMXPathNSResolver * resolver_
Xerces resolver.
Definition: GyotoFactory.h:127
std::string fullPath(std::string relpath)
Transform relative path into absolute path.
std::string kind_
Kind of root element (Scenery, Metric etc.)
Definition: GyotoFactory.h:158
xercesc::XercesDOMParser * parser_
Xerces parser.
Definition: GyotoFactory.h:125
xercesc::DOMDocument * doc_
The document being read or written.
Definition: GyotoFactory.h:121
void setReporter(xercesc::ErrorHandler *)
Set Xerces reporter.
Compile-time configuration.
xercesc::DOMElement * obj_el_
XML element representing the Astrobj.
Definition: GyotoFactory.h:136
Gyoto::SmartPointer< Gyoto::Astrobj::Generic > getAstrobj()
Find Astrobj element, instanciate it and get it.
xercesc::DOMElement * ph_el_
XML element representing the Photon.
Definition: GyotoFactory.h:138
Gyoto::SmartPointer< Gyoto::Screen > getScreen()
Find Screen element, instanciate it and get it.
xercesc::DOMElement * getRoot()
Get Factory::root_.
Gyoto::SmartPointer< Gyoto::Spectrum::Generic > getSpectrum()
Find Photon element, instanciate it and get it.
Spectrum of a simple object (e.g. Star)
xercesc::DOMElement * root_
Root element in Factory::doc_.
Definition: GyotoFactory.h:123
SmartPointer< Metric::Generic > gg_
The Metric read from or written to Factory::doc_.
Definition: GyotoFactory.h:144
Gyoto::SmartPointer< Gyoto::Metric::Generic > getMetric()
Find Metric element, instanciate it and get it.
Pointers performing reference counting.
Definition: GyotoSmartPointer.h:51
SmartPointer< Astrobj::Generic > obj_
The Astrobj read from or written to Factory::doc_.
Definition: GyotoFactory.h:148
void setMetric(SmartPointer< Metric::Generic > gg, xercesc::DOMElement *el)
Set Metric for this document.
xercesc::ErrorHandler * reporter_
Xerces error handler.
Definition: GyotoFactory.h:119
SmartPointer< Spectrometer::Generic > spectro_
The Spectrometer read from or written to Factory::doc_.
Definition: GyotoFactory.h:152
Gyoto::SmartPointer< Gyoto::Spectrometer::Generic > getSpectrometer()
Find Spectrometer element, instanciate it and get it.
XML input/output.
Definition: GyotoFactory.h:112
Gyoto::SmartPointer< Gyoto::Photon > getPhoton()
Find Photon element, instanciate it and get it.
xercesc::DOMDocument * getDoc()
Get Factory::doc_.
SmartPointer< Scenery > scenery_
The Scenery read from or written to Factory::doc_.
Definition: GyotoFactory.h:142
xercesc::DOMElement * gg_el_
XML element representing the Metric.
Definition: GyotoFactory.h:134
const std::string getKind()
Get Factory::kind_.
void write(const char *const fname=0)
Write constructed XML representation to file.
void setContent(std::string content, xercesc::DOMElement *el)
Set text content of XML element.