rc_port_handle Class Reference

#include <rc_port_handle.h>

List of all members.


Detailed Description

Class for the generalised handling of SystemC ports.

rc_port_handle is helpful when no template arguments are known, e.g., in base classes, and ports of different type have to be managed.

Note:
rc_port_handle is copyable.

Definition at line 99 of file rc_port_handle.h.


Public Member Functions

 rc_port_handle ()
 Default constructor.
template<class IF, int N, sc_port_policy POL>
 rc_port_handle (sc_port< IF, N, POL > &port_)
 Constructor to create a handle from a port.
bool valid () const
 Is valid handle?
void reset ()
 sets port pointer to NULL and invalidates the handle
sc_interface * get_interface () const
 returns the interface that is bound to the referenced port
sc_object * get_object () const
 returns the object of the referenced port
sc_port_base * operator-> () const
 direct access to the base class of the referenced port
sc_port_base * operator * () const
 direct access to the base class of the referenced port
 operator sc_port_base * () const
 operator sc_object * () const
bool operator== (const rc_port_handle &other) const
 compare with other port handle
bool operator< (const rc_port_handle &other) const
 specifies the port handle's natural sort order

Private Types

typedef
internals::port_handle::port_ref 
port_ref
typedef rc_hash_map
< sc_port_base *,
port_ref * > 
portmap

Private Attributes

sc_port_base * p_port_base
 the port base class that is referenced by this handle
port_refp_port_ref
 points to the element that stores the port.

Static Private Attributes

static portmap p_portmap
 the static map that stores the port objects

Member Typedef Documentation

typedef internals::port_handle::port_ref port_ref [private]

The data type of an element containing a port of type PORT.

Definition at line 104 of file rc_port_handle.h.

typedef rc_hash_map<sc_port_base*, port_ref*> portmap [private]

The type of the map in which the ports are stored is a hash map for fast lookup.

Definition at line 108 of file rc_port_handle.h.


Constructor & Destructor Documentation

rc_port_handle (  )  [inline]

Default constructor.

Definition at line 112 of file rc_port_handle.h.

rc_port_handle ( sc_port< IF, N, POL > &  port_  )  [inline]

Constructor to create a handle from a port.

Definition at line 197 of file rc_port_handle.h.


Member Function Documentation

bool valid (  )  const [inline]

Is valid handle?

Returns:
true if valid, false otherwise
Remarks:
If this handle points to an port it is said to be "valid"

Definition at line 125 of file rc_port_handle.h.

Referenced by rc_portal_b::_rc_init(), rc_portal_b::add_event_forwarder(), rc_object_handle::get_interface(), rc_portal_b::get_static_interface(), rc_object_handle::is_port(), and rc_portal_base::register_port().

void reset (  )  [inline]

sets port pointer to NULL and invalidates the handle

Definition at line 130 of file rc_port_handle.h.

Referenced by rc_object_handle::operator=().

sc_interface* get_interface (  )  const [inline]

returns the interface that is bound to the referenced port

Returns:
interface if exists, NULL otherwise

Definition at line 136 of file rc_port_handle.h.

Referenced by rc_portal_b::add_event_forwarder(), rc_object_handle::get_interface(), rc_portal_b::get_static_interface(), and rc_portal_base::register_port().

sc_object* get_object (  )  const [inline]

returns the object of the referenced port

Returns:
object if handle is valid, NULL otherwise

Definition at line 142 of file rc_port_handle.h.

Referenced by rc_object_handle::operator=().

sc_port_base* operator-> (  )  const [inline]

direct access to the base class of the referenced port

Returns:
port's base class if handle is valid, NULL otherwise

Definition at line 148 of file rc_port_handle.h.

sc_port_base* operator * (  )  const [inline]

direct access to the base class of the referenced port

Returns:
the port's base class if handle is valid, NULL otherwise

Definition at line 154 of file rc_port_handle.h.

operator sc_port_base * (  )  const [inline]

Definition at line 157 of file rc_port_handle.h.

operator sc_object * (  )  const [inline]

Definition at line 160 of file rc_port_handle.h.

bool operator== ( const rc_port_handle other  )  const [inline]

compare with other port handle

Returns:
true if equal, false otherwise

Definition at line 166 of file rc_port_handle.h.

bool operator< ( const rc_port_handle other  )  const [inline]

specifies the port handle's natural sort order

Note:
port's object pointer values are compared.

Definition at line 173 of file rc_port_handle.h.


Member Data Documentation

sc_port_base* p_port_base [private]

the port base class that is referenced by this handle

p_port_base is NULL if the handle is invalid.

Definition at line 181 of file rc_port_handle.h.

Referenced by rc_port_handle::get_object(), rc_port_handle::operator *(), rc_port_handle::operator sc_object *(), rc_port_handle::operator sc_port_base *(), rc_port_handle::operator->(), rc_port_handle::operator<(), rc_port_handle::operator==(), rc_port_handle::reset(), and rc_port_handle::valid().

port_ref* p_port_ref [private]

points to the element that stores the port.

p_port_ref is NULL if the handle is invalid.

Definition at line 186 of file rc_port_handle.h.

Referenced by rc_port_handle::get_interface(), rc_port_handle::rc_port_handle(), and rc_port_handle::reset().

rc_port_handle::portmap p_portmap [static, private]

the static map that stores the port objects

Definition at line 191 of file rc_port_handle.h.

Referenced by rc_port_handle::rc_port_handle().


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