stlab.adobe.com Adobe Systems Incorporated

metric_extractor_t Struct Reference
[Widget Library]

Utility class to access widget metrics for the Macintosh. More...

#include <macintosh_metric_extractor.hpp>

List of all members.

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_toperator= (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

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:
dictionarythe 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:
tagthe name of the metric we are interested in getting
indexthe 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:
tagthe 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.

Copyright © 2006-2007 Adobe Systems Incorporated.

Use of this website signifies your agreement to the Terms of Use and Online Privacy Policy.

Search powered by Google