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

ArithmeticAttribute< lType, rType, resType > Class Template Reference

Attribute to compute an arithmetic function involving other attributes and/or constant values. More...

#include <ArithmeticAttribute.h>

Inheritance diagram for ArithmeticAttribute< lType, rType, resType >:

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

Public Member Functions

 ArithmeticAttribute (std::string left, std::string right, uint8_t op)
 ArithmeticAttribute (lType left, std::string right, uint8_t op)
 ArithmeticAttribute (std::string left, rType right, uint8_t op)
 ArithmeticAttribute (const PacketFilter &filter, std::string left, std::string right, uint8_t op)
 ArithmeticAttribute (const PacketFilter &filter, lType left, std::string right, uint8_t op)
 ArithmeticAttribute (const PacketFilter &filter, std::string left, rType right, uint8_t op)
 ArithmeticAttribute (const ArithmeticAttribute &toCopy)
virtual ArithmeticAttributeclone (void) const
virtual ArithmeticAttributeoperator= (const ArithmeticAttribute< lType, rType, resType > &rhs)
virtual void handlePassedPacket (TraceIterator &packet)
 Notify the attribute of a new packet to be included in the computation.
virtual void linkToAggregate (Aggregate &parent)
virtual void compute (void) throw ( InvalidDataTypeException )
 Compute the value of the attribute.
virtual resType getValue (void) const
 get the value of the primary attribute
 ScalarAttribute (void)
 ScalarAttribute (const ScalarAttribute< resType > &toCopy)
 ScalarAttribute (const PacketFilter &filter)
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 reset (void) throw ( NotResettableException )
 Reset the value of the attribute.
virtual void handlePacket (TraceIterator &newPkt)

Static Public Attributes

static const uint8_t OP_ADD = 1
static const uint8_t OP_SUBTRACT = 2
static const uint8_t OP_MULTIPLY = 3
static const uint8_t OP_DIVIDE = 4
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 lType, class rType, class resType>
class ArithmeticAttribute< lType, rType, resType >

Attribute to compute an arithmetic function involving other attributes and/or constant values.
Examples:

profile_streams_thesis.cc.


Member Function Documentation

template<class lType, class rType, class resType>
void ArithmeticAttribute< lType, rType, resType >::compute void   )  throw ( InvalidDataTypeException ) [virtual]
 

Compute the value of the attribute.

Used to update an offline attribute.

Reimplemented from Attribute.

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 lType, class rType, class resType>
void ArithmeticAttribute< lType, rType, resType >::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.

template<class lType, class rType, class resType>
void ArithmeticAttribute< lType, rType, resType >::linkToAggregate Aggregate parent  )  [virtual]
 

Todo:
  • verify that the attributes exist and are scalar

Reimplemented from Attribute.

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