Gyoto::Spectrum Namespace Reference

Spectrum of a simple object (e.g. a Gyoto::Astrobj::Star). More...


class  BlackBody
 Black Body. More...
class  PowerLaw
 I_nu=constant_*nu^exponent_. More...
class  Generic
 Spectrum emitted by an Astrobj. More...
class  ThermalBremsstrahlung
 Thermal brems spectrum. More...
class  Python
 Loader for Python classes implementing the Spectrum interface. More...


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.


template<typename T >
SmartPointer< Spectrum::GenericSubcontractor (FactoryMessenger *fmp, std::vector< std::string > const &plugins)
 Subcontractor template.
void Register (std::string kind, Gyoto::Spectrum::Subcontractor_t *scp)
 Make a Spectrum kind known to the Factory.
Gyoto::Spectrum::Subcontractor_tgetSubcontractor (std::string name, std::vector< std::string > &plugins, int errmode=0)
 Query the Spectrum register.
void initRegister ()
 Empty the Spectrum register.


 The Spectrum register.

Detailed Description

Spectrum of a simple object (e.g. a Gyoto::Astrobj::Star).

Typedef Documentation

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.

Function Documentation

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"
inout] 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.
pointer to the corresponding subcontractor.
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
template<typename T >
SmartPointer<Spectrum::Generic> Gyoto::Spectrum::Subcontractor ( FactoryMessenger *  fmp,
std::vector< std::string > const &  plugins 
) [inline]

Subcontractor template.

Instead of reimplementing the wheel, your subcontractor can simply be Gyoto::Spectrum::Subcontractor<MyKind>

Template Parameters:
T Sub-class of Spectrum::Generic

Variable Documentation

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.

Generated on 22 Jul 2017 for Gyoto by  doxygen 1.6.1