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

SumAttribute< T > Class Template Reference
[Attributes]

Computes a summary of the specified property. More...

#include <SumAttribute.h>

Inheritance diagram for SumAttribute< T >:

ScalarAttribute< T > Attribute FilteredPacketListener PacketListener List of all members.

Public Member Functions

 SumAttribute (const PacketAttribute &attrib) throw ( InvalidDatatypeException )
 SumAttribute (const PacketAttribute &attrib, const PacketFilter &filter) throw ( InvalidDatatypeException )
 SumAttribute (const SumAttribute &toCopy)
virtual SumAttributeclone (void) const
virtual SumAttributeoperator= (const SumAttribute &rhs)
virtual void linkToAggregate (Aggregate &parent)
 Notify the Attribute that it is being linked to a particular aggregate.
virtual void handlePassedPacket (TraceIterator &packet) throw ( ArithmeticOverflowException )
 Notify the attribute of a new packet to be included in the computation.
virtual void compute (void) throw ( ArithmeticOverflowException )
 Compute the value of the attribute.
virtual void reset (void)
 Reset the value of the attribute.
virtual T getValue (void) const throw ( ArithmeticOverflowException )
virtual std::string toString (void) const
 get a string representation of the Attribute
int getType (void)
virtual const AttributegetAttrib (const std::string &ident) const throw ( UnknownAttributeException )
 Get a subattribute of this 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 SumAttribute< T >

Computes a summary of the specified property.


Constructor & Destructor Documentation

template<class T>
SumAttribute< T >::SumAttribute const PacketAttribute attrib  )  throw ( InvalidDatatypeException )
 

Create a new SumAttribute

Parameters:
incHdr include the bytes of the header in the total (default true)
Exceptions:
InvalidDatatypeException if the attribute is not of the correct type


Member Function Documentation

template<class T>
void SumAttribute< T >::compute void   )  throw ( ArithmeticOverflowException ) [virtual]
 

Compute the value of the attribute.

Used to update an offline attribute.

Reimplemented from Attribute.

template<class T>
T SumAttribute< T >::getValue void   )  const throw ( ArithmeticOverflowException ) [virtual]
 

get the value of the attribute

Exceptions:
ArithmeticOverflowException is thrown if the value is too large

Reimplemented from ScalarAttribute< 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 SumAttribute< T >::handlePassedPacket TraceIterator packet  )  throw ( ArithmeticOverflowException ) [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.

template<class T>
void SumAttribute< T >::linkToAggregate Aggregate parent  )  [virtual]
 

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 from Attribute.

template<class T>
void SumAttribute< T >::reset void   )  [virtual]
 

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 from Attribute.


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:38 2007 for ANTARES by  doxygen 1.4.2