#include <rc_transaction_counter.h>
rc_transaction_counter is used to modify the transaction count of the reconfigurable context. If the transaction count of a rc_reconfigurable instance is greater than zero, it cannot be deactivated due to the pending transactions that have to be finished first.
Transaciont counter can be declared as a member of a reconfigurable module to obtain control over the transaction count. This is often used in combination with interface filters to synchronise reconfiguration.
In constrast to rc_reconfigurable's transaction count, a transaction counter may also count into the negativity. The effective transaction count will be the absolute value of this counter. Only if a transaction counter equals zero the reconfigurable context may be deactivated.
At its instantiation a transaction counter can be declared to be a relay counter. Therefore a list of children counters is specified. If the relay counter is modified it actually only all of its children are modified. For each child a integer valued relay factor can be set, that differs from 1 even may be negative, to weigh the children's modification amount.
Definition at line 74 of file rc_transaction_counter.h.
Public Member Functions | |
rc_transaction_counter () | |
Default constructor. | |
rc_transaction_counter (std::vector< this_type * > &children) | |
Constructor (constructs a relay counter). | |
int | count () const |
Returns the current count. | |
void | modify (int amount) |
Modifies the counter by the given amount. | |
void | reset () |
Reset the counter. | |
~rc_transaction_counter () | |
Destructor. | |
rc_reconfigurable * | get_reconfigurable () const |
Returns the associated reconfigurable context (if exists). | |
int | get_children_count () const |
Returns the number of children. | |
int | get_relay_factor (int index) const |
Returns the relay factor of child of the given index. | |
void | set_relay_factor (int index, int factor) |
Sets the relay factor for the child of the given index. | |
void | set_relay_factor (rc_transaction_counter &child, int factor) |
Sets the relay factor for the given child. | |
const this_type & | operator++ () |
Increase the counter by one. | |
const this_type & | operator-- () |
Decrease the counter by one. | |
const this_type & | operator+= (int amount) |
Increase the counter by a particular amount. | |
const this_type & | operator-= (int amount) |
Decrease the counter by a particular amount. | |
rc_transaction_counter (this_type &tc1, int factor1) | |
Convenience constructor (constructs a relay counter). | |
rc_transaction_counter (this_type &tc1, int factor1, this_type &tc2, int factor2) | |
rc_transaction_counter (this_type &tc1, int factor1, this_type &tc2, int factor2, this_type &tc3, int factor3) | |
rc_transaction_counter (this_type &tc1, int factor1, this_type &tc2, int factor2, this_type &tc3, int factor3, this_type &tc4, int factor4) | |
rc_transaction_counter (this_type &tc1, int factor1, this_type &tc2, int factor2, this_type &tc3, int factor3, this_type &tc4, int factor4, this_type &tc5, int factor5) | |
rc_transaction_counter (this_type &tc1, int factor1, this_type &tc2, int factor2, this_type &tc3, int factor3, this_type &tc4, int factor4, this_type &tc5, int factor5, this_type &tc6, int factor6) | |
rc_transaction_counter (this_type &tc1, int factor1, this_type &tc2, int factor2, this_type &tc3, int factor3, this_type &tc4, int factor4, this_type &tc5, int factor5, this_type &tc6, int factor6, this_type &tc7, int factor7) | |
rc_transaction_counter (this_type &tc1, int factor1, this_type &tc2, int factor2, this_type &tc3, int factor3, this_type &tc4, int factor4, this_type &tc5, int factor5, this_type &tc6, int factor6, this_type &tc7, int factor7, this_type &tc8, int factor8) | |
rc_transaction_counter (this_type &tc1, int factor1, this_type &tc2, int factor2, this_type &tc3, int factor3, this_type &tc4, int factor4, this_type &tc5, int factor5, this_type &tc6, int factor6, this_type &tc7, int factor7, this_type &tc8, int factor8, this_type &tc9, int factor9) | |
rc_transaction_counter (this_type &tc1, int factor1, this_type &tc2, int factor2, this_type &tc3, int factor3, this_type &tc4, int factor4, this_type &tc5, int factor5, this_type &tc6, int factor6, this_type &tc7, int factor7, this_type &tc8, int factor8, this_type &tc9, int factor9, this_type &tc10, int factor10) | |
Private Types | |
typedef rc_transaction_counter | this_type |
Private Member Functions | |
void | _rc_relay (int amount) |
relays a modification to the childs | |
void | _rc_add_child (rc_transaction_counter &child, int factor=1) |
adds a child | |
rc_transaction_counter (const this_type &orig) | |
(disabled) | |
this_type & | operator= (const this_type &orig) |
(disabled) | |
Private Attributes | |
rc_reconfigurable * | p_reconf |
The associated reconfigurable context. | |
int | p_count |
The current transaction number. | |
std::vector < std::pair < this_type *, int > > | p_children |
The children vector. |
typedef rc_transaction_counter this_type [private] |
Definition at line 78 of file rc_transaction_counter.h.
rc_transaction_counter | ( | std::vector< this_type * > & | children | ) | [explicit] |
Constructor (constructs a relay counter).
children | a vector of child transaction counters |
Definition at line 47 of file rc_transaction_counter.cpp.
~rc_transaction_counter | ( | ) | [inline] |
Destructor.
Calls reset() before destruction.
Definition at line 119 of file rc_transaction_counter.h.
rc_transaction_counter | ( | this_type & | tc1, | |
int | factor1 | |||
) | [explicit] |
Convenience constructor (constructs a relay counter).
tc1 | a child counter | |
factor1 | the relay factor of the given child counter |
Definition at line 149 of file rc_transaction_counter.cpp.
rc_transaction_counter | ( | this_type & | tc1, | |
int | factor1, | |||
this_type & | tc2, | |||
int | factor2 | |||
) |
Definition at line 156 of file rc_transaction_counter.cpp.
rc_transaction_counter | ( | this_type & | tc1, | |
int | factor1, | |||
this_type & | tc2, | |||
int | factor2, | |||
this_type & | tc3, | |||
int | factor3 | |||
) |
Definition at line 165 of file rc_transaction_counter.cpp.
rc_transaction_counter | ( | this_type & | tc1, | |
int | factor1, | |||
this_type & | tc2, | |||
int | factor2, | |||
this_type & | tc3, | |||
int | factor3, | |||
this_type & | tc4, | |||
int | factor4 | |||
) |
Definition at line 176 of file rc_transaction_counter.cpp.
rc_transaction_counter | ( | this_type & | tc1, | |
int | factor1, | |||
this_type & | tc2, | |||
int | factor2, | |||
this_type & | tc3, | |||
int | factor3, | |||
this_type & | tc4, | |||
int | factor4, | |||
this_type & | tc5, | |||
int | factor5 | |||
) |
Definition at line 188 of file rc_transaction_counter.cpp.
rc_transaction_counter | ( | this_type & | tc1, | |
int | factor1, | |||
this_type & | tc2, | |||
int | factor2, | |||
this_type & | tc3, | |||
int | factor3, | |||
this_type & | tc4, | |||
int | factor4, | |||
this_type & | tc5, | |||
int | factor5, | |||
this_type & | tc6, | |||
int | factor6 | |||
) |
Definition at line 202 of file rc_transaction_counter.cpp.
rc_transaction_counter | ( | this_type & | tc1, | |
int | factor1, | |||
this_type & | tc2, | |||
int | factor2, | |||
this_type & | tc3, | |||
int | factor3, | |||
this_type & | tc4, | |||
int | factor4, | |||
this_type & | tc5, | |||
int | factor5, | |||
this_type & | tc6, | |||
int | factor6, | |||
this_type & | tc7, | |||
int | factor7 | |||
) |
Definition at line 217 of file rc_transaction_counter.cpp.
rc_transaction_counter | ( | this_type & | tc1, | |
int | factor1, | |||
this_type & | tc2, | |||
int | factor2, | |||
this_type & | tc3, | |||
int | factor3, | |||
this_type & | tc4, | |||
int | factor4, | |||
this_type & | tc5, | |||
int | factor5, | |||
this_type & | tc6, | |||
int | factor6, | |||
this_type & | tc7, | |||
int | factor7, | |||
this_type & | tc8, | |||
int | factor8 | |||
) |
Definition at line 234 of file rc_transaction_counter.cpp.
rc_transaction_counter | ( | this_type & | tc1, | |
int | factor1, | |||
this_type & | tc2, | |||
int | factor2, | |||
this_type & | tc3, | |||
int | factor3, | |||
this_type & | tc4, | |||
int | factor4, | |||
this_type & | tc5, | |||
int | factor5, | |||
this_type & | tc6, | |||
int | factor6, | |||
this_type & | tc7, | |||
int | factor7, | |||
this_type & | tc8, | |||
int | factor8, | |||
this_type & | tc9, | |||
int | factor9 | |||
) |
Definition at line 252 of file rc_transaction_counter.cpp.
rc_transaction_counter | ( | this_type & | tc1, | |
int | factor1, | |||
this_type & | tc2, | |||
int | factor2, | |||
this_type & | tc3, | |||
int | factor3, | |||
this_type & | tc4, | |||
int | factor4, | |||
this_type & | tc5, | |||
int | factor5, | |||
this_type & | tc6, | |||
int | factor6, | |||
this_type & | tc7, | |||
int | factor7, | |||
this_type & | tc8, | |||
int | factor8, | |||
this_type & | tc9, | |||
int | factor9, | |||
this_type & | tc10, | |||
int | factor10 | |||
) |
Definition at line 272 of file rc_transaction_counter.cpp.
rc_transaction_counter | ( | const this_type & | orig | ) | [private] |
(disabled)
int count | ( | ) | const [inline] |
void modify | ( | int | amount | ) |
Modifies the counter by the given amount.
amount | of the modification |
Definition at line 64 of file rc_transaction_counter.cpp.
Referenced by rc_abstract_prim_filter::_rc_modify_transaction_callback(), rc_transaction_counter::operator++(), rc_transaction_counter::operator+=(), rc_transaction_counter::operator--(), rc_transaction_counter::operator-=(), and rc_transaction_counter::reset().
void reset | ( | ) |
Reset the counter.
The counter is reset to zero. All hold transactions are released.
Definition at line 88 of file rc_transaction_counter.cpp.
Referenced by rc_transaction_counter::~rc_transaction_counter().
rc_reconfigurable* get_reconfigurable | ( | ) | const [inline] |
Returns the associated reconfigurable context (if exists).
Definition at line 125 of file rc_transaction_counter.h.
int get_children_count | ( | ) | const [inline] |
Returns the number of children.
Definition at line 133 of file rc_transaction_counter.h.
int get_relay_factor | ( | int | index | ) | const |
Returns the relay factor of child of the given index.
Definition at line 95 of file rc_transaction_counter.cpp.
void set_relay_factor | ( | int | index, | |
int | factor | |||
) |
Sets the relay factor for the child of the given index.
Definition at line 104 of file rc_transaction_counter.cpp.
void set_relay_factor | ( | rc_transaction_counter & | child, | |
int | factor | |||
) |
Sets the relay factor for the given child.
Definition at line 111 of file rc_transaction_counter.cpp.
const this_type& operator++ | ( | ) | [inline] |
const this_type& operator-- | ( | ) | [inline] |
const this_type& operator+= | ( | int | amount | ) | [inline] |
Increase the counter by a particular amount.
Definition at line 168 of file rc_transaction_counter.h.
const this_type& operator-= | ( | int | amount | ) | [inline] |
Decrease the counter by a particular amount.
Definition at line 174 of file rc_transaction_counter.h.
void _rc_relay | ( | int | amount | ) | [private] |
relays a modification to the childs
Definition at line 125 of file rc_transaction_counter.cpp.
Referenced by rc_transaction_counter::modify().
void _rc_add_child | ( | rc_transaction_counter & | child, | |
int | factor = 1 | |||
) | [private] |
adds a child
child | the child to be added | |
factor | the relay factor of the child |
Definition at line 141 of file rc_transaction_counter.cpp.
Referenced by rc_transaction_counter::rc_transaction_counter().
rc_reconfigurable* p_reconf [private] |
The associated reconfigurable context.
Definition at line 255 of file rc_transaction_counter.h.
Referenced by rc_transaction_counter::get_reconfigurable(), rc_transaction_counter::modify(), and rc_transaction_counter::rc_transaction_counter().
int p_count [private] |
The current transaction number.
Definition at line 259 of file rc_transaction_counter.h.
Referenced by rc_transaction_counter::count(), rc_transaction_counter::modify(), and rc_transaction_counter::reset().
std::vector<std::pair<this_type*, int> > p_children [private] |
The children vector.
Definition at line 265 of file rc_transaction_counter.h.
Referenced by rc_transaction_counter::_rc_add_child(), rc_transaction_counter::_rc_relay(), rc_transaction_counter::get_children_count(), rc_transaction_counter::get_relay_factor(), rc_transaction_counter::modify(), rc_transaction_counter::reset(), and rc_transaction_counter::set_relay_factor().