rc_transaction_counter Class Reference

#include <rc_transaction_counter.h>

List of all members.


Detailed Description

Class rc_transaction_counter.

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.

Remarks:
If rc_transaction_counter is created at simulation time, it is linked to the reconfigurable context of the executing process.
Note:
If rc_transaction_counter is created in a non-reconfigurable context, it can be used as usual, but all modifications to it will not have any effect.

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_reconfigurableget_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_typeoperator++ ()
 Increase the counter by one.
const this_typeoperator-- ()
 Decrease the counter by one.
const this_typeoperator+= (int amount)
 Increase the counter by a particular amount.
const this_typeoperator-= (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_typeoperator= (const this_type &orig)
 (disabled)

Private Attributes

rc_reconfigurablep_reconf
 The associated reconfigurable context.
int p_count
 The current transaction number.
std::vector
< std::pair
< this_type *, int > > 
p_children
 The children vector.

Member Typedef Documentation

typedef rc_transaction_counter this_type [private]

Definition at line 78 of file rc_transaction_counter.h.


Constructor & Destructor Documentation

rc_transaction_counter (  ) 

Default constructor.

Definition at line 41 of file rc_transaction_counter.cpp.

rc_transaction_counter ( std::vector< this_type * > &  children  )  [explicit]

Constructor (constructs a relay counter).

Parameters:
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).

Parameters:
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)


Member Function Documentation

int count (  )  const [inline]

Returns the current count.

Definition at line 97 of file rc_transaction_counter.h.

void modify ( int  amount  ) 

Modifies the counter by the given amount.

Parameters:
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.

Note:
Will have no effect in case of a relay counter.

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.

Note:
Will return 0 if it is not a relay counter.

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]

Increase the counter by one.

Definition at line 156 of file rc_transaction_counter.h.

const this_type& operator-- (  )  [inline]

Decrease the counter by one.

Definition at line 162 of file rc_transaction_counter.h.

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

Parameters:
child the child to be added
factor the relay factor of the child
Note:
A transaction counter with children is regarded as a relay counter and will only count at the child objects.

Definition at line 141 of file rc_transaction_counter.cpp.

Referenced by rc_transaction_counter::rc_transaction_counter().

this_type& operator= ( const this_type orig  )  [private]

(disabled)


Member Data Documentation

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.

Note:
(relay counters only)

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().


The documentation for this class was generated from the following files:
Generated on Tue Jan 1 23:14:14 2008 for ReChannel by  doxygen 1.5.3