Gyoto
GyotoFactoryMessenger.h
1 #ifdef GYOTO_USE_XERCES
2 /*
3  Copyright 2011 Thibaut Paumard
4 
5  This file is part of Gyoto.
6 
7  Gyoto is free software: you can redistribute it and/or modify
8  it under the terms of the GNU General Public License as published by
9  the Free Software Foundation, either version 3 of the License, or
10  (at your option) any later version.
11 
12  Gyoto is distributed in the hope that it will be useful,
13  but WITHOUT ANY WARRANTY; without even the implied warranty of
14  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  GNU General Public License for more details.
16 
17  You should have received a copy of the GNU General Public License
18  along with Gyoto. If not, see <http://www.gnu.org/licenses/>.
19  */
20 
21 #ifndef __GyotoFactoryMessenger_H_
22 #define __GyotoFactoryMessenger_H_
23 
24 
25 #ifndef XERCES_INCLUDE_WCHAR_H
26 #define XERCES_INCLUDE_WCHAR_H 0
27 #endif
28 #include <xercesc/dom/DOMElement.hpp>
29 #include <string>
30 #include <GyotoDefs.h>
31 #include <GyotoSmartPointer.h>
32 
33 namespace Gyoto {
34  class Factory;
35  class FactoryMessenger;
36  namespace Metric { class Generic; }
37  namespace Astrobj { class Generic; }
38  namespace Spectrum { class Generic ; }
39  class Screen;
40  class Photon;
41 }
42 
84  private:
87  xercesc::DOMElement *element_;
89  xercesc::DOMNodeList* children_;
91  XMLSize_t nodeCount_;
93  XMLSize_t curNodeIndex_;
95  public:
96  FactoryMessenger(Gyoto::Factory*, xercesc::DOMElement*);
98  FactoryMessenger(const FactoryMessenger& parent, std::string) ;
100 
101  void reset();
103 
105 
115 
125 
135 
145 
159  int getNextParameter(std::string* name, std::string* content);
161 
173  std::string getSelfAttribute(std::string attrname) const ;
175 
185  std::string getAttribute(std::string attrname) const ;
187 
201  std::string getFullContent() const ;
203 
222  FactoryMessenger * getChild() const ;
224 
225 
238  std::string fullPath(std::string relpath) ;
240 
241 
243 
271 
277 
283 
284 
295  void setParameter(std::string name);
297 
305  void setParameter(std::string name, double value);
307 
315  void setParameter(std::string name, long int value);
317 
325  void setParameter(std::string name, unsigned int value);
327 
335  void setParameter(std::string name, unsigned long value);
337 
345  void setParameter(std::string name, int value);
347 
354  void setParameter(std::string name, std::string value);
356 
380  void setParameter(std::string name, double val[], size_t n,
381  FactoryMessenger** child= NULL);
383 
384 
396  void setSelfAttribute(std::string attrname, std::string value) ;
398 
402  void setSelfAttribute(std::string attrname, unsigned long value) ;
404 
408  void setSelfAttribute(std::string attrname, unsigned int value) ;
410 
414  void setSelfAttribute(std::string attrname, double value) ;
416 
424  void setFullContent(std::string value) ;
426 
445  FactoryMessenger* makeChild(std::string name);
447 
448 };
449 
450 #endif
451 #endif