Gyoto
Public Member Functions | Protected Attributes | Friends | List of all members
Gyoto::Register::Entry Class Reference

Entry in a register (or a full register) More...

#include <GyotoRegister.h>

Public Member Functions

 Entry (std::string name, Gyoto::SmartPointee::Subcontractor_t *subcontractor, Entry *next)
 Constructor.
 
 ~Entry ()
 Destructor.
 
Gyoto::SmartPointee::Subcontractor_tgetSubcontractor (std::string name, std::string &plugin, int errmode=0)
 Get subcontractor for a given name. More...
 

Protected Attributes

std::string name_
 Kind name for the entry, as found in the "kind" XML attribute.
 
Gyoto::SmartPointee::Subcontractor_tsubcontractor_
 Pointer to the Gyoto::SmartPointee::Subcontractor_t function that produces an object of this kind.
 
Register::Entrynext_
 Next entry in the register, or NULL.
 
const std::string plugin_
 Plug-in from which this Entry was loaded.
 

Friends

void Gyoto::Register::list ()
 List the various registers.
 

Detailed Description

Entry in a register (or a full register)

A register is actually a chained list of Register::Entry instances.

Member Function Documentation

◆ getSubcontractor()

Gyoto::SmartPointee::Subcontractor_t* Gyoto::Register::Entry::getSubcontractor ( std::string  name,
std::string &  plugin,
int  errmode = 0 
)

Get subcontractor for a given name.

Search through the register for an Entry matching name and return the corresponding subcontractor. If plugin is specified, only a subcontractor matching both name and plugin will be returned. Note that Gyoto::Entry::getSubcontractor() will not load the plug-in for you, contrary to e.g. Gyoto::Metric::getSubcontractor(). 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.

Parameters
[in]nameName of the kind to look for.
[in,out]plugine.g. "stdplug".
[in]errmode1 if getSubContractor() should return NULL upon failure. Else a Gyoto::Error is thrown.
Returns
Pointer to subcontractor function.

The documentation for this class was generated from the following file: