SFrame 3.6
|
Helper class for translating between tree type codes and names. More...
#include <core/include/STreeTypeDecoder.h>
Public Member Functions | |
void | AddType (const TString &xmlName, const TString &name, Int_t code) |
Function adding a new type to the dictionary. | |
const TString & | GetName (Int_t code) const |
Get the name belonging to a given code. | |
Int_t | GetCode (const TString &name) const |
Get the code belonging to a given name. | |
const TString & | GetXMLName (Int_t code) const |
Get the XML name belonging to a given code. | |
Int_t | GetXMLCode (const TString &name) const |
Get the code belonging to an XML name. | |
Static Public Member Functions | |
static STreeTypeDecoder * | Instance () |
Function accessing the singleton object instance. |
Helper class for translating between tree type codes and names.
In the new design of handling trees by SFrame, any kind of new type of input and output trees can be defined by the SFrame extension libraries. For instance now the base library doesn't need to know about persistent trees, SFrameARA is able to define those on its own.
The code now uses integer tree types to describe a tree to the framework. The constants declaring these tree types should all be in the STreeType namespace. To make the code able to display information about the known tree types in a nice way, it uses this "decoder" class to know what kind of tree it's handling at the moment.
The class is implemented as a singleton, as really only one such dictionary is needed for the process. The singleton instance knows on its own about the tree types that can be handled by plain SFrame. Extension libraries should use the AddType(...) function to teach new tree types to the dictionary. (For an example see the SFrameARA implementation.)
Definition at line 45 of file STreeTypeDecoder.h.
void STreeTypeDecoder::AddType | ( | const TString & | xmlName, |
const TString & | name, | ||
Int_t | code | ||
) |
Function adding a new type to the dictionary.
Definition at line 30 of file STreeTypeDecoder.cxx.
Int_t STreeTypeDecoder::GetCode | ( | const TString & | name | ) | const |
Get the code belonging to a given name.
Definition at line 52 of file STreeTypeDecoder.cxx.
const TString & STreeTypeDecoder::GetName | ( | Int_t | code | ) | const |
Get the name belonging to a given code.
Definition at line 42 of file STreeTypeDecoder.cxx.
Referenced by SInputData::Print().
Int_t STreeTypeDecoder::GetXMLCode | ( | const TString & | name | ) | const |
Get the code belonging to an XML name.
Definition at line 72 of file STreeTypeDecoder.cxx.
Referenced by SCycleBaseConfig::InitializeInputData().
const TString & STreeTypeDecoder::GetXMLName | ( | Int_t | code | ) | const |
Get the XML name belonging to a given code.
Definition at line 62 of file STreeTypeDecoder.cxx.
Referenced by SInputData::GetStringConfig().
STreeTypeDecoder * STreeTypeDecoder::Instance | ( | ) | [static] |
Function accessing the singleton object instance.
Definition at line 22 of file STreeTypeDecoder.cxx.
Referenced by SInputData::GetStringConfig(), SCycleBaseConfig::InitializeInputData(), and SInputData::Print().