|
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 Spectrum::Register_. More... | |
| void | initRegister () |
| Empty the Spectrum register 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 Spectrum::Register_.
Query the Spectrum register to get the Spectrum::Subcontractor_t correspondig to a given kind name. This function is normally called only from the Factory. If plugin is not empty, all the plug-ins listed there will be first loaded using Gyoto::requirePlugin(), then a subcontractor matching both name and and one element of plugin will be searched for. If plugin is an empty vector, 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.
This function is defined using the GYOTO_GETSUBCONTRACTOR macro.
| [in] | name | e.g. "PowerLaw" |
| [in,out] | plugin | vector of strings listing plug-ins to look for name in. |
| [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 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.
1.8.14