Gyoto registers.
More...
#include <string>
#include "GyotoSmartPointer.h"
Go to the source code of this file.
Gyoto registers.
Gyoto::Register::Entry instances are used to map kind names to Gyoto::SmartPointee::Subcontractor_t functions used to instantiate objects from XML files through the Gyoto::Factory.
◆ GYOTO_GETSUBCONTRACTOR
#define GYOTO_GETSUBCONTRACTOR |
( |
|
space | ) |
|
Value:
for (size_t i=0; i<plugin.size(); ++i) { \
GYOTO_DEBUG_EXPR(plugin[i]);
\
} \
Subcontractor_t* sctr= NULL; \
std::string plg(""); \
if (!plugin.size()) { \
sctr = \
plugin.push_back(plg); \
} \
for (size_t i=plugin.size()-1; i>=0 && sctr == NULL; --i) { \
sctr= \
} \
if (!errmode && !sctr)
throwError (
"Kind not found in the specified plug-ins: "+name); \
return sctr; \
}
#define GYOTO_STRINGIFY(a)
Stringify macro content.
Definition: GyotoDefs.h:566
SmartPointer< Gyoto::Astrobj::Generic > Subcontractor_t(Gyoto::FactoryMessenger *, std::vector< std::string > const &)
A function to build instances of a specific Astrobj::Generic sub-class.
Definition: GyotoAstrobj.h:62
Gyoto::Astrobj::Subcontractor_t * getSubcontractor(std::string name, std::vector< std::string > &plugin, int errmode=0)
Query the Astrobj register.
Gyoto::Register::Entry * Register_
The Astrobj register.
void requirePlugin(std::string plugname, int nofail=0)
Load a plugin by name, only if not loaded yet.
void throwError(std::string)
Throw a Gyoto::Error.