#include <MemoryAttribute.h>
Inheritance diagram for PacketDrivenMemoryAttribute< T >:
Public Member Functions | |
PacketDrivenMemoryAttribute (const std::string &ident, uint32_t aType, uint32_t memSize=0, bool scroll=true) | |
create a PacketDrivenMemoryAttribute | |
PacketDrivenMemoryAttribute (const PacketFilter &filter, const std::string &ident, uint32_t aType, uint32_t memSize=0, bool scroll=true) | |
create a filtered PacketDrivenMemoryAttribute | |
PacketDrivenMemoryAttribute (const std::string &ident, uint32_t aType, const Timeval &window, bool scroll=true) | |
create a PacketDrivenMemoryAttribute that functions as a time window | |
PacketDrivenMemoryAttribute (const PacketFilter &filter, const std::string &ident, uint32_t aType, const Timeval &window, bool scroll=true) | |
create a filtered PacketDrivenMemoryAttribute that functions as a time window | |
PacketDrivenMemoryAttribute (const PacketDrivenMemoryAttribute< T > &toCopy) | |
PacketDrivenMemoryAttribute< T > * | clone (void) const |
virtual void | handlePassedPacket (TraceIterator &packet) |
Notify the attribute of a new packet to be included in the computation. | |
virtual void | update (void) |
update the attribute to the given time | |
virtual T | getInstanceValue (void) const throw ( UnknownAttributeException ) |
get the current value of the attribute to remember | |
virtual T | getInstanceValue (TraceIterator &packet) const throw ( UnknownAttributeException ) |
get the current value of the attribute to remember | |
virtual const Attribute & | getAttrib (const std::string &ident) const throw ( UnknownAttributeException ) |
get an attribute of the attribute | |
virtual T | getSum (void) const throw ( InvalidDataTypeException ) |
get the sum of the elements in the memory if they are of an appropriate data type | |
virtual T | getMax (void) const throw ( InvalidDataTypeException ) |
get the maximum element in the memory if they are of an appropriate data type | |
virtual T | getMin (void) const throw ( InvalidDataTypeException ) |
get the minimum element in the memory if they are of an appropriate data type | |
std::vector< T >::const_iterator | begin (void) const |
get a const iterator pointing to the first (oldest) element of the window | |
std::vector< T >::iterator | begin (void) |
get an iterator pointing to the first (oldest) element of the window | |
std::vector< T >::const_iterator | end (void) const |
get a const iterator pointing to the last (newest) element of the window | |
std::vector< T >::iterator | end (void) |
get an iterator pointing to the last (newest) element of the window | |
int | getType (void) |
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 std::string | toString (void) const |
virtual void | handlePacket (TraceIterator &newPkt) |
Static Public Attributes | |
static const uint32_t | ATTRIB_TYPE_AGGREGATE = 1 |
types of attributes that can be remembered | |
static const uint32_t | ATTRIB_TYPE_PACKET = 2 |
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 Member Functions | |
void | append (const Timeval &time, T val) |
add a value to the end of the queue | |
void | remove (uint32_t count=1) |
remove the n first/earliest values from the queue, defaults to removing the first one | |
void | buildVector (void) const |
build or rebuild the vector copy of q | |
void | prune (void) |
remove values from the queue based on max size or time window | |
uint32_t | size (void) const |
return the number of values in the memory | |
Protected Attributes | |
Aggregate * | aggr |
Friends | |
std::ostream & | operator<< (std::ostream &os, const Attribute &attrib) |
PacketDrivenMemoryAttributes are those which record a value every time a packet arrives; these are generally used to record values extracted from the packets themselves, but could also be used to sample an attribute aggregate value each time a packet arrives.
A PacketDrivenMemoryAttribute has two methods of updating: handlePassedPacket() and update(). handlePassedPacket is invoked at the time one would expect - when those of the other attributes of the same tier as the PacketDrivenMemoryAttribute are called. However, the update() method is called by a Clock (set when the PacketDrivenMemoryAttribute is created), which is likely to be called either only after or only before the Aggregate's callListeners() method is called. It is, however, also called after the body of handlePassedPacket(), so that the attribute is up-to-date after its tier is finished; no guarantees as to what state it's in before then, though.
|
get a const iterator pointing to the first (oldest) element of the window
Implements ArrayAttribute< T >. |
|
build or rebuild the vector copy of q
|
|
Compute the value of the attribute. Used to update an offline attribute. Reimplemented in ArithmeticAttribute< lType, rType, resType >, ByteCountAttribute, DurationAttribute, and SumAttribute< T >. |
|
get an attribute of the attribute
Reimplemented from Attribute. |
|
get the current value of the attribute to remember
|
|
get the maximum element in the memory if they are of an appropriate data type
|
|
get the minimum element in the memory if they are of an appropriate data type
|
|
get the sum of the elements in the memory if they are of an appropriate data type
|
|
checks the packet against the filter and calls handlePassedPacket if it passes or if the filter is NULL Implements PacketListener. |
|
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 MemoryAttribute< T >. |
|
Notify the Attribute that it is being linked to a particular aggregate.
Reimplemented in ArithmeticAttribute< lType, rType, resType >, and SumAttribute< T >. |
|
Reset the value of the attribute.
Reimplemented in SumAttribute< T >. |
|
update the attribute to the given time
Implements MemoryAttribute< T >. |
|
types of attributes that can be remembered Specifically these indicate where the MemoryAttribute needs to look to find the identifier. identifier refers to an attribute attached to the aggregate |
|
identifier refers to an attribute of the packets seen |
|
array |
|
statistical distribution |
|
histogram |
|
single-valued type |
|
set |
|
unknown type |