#include <MemoryAttribute.h>
Inheritance diagram for MemoryAttribute< T >:
Public Member Functions | |
MemoryAttribute (const PacketFilter &filter, const std::string &ident, uint32_t aType, uint32_t memSize=0, bool scroll=true) | |
create a new MemoryAttribute | |
MemoryAttribute (const std::string &ident, uint32_t aType, uint32_t memSize=0, bool scroll=true) | |
MemoryAttribute (const PacketFilter &filter, const std::string &ident, uint32_t aType, const Timeval &memSize, bool scroll=true) | |
create a new MemoryAttribute that acts as a time-based window | |
MemoryAttribute (const std::string &ident, uint32_t aType, const Timeval &memSize, bool scroll=true) | |
MemoryAttribute (const MemoryAttribute< T > &toCopy) | |
virtual MemoryAttribute< T > * | clone (void) const =0 |
virtual void | handlePassedPacket (TraceIterator &packet)=0 |
Notify the attribute of a new packet to be included in the computation. | |
virtual void | update (void)=0 |
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 >::const_iterator | end (void) const |
get a const iterator pointing to the last (newest) 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 >::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) |
MemoryAttribute has several functions:
Iterators into a MemoryAttribute iterate over a copy of the queue that is created when begin() or end() are called, and may be invalidated if handlePassedPacket() or update() are called.
|
create a new MemoryAttribute
|
|
create a new MemoryAttribute that acts as a time-based window
|
|
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) Reimplemented from Attribute. Implemented in PacketDrivenMemoryAttribute< T >, and SampledMemoryAttribute< 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 >. |
|
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 |