Gyoto
|
Spectrum of a simple object (e.g. a Gyoto::Astrobj::Star) More...
Classes | |
class | BlackBody |
Black Body. More... | |
class | Generic |
Spectrum emitted by an Astrobj. More... | |
class | KappaDistributionSynchrotron |
Kappa-distribution synchrotron spectrum from Pandya et al. (2016) More... | |
class | PowerLaw |
I_nu=constant_*nu^exponent_. More... | |
class | PowerLawSynchrotron |
Powerlaw synchrotron spectrum. More... | |
class | Python |
Loader for Python classes implementing the Spectrum interface. More... | |
class | ThermalBremsstrahlung |
Thermal brems spectrum. More... | |
class | ThermalSynchrotron |
Thermal synchrotron spectrum. More... | |
Typedefs | |
typedef Gyoto::SmartPointer< Gyoto::Spectrum::Generic > | Subcontractor_t(Gyoto::FactoryMessenger *fmp, std::vector< std::string > const &) |
A function to build instances of a specific Spectrum::Generic sub-class. More... | |
Functions | |
template<typename T > | |
SmartPointer< Spectrum::Generic > | Subcontractor (FactoryMessenger *fmp, std::vector< std::string > const &plugins) |
Subcontractor template. More... | |
void | Register (std::string kind, Gyoto::Spectrum::Subcontractor_t *scp) |
Make a Spectrum kind known to the Factory. More... | |
Gyoto::Spectrum::Subcontractor_t * | getSubcontractor (std::string name, std::vector< std::string > &plugins, int errmode=0) |
Query the Spectrum register. More... | |
void | initRegister () |
Empty the Spectrum register. More... | |
Variables | |
Register::Entry * | Register_ |
The Spectrum register. More... | |
Spectrum of a simple object (e.g. a Gyoto::Astrobj::Star)
typedef Gyoto::SmartPointer<Gyoto::Spectrum::Generic> Gyoto::Spectrum::Subcontractor_t(Gyoto::FactoryMessenger *fmp, std::vector< std::string > const &) |
A function to build instances of a specific Spectrum::Generic sub-class.
This is a more specific version of the SmartPointee::Subcontractor_t type. A Spectrum::Subcontrator_t is called by the Gyoto::Factory to build an instance of the kind of spectrum specified in an XML file (see Register()). The Factory and Subcontractor_t function communicate through a Gyoto::FactoryMessenger. A template is provided so that you may not have to code anything.
Gyoto::Spectrum::Subcontractor_t* Gyoto::Spectrum::getSubcontractor | ( | std::string | name, |
std::vector< std::string > & | plugins, | ||
int | errmode = 0 |
||
) |
Query the Spectrum register.
Query the Spectrum register to get the Metric::Subcontractor_t correspondig to a given kind name. This function is normally called only from the Factory. If plugin is specified, only a subcontractor matching both name and plugin will be returned, loading the plug-in if necessary. If plugin is the empty string, then the first subcontractor matching name will be returned, and the name of the plug-in it belongs to will be returned in plugin upon output.
[in] | name | e.g. "PowerLaw" |
[in,out] | plugin | e.g. "stdplug". |
[in] | errmode | int=0. If errmode==0, failure to find a registered Spectrum by that name is an error. Else, simply return NULL pointer in that case. |
void Gyoto::Spectrum::initRegister | ( | ) |
Empty the Spectrum register.
This must be called once. It is called by Gyoto::Register::init().
void Gyoto::Spectrum::Register | ( | std::string | kind, |
Gyoto::Spectrum::Subcontractor_t * | scp | ||
) |
Make a Spectrum kind known to the Factory.
Register a new Spectrum::Generic sub-class so that the Gyoto::Factory knows it.
kind | The kind name which identifies this object type in an XML file, as in <Spectrum kind="name"> |
scp | A pointer to the subcontractor, which will communicate with the Gyoto::Factory to build an instance of the class from its XML description |
SmartPointer<Spectrum::Generic> Gyoto::Spectrum::Subcontractor | ( | FactoryMessenger * | fmp, |
std::vector< std::string > const & | plugins | ||
) |
Subcontractor template.
Instead of reimplementing the wheel, your subcontractor can simply be Gyoto::Spectrum::Subcontractor<MyKind>
T | Sub-class of Spectrum::Generic |
Register::Entry* Gyoto::Spectrum::Register_ |
The Spectrum register.
Use the Spectrum::initRegister() once in your program to initiliaze it, the Spectrum::Register() function to fill it, and the Spectrum::getSubcontractor() function to query it.