Gyoto
GyotoRegister.h
Go to the documentation of this file.
1 /*
2  Copyright 2011-2015 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 {
44  namespace Register {
45 
46  /* Documented below */
47  class Entry;
48 
61  void init( char const * pluglist = NULL );
62 
66  void list();
67  }
68 
83  void loadPlugin( char const * const plugname, int nofail = 0);
84 }
85 
96  friend void Gyoto::Register::list();
97 protected:
98  std::string name_;
104 public:
108  Entry(std::string name,
110  Entry* next);
111  ~Entry();
112 
125  getSubcontractor(std::string name, int errmode=0);
126 };
127 
128 #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:98
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:102
Namespace for the Gyoto library.
Definition: GyotoAstrobj.h:43
~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:100
Entry in a register (or a full register)
Definition: GyotoRegister.h:92