SystemC
Recoding Infrastructure for SystemC v0.6.2 derived from Accellera SystemC 2.3.1
Accellera SystemC proof-of-concept library
|
Arbitrary exception class. More...
#include <sysc/kernel/sc_process.h>
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 278 of file sc_process.h.