Main Page | Modules | Class Hierarchy | Class List | Directories | Class Members | Related Pages | Examples

HistogramAttribute< T > Class Template Reference
[Attributes]

Attribute that is a histogram. More...

#include <HistogramAttribute.h>

Inheritance diagram for HistogramAttribute< T >:

Attribute FilteredPacketListener PacketListener List of all members.

Public Member Functions

 HistogramAttribute (const PacketAttribute &f, const T boundaries[], int count, bool finite=false)
 HistogramAttribute (const PacketFilter &filter, const PacketAttribute &f, const T boundaries[], int count, bool finite=false)
 HistogramAttribute (const PacketAttribute &f, const T start, const T end, const T interval, bool finite=false)
 HistogramAttribute (const PacketFilter &filter, const PacketAttribute &f, const T start, const T end, const T interval, bool finite=false)
 HistogramAttribute (const HistogramAttribute< T > &toCopy)
HistogramAttributeoperator= (const HistogramAttribute< T > &rhs)
virtual HistogramAttribute<
T > * 
clone (void) const
virtual void handlePassedPacket (TraceIterator &packet)
 Notify the attribute of a new packet to be included in the computation.
virtual std::string toString (void) const
 Output a string representation of the histogram.
int getType (void)
virtual const AttributegetAttrib (const std::string &ident) const throw ( UnknownAttributeException )
 Get a subattribute of this attribute.
virtual void linkToAggregate (Aggregate &parent)
 Notify the Attribute that it is being linked to a particular aggregate.
virtual void compute (void)
 Compute the value of the attribute.
virtual void reset (void) throw ( NotResettableException )
 Reset the value of the attribute.
virtual void handlePacket (TraceIterator &newPkt)

Static Public Attributes

static const int TYPE_UNKNOWN = 0
static const int TYPE_SCALAR = 1
static const int TYPE_DISTRIB = 17
static const int TYPE_HISTOGRAM = 25
static const int TYPE_ARRAY = 33
static const int TYPE_SET = 34

Protected Attributes

Aggregateaggr
int attribType
bool dirty

Friends

std::ostream & operator<< (std::ostream &os, const Attribute &attrib)

Detailed Description

template<class T>
class HistogramAttribute< T >

Attribute that is a histogram.

Note:
Quietly ignores packets that throw an exception when queried for the focus attribute. This is necessary for frame.time_delta, as the first packet will not have a frame.time_delta, and this is far easier than trying to handle that specific case. However, if the "silently ignore" approach causes other problems, that may need to be rethought; perhaps only ignored for certain focus attributes, though that seems hackish. Could alternately use partial specialization to ignore the exception for HistogramAttribute<Timeval>... but that doesn't seem much better.
Todo:
ctor which takes a Histogram object, so that we can use custom Histogram subclasses transparently.
Examples:

test_harness.cc.


Member Function Documentation

void Attribute::compute void   )  [virtual, inherited]
 

Compute the value of the attribute.

Used to update an offline attribute.

Reimplemented in ArithmeticAttribute< lType, rType, resType >, ByteCountAttribute, DurationAttribute, and SumAttribute< T >.

void FilteredPacketListener::handlePacket TraceIterator newPkt  )  [virtual, inherited]
 

checks the packet against the filter and calls handlePassedPacket if it passes or if the filter is NULL

Implements PacketListener.

template<class T>
void HistogramAttribute< T >::handlePassedPacket TraceIterator packet  )  [virtual]
 

Notify the attribute of a new packet to be included in the computation.

For an online attribute, update the attribute. For an offline attribute, set the dirty bit. (default)

Reimplemented from Attribute.

void Attribute::linkToAggregate Aggregate parent  )  [virtual, inherited]
 

Notify the Attribute that it is being linked to a particular aggregate.

Parameters:
parent New parent aggregate - will supplant any previous parent
Note:
If an Attribute subclass is only intended for use with a particular subtype of aggregate, override this method and add type checking. e.g.: Trace *trace = dynamic_cast<Trace*>(parent); if( NULL != trace ) {...} else throw InvalidAggregateException(...);

Reimplemented in ArithmeticAttribute< lType, rType, resType >, and SumAttribute< T >.

void Attribute::reset void   )  throw ( NotResettableException ) [virtual, inherited]
 

Reset the value of the attribute.

Exceptions:
NotResettableException if the Attribute cannot be properly reset, e.g. if it is a wrapper for a subattribute.

Reimplemented in SumAttribute< T >.


Member Data Documentation

const int Attribute::TYPE_ARRAY = 33 [static, inherited]
 

array

const int Attribute::TYPE_DISTRIB = 17 [static, inherited]
 

statistical distribution

const int Attribute::TYPE_HISTOGRAM = 25 [static, inherited]
 

histogram

const int Attribute::TYPE_SCALAR = 1 [static, inherited]
 

single-valued type

const int Attribute::TYPE_SET = 34 [static, inherited]
 

set

const int Attribute::TYPE_UNKNOWN = 0 [static, inherited]
 

unknown type


The documentation for this class was generated from the following files:
Generated on Thu Apr 5 01:02:37 2007 for ANTARES by  doxygen 1.4.2