Gyoto
Classes | Typedefs | Functions | Variables
Gyoto::Metric Namespace Reference

Access to metrics. More...

Classes

class  KerrBL
 Metric around a Kerr black-hole in Boyer-Lindquist coordinates. More...
class  KerrKS
 Metric around a Kerr black-hole in Kerr-Schild coordinates. More...
class  Generic
 Base class for metrics. More...
class  RotStar3_1
 Numerical metric around a rotating star in 3+1 formalism. More...

Typedefs

typedef SmartPointer
< Metric::Generic
Subcontractor_t (FactoryMessenger *)
 A function to build instances of a specific Metric::Generic sub-class.

Functions

Gyoto::Metric::Subcontractor_tgetSubcontractor (std::string name)
 Query the Metric register.
void Register (std::string kind, Gyoto::Metric::Subcontractor_t *)
 Make a Metric kind known to the Factory.
void initRegister ()
 Empty the Metric register.

Variables

Register::EntryRegister_
 The Metric register.

Detailed Description

Access to metrics.

Objects which describe space-time geometry must inherit from the Gyoto::Metric::Generic class.

To be usable, a Metric::Generic sub-class should register a Metric::Subcontractor_t function using the Metric::Register() function. See also Writing plug-ins for Gyoto .


Typedef Documentation

typedef SmartPointer<Metric::Generic> Gyoto::Metric::Subcontractor_t(FactoryMessenger *)

A function to build instances of a specific Metric::Generic sub-class.

This is a more specific version of the SmartPointee::Subcontractor_t type. A Metric::Subcontrator_t is called by the Gyoto::Factory to build an instance of the kind of metric specified in an XML file (see Register()). The Factory and Subcontractor_t function communicate through a Gyoto::FactoryMessenger.


Function Documentation

Gyoto::Metric::Subcontractor_t* Gyoto::Metric::getSubcontractor ( std::string  name)

Query the Metric register.

Query the Metric register to get the Metric::Subcontractor_t correspondig to a given kind name. This function is normally called only from the Factory.

Parameters:
namee.g. "KerrBL"
Returns:
pointer to the corresponding subcontractor.
void Gyoto::Metric::initRegister ( )

Empty the Metric register.

This must be called once.

void Gyoto::Metric::Register ( std::string  kind,
Gyoto::Metric::Subcontractor_t  
)

Make a Metric kind known to the Factory.

Register a new Metric::Generic sub-class so that the Gyoto::Factory knows it.

Parameters:
nameThe kind name which identifies this object type in an XML file, as in <Metric kind="name">
scpA pointer to the subcontractor, which will communicate whith the Gyoto::Factory to build an instance of the class from its XML description

Variable Documentation

Register::Entry* Gyoto::Metric::Register_

The Metric register.

Use the Metric::initRegister() once in your program to initiliaze it, the Metric::Register() function to fill it, and the Metric::getSubcontractor() function to query it.