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

Attribute Class Reference
[Attributes]

Base class for representing data attributes of packet aggregates. More...

#include <Attribute.h>

Inheritance diagram for Attribute:

FilteredPacketListener PacketListener ArrayAttribute< T > AttributeFunction HistogramAttribute< T > ScalarAttribute< T > ScalarAttribute< int > ScalarAttribute< resType > ScalarAttribute< Timeval > SetAttribute List of all members.

Public Member Functions

 Attribute (void)
 create a new Attribute
 Attribute (const PacketFilter &filter)
 create a new Attribute which only considers packets meeting its filter
 Attribute (const Attribute &toCopy)
virtual Attributeclone (void) const
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 handlePassedPacket (TraceIterator &packet)
 Notify the attribute of a new packet to be included in the computation.
virtual void compute (void)
 Compute the value of the attribute.
virtual void reset (void) throw ( NotResettableException )
 Reset the value of the attribute.
virtual std::string toString (void) const
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

Base class for representing data attributes of packet aggregates.

An Attribute is, in very general terms, some information about an aggregation of packets. It could be a scalar value (ScalarAttribute) computed from the packets (count) or from other attributes (mean length), it could be a statistical distribution over a set of values from the packets, it could be a histogram (HistogramAttribute) over the values of the packets (e.g. a histogram over the interpacket delay), and so on.

Note:
When attribute instances are copied (copy ctor, clone method, operator=), the running state of the attribute is not copied; i.e. any information accumulated by the attribute due to calls to handlePassedPacket() etc. are not propagated. The main reason for this is the use of archetype instances - Attribute instances attached to Aggregate instances that exist only to be cloned.


Constructor & Destructor Documentation

Attribute::Attribute const Attribute toCopy  ) 
 

Note:
copied attributes are NOT by default part of the same aggregate as the original!


Member Function Documentation

void Attribute::compute void   )  [virtual]
 

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.

void Attribute::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)

Implements FilteredPacketListener.

Reimplemented in ArithmeticAttribute< lType, rType, resType >, ByteCountAttribute, ConversationTrackerAttribute, DurationAttribute, HistogramAttribute< T >, MemoryAttribute< T >, PacketDrivenMemoryAttribute< T >, SampledMemoryAttribute< T >, PacketCountAttribute, and SumAttribute< T >.

void Attribute::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 in ArithmeticAttribute< lType, rType, resType >, and SumAttribute< T >.

void Attribute::reset void   )  throw ( NotResettableException ) [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 in SumAttribute< T >.


Member Data Documentation

const int Attribute::TYPE_ARRAY = 33 [static]
 

array

const int Attribute::TYPE_DISTRIB = 17 [static]
 

statistical distribution

const int Attribute::TYPE_HISTOGRAM = 25 [static]
 

histogram

const int Attribute::TYPE_SCALAR = 1 [static]
 

single-valued type

const int Attribute::TYPE_SET = 34 [static]
 

set

const int Attribute::TYPE_UNKNOWN = 0 [static]
 

unknown type


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