5 #ifdef GYOTO_USE_XERCES
25 #ifndef __GyotoFactoryMessenger_H_
26 #define __GyotoFactoryMessenger_H_
33 #ifndef XERCES_INCLUDE_WCHAR_H
34 #define XERCES_INCLUDE_WCHAR_H 0
36 #include <xercesc/dom/DOMElement.hpp>
44 class FactoryMessenger;
45 namespace Metric {
class Generic; }
46 namespace Astrobj {
class Generic; }
47 namespace Spectrum {
class Generic ; }
92 class Gyoto::FactoryMessenger {
94 Gyoto::Factory* employer_;
96 xercesc::DOMElement *element_;
98 xercesc::DOMNodeList* children_;
100 XMLSize_t nodeCount_;
102 XMLSize_t curNodeIndex_;
105 FactoryMessenger(Gyoto::Factory*, xercesc::DOMElement*);
107 FactoryMessenger(
const FactoryMessenger& parent, std::string) ;
122 SmartPointer<Metric::Generic> metric () ;
132 SmartPointer<Screen> screen () ;
142 SmartPointer<Photon> getPhoton () ;
152 SmartPointer<Astrobj::Generic> astrobj () ;
169 int getNextParameter(std::string* name,
170 std::string* content,
171 std::string* unit=NULL);
185 std::string getSelfAttribute(std::string attrname)
const ;
197 std::string getAttribute(std::string attrname)
const ;
213 std::string getFullContent()
const ;
234 FactoryMessenger * getChild()
const ;
250 std::string fullPath(std::string relpath) ;
281 void metric(SmartPointer<Metric::Generic>);
287 void astrobj(SmartPointer<Astrobj::Generic>);
293 void screen(SmartPointer<Screen>);
307 void setParameter(std::string name);
317 void setParameter(std::string name,
double value);
327 void setParameter(std::string name,
long int value);
337 void setParameter(std::string name,
unsigned int value);
347 void setParameter(std::string name,
unsigned long value);
357 void setParameter(std::string name,
int value);
366 void setParameter(std::string name, std::string value);
392 void setParameter(std::string name,
double val[],
size_t n,
393 FactoryMessenger** child= NULL);
396 void setParameter(std::string name, std::vector<double>
const &val,
397 FactoryMessenger** child= NULL);
398 void setParameter(std::string name, std::vector<unsigned long>
const &val,
399 FactoryMessenger** child= NULL);
413 void setSelfAttribute(std::string attrname, std::string value) ;
419 void setSelfAttribute(std::string attrname,
unsigned long value) ;
425 void setSelfAttribute(std::string attrname,
unsigned int value) ;
431 void setSelfAttribute(std::string attrname,
double value) ;
441 void setFullContent(std::string value) ;
462 FactoryMessenger* makeChild(std::string name);
473 static size_t parseArray(std::string src,
double dst[],
size_t max_tokens);
481 static std::vector<double> parseArray(std::string src);
489 static std::vector<unsigned long> parseArrayULong(std::string src);
Reference-counting pointers.
Gyoto ubiquitous macros and typedefs.
Namespace for the Gyoto library.
Definition: GyotoAstrobj.h:43