LSSTApplications
10.0-2-g4f67435,11.0.rc2+1,11.0.rc2+12,11.0.rc2+3,11.0.rc2+4,11.0.rc2+5,11.0.rc2+6,11.0.rc2+7,11.0.rc2+8
LSSTDataManagementBasePackage
|
Create a component in the verbosity tree (deprecated). More...
#include <Component.h>
Public Types | |
enum | { INHERIT_VERBOSITY = -9999 } |
Public Member Functions | |
Component (const std::string &name=".", int verbosity=INHERIT_VERBOSITY) | |
~Component () | |
void | add (const std::string &name, int verbosity, const std::string &separator) |
int | getVerbosity (const std::string &name, const std::string &separator) |
int | highestVerbosity (int highest=0) |
void | printVerbosity (std::ostream &fp, int depth=0) |
void | setVerbosity (int verbosity) |
Private Types | |
typedef boost::tokenizer < boost::char_separator< char > > | tokenizer |
typedef std::map< const std::string, Component * > | comp_map |
Private Member Functions | |
void | add (tokenizer::iterator token, const tokenizer::iterator end, int verbosity) |
int | getVerbosity (tokenizer::iterator token, const tokenizer::iterator end, int defaultVerbosity) |
Private Attributes | |
std::string * | _name |
int | _verbosity |
comp_map & | _subcomp |
Create a component in the verbosity tree (deprecated).
A name is a string of the form aaa.bbb.ccc, and may itself contain further subcomponents. The Component structure doesn't in fact contain its full name, but only the first part.
The reason for this is inheritance — verbosity is inherited, but may be overriden. For example, if "foo" is at level 2 then "foo.goo.hoo" is taken to be at level 2 unless set specifically – but this inheritance is dynamic (so changing "foo" to 3 changes "foo.goo.hoo" too). However, I may also set "foo.goo.hoo" explicitly, in which case "foo"'s value is irrelevant — but "foo.goo" continues to inherit it.
Definition at line 62 of file Component.h.
|
private |
Definition at line 79 of file Component.h.
|
private |
Definition at line 78 of file Component.h.
anonymous enum |
Component::Component | ( | const std::string & | name = "." , |
int | verbosity = INHERIT_VERBOSITY |
||
) |
Initialize the component structure.
name | component's name |
verbosity | component's verbosity |
Definition at line 45 of file Component.cc.
Component::~Component | ( | ) |
void Component::add | ( | const std::string & | name, |
int | verbosity, | ||
const std::string & | separator | ||
) |
Add a new component to the tree
name | component's name |
verbosity | component's verbosity |
separator | path separator |
Definition at line 62 of file Component.cc.
|
private |
Add a new component to the tree
token | parts of name |
end | end of name |
verbosity | component's verbosity |
Definition at line 83 of file Component.cc.
int Component::getVerbosity | ( | const std::string & | name, |
const std::string & | separator | ||
) |
Return a component's verbosity, from the perspective of "this".
< Return a component's verbosity
< Return a component's verbosity
name | component of interest |
separator | path separator |
Definition at line 179 of file Component.cc.
|
private |
Return a trace verbosity given a name
< Return trace verbosity given name
< Return trace verbosity given name
token | parts of name |
end | end of name |
defaultVerbosity | default verbosity |
Definition at line 146 of file Component.cc.
int Component::highestVerbosity | ( | int | highest = 0 | ) |
Return the highest verbosity rooted at comp
< return highest verbosity rooted at comp
highest | minimum verbosity to return |
Definition at line 129 of file Component.cc.
void Component::printVerbosity | ( | std::ostream & | fp, |
int | depth = 0 |
||
) |
Print all the trace verbosities rooted at "this"
fp | Output stream |
depth | Tree depth to recurse |
Definition at line 198 of file Component.cc.
|
inline |
Definition at line 75 of file Component.h.
|
private |
Definition at line 81 of file Component.h.
|
private |
Definition at line 83 of file Component.h.
|
private |
Definition at line 82 of file Component.h.