sc_core::sc_throw_it< EXCEPT > Class Template Reference

Arbitrary exception class. More...

#include <sysc/kernel/sc_process.h>

Inheritance diagram for sc_core::sc_throw_it< EXCEPT >:
Inheritance graph
Collaboration diagram for sc_core::sc_throw_it< EXCEPT >:
Collaboration graph

List of all members.

Public Member Functions

 sc_throw_it (const EXCEPT &value)
virtual ~sc_throw_it ()
virtual this_typeclone () const
virtual void throw_it ()

Protected Attributes

EXCEPT m_value

Detailed Description

template<typename EXCEPT>
class sc_core::sc_throw_it< EXCEPT >

Arbitrary exception class.

This class serves as a way of throwing an execption for an aribtrary type without knowing what that type is. A true virtual method in the base class is used to actually throw the execption. A pointer to the base class is used internally removing the necessity of knowing what the type of EXCEPT is for code internal to the library.

Note the clone() true virtual method. This is used to allow instances of the sc_throw_it<EXCEPT> class to be easily garbage collected. Since an exception may be propogated to more than one process knowing when to garbage collect is non-trivial. So when a call is made to sc_process_handle::throw_it() an instance of sc_throw_it<EXCEPT> is allocated on the stack. For each process throwing the exception a copy is made via clone(). That allows those objects to be deleted by the individual processes when they are no longer needed (in this implementation of SystemC that deletion will occur each time a new exception is thrown ( see sc_thread_process::suspend_me() ).

Definition at line 301 of file sc_process.h.

Constructor & Destructor Documentation

template<typename EXCEPT>
sc_core::sc_throw_it< EXCEPT >::sc_throw_it ( const EXCEPT &  value  )  [inline]

Definition at line 305 of file sc_process.h.

template<typename EXCEPT>
virtual sc_core::sc_throw_it< EXCEPT >::~sc_throw_it (  )  [inline, virtual]

Definition at line 306 of file sc_process.h.

Member Function Documentation

template<typename EXCEPT>
virtual this_type* sc_core::sc_throw_it< EXCEPT >::clone (  )  const [inline, virtual]

Implements sc_core::sc_throw_it_helper.

Definition at line 307 of file sc_process.h.

template<typename EXCEPT>
virtual void sc_core::sc_throw_it< EXCEPT >::throw_it (  )  [inline, virtual]

Implements sc_core::sc_throw_it_helper.

Definition at line 308 of file sc_process.h.

Member Data Documentation

template<typename EXCEPT>
EXCEPT sc_core::sc_throw_it< EXCEPT >::m_value [protected]

Definition at line 310 of file sc_process.h.

The documentation for this class was generated from the following file:

Generated on 29 Oct 2015 for SystemC by  doxygen 1.6.1