Gyoto
GyotoRegister.h
Go to the documentation of this file.
1 /*
2  Copyright 2011, 2013 Thibaut Paumard
3 
4  This file is part of Gyoto.
5 
6  Gyoto is free software: you can redistribute it and/or modify
7  it under the terms of the GNU General Public License as published by
8  the Free Software Foundation, either version 3 of the License, or
9  (at your option) any later version.
10 
11  Gyoto is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  GNU General Public License for more details.
15 
16  You should have received a copy of the GNU General Public License
17  along with Gyoto. If not, see <http://www.gnu.org/licenses/>.
18  */
19 
20 #ifndef __GyotoRegister_H_
21 #define __GyotoRegister_H_
22 
23 #include <string>
24 #include "GyotoSmartPointer.h"
25 
35 namespace Gyoto {
36 #ifdef GYOTO_USE_XERCES
37 
45  namespace Register {
46 
47  /* Documented below */
48  class Entry;
49 
62  void init( char const * pluglist = NULL );
63 
67  void list();
68  }
69 #endif
70 
85  void loadPlugin( char const * const plugname, int nofail = 0);
86 }
87 
88 #ifdef GYOTO_USE_XERCES
89 
99  friend void Gyoto::Register::list();
100 protected:
101  std::string name_;
107 public:
111  Entry(std::string name,
113  Entry* next);
114  ~Entry();
115 
128  getSubcontractor(std::string name, int errmode=0);
129 };
130 
131 #endif
132 #endif
Entry(std::string name, Gyoto::SmartPointee::Subcontractor_t *subcontractor, Entry *next)
Constructor.
std::string name_
Kind name for the entry, as found in the "kind" XML attribute.
Definition: GyotoRegister.h:101
Reference-counting pointers.
void Register(std::string name, Gyoto::Astrobj::Subcontractor_t *scp)
Make an Astrobj kind known to the Factory.
Gyoto::SmartPointee::Subcontractor_t * getSubcontractor(std::string name, int errmode=0)
Get subcontractor for a given name.
void init(char const *pluglist=NULL)
Initialise the various registers.
Gyoto::SmartPointer< Gyoto::SmartPointee > Subcontractor_t(Gyoto::FactoryMessenger *)
A subcontractor builds an object upon order from the Factory.
Definition: GyotoSmartPointer.h:112
void list()
List the various registers.
void loadPlugin(char const *const plugname, int nofail=0)
Load a plugin by name.
Register::Entry * next_
Next entry in the register, or NULL.
Definition: GyotoRegister.h:105
~Entry()
Destructor.
Gyoto::SmartPointee::Subcontractor_t * subcontractor_
Pointer to the Gyoto::SmartPointee::Subcontractor_t function that produces an object of this kind...
Definition: GyotoRegister.h:103
Entry in a register (or a full register)
Definition: GyotoRegister.h:95