metric_extractor_t Struct Reference |
Public Types | |
enum | array_index_t { index_left, index_top, index_right, index_bottom, index_width, index_height } |
Public Member Functions | |
bool | empty () const |
metric_extractor_t (const dictionary_t &dictionary=dictionary_t()) | |
long | operator() (const name_t &tag) const |
long | operator() (const name_t &tag, array_index_t index) const |
metric_extractor_t & | operator= (const metric_extractor_t &x) |
Friends | |
bool | operator== (const metric_extractor_t &x, const metric_extractor_t &y) |
Detailed Description
metric_extractor_t is a struct that allows for easy access to the metrics found in a parsed and evaluated xstr definition from the mac metrics library. See Mac Widget Metrics for more information on the dictionary format describing the metrics for a given widget.
Definition at line 129 of file macintosh_metric_extractor.hpp.
Member Enumeration Documentation
enum array_index_t |
indices used to access elements for a compound (array-based) metric
- Enumerator:
index_left first element
index_top second element
index_right third element
index_bottom fourth element
index_width same as index_left
index_height same as index_top
Definition at line 132 of file macintosh_metric_extractor.hpp.
Constructor & Destructor Documentation
metric_extractor_t | ( | const dictionary_t & | dictionary = dictionary_t() ) |
[explicit] |
- Parameters:
-
dictionary the dictionary containing the widget metrics. Internally the dictionary is stored by value.
Definition at line 150 of file macintosh_metric_extractor.hpp.
Member Function Documentation
bool empty | ( | ) | const |
If this extractor hasn't been setup yet or has no metrics stored within, then this function returns true, otherwise it returns false.
- Returns:
- does this extractor have metrics available
Definition at line 190 of file macintosh_metric_extractor.hpp.
long operator() | ( | const name_t & | tag, |
array_index_t | index | ||
) | const |
Obtains a singleton metric from a compound (array-based) metric
- Parameters:
-
tag the name of the metric we are interested in getting index the index inside the compound metric to fetch
- Returns:
- the value of the metric; 0 if the metric does not exist
Definition at line 173 of file macintosh_metric_extractor.hpp.
long operator() | ( | const name_t & | tag ) | const |
Obtains a singleton metric
- Parameters:
-
tag the name of the metric we are interested in getting
- Returns:
- the value of the metric; 0 if the metric does not exist
Definition at line 157 of file macintosh_metric_extractor.hpp.
metric_extractor_t& operator= | ( | const metric_extractor_t & | x ) |
Definition at line 195 of file macintosh_metric_extractor.hpp.
Friends And Related Function Documentation
bool operator== | ( | const metric_extractor_t & | x, |
const metric_extractor_t & | y | ||
) | [friend] |
Definition at line 192 of file macintosh_metric_extractor.hpp.