39#if defined(_MSC_VER) && !defined(SC_WIN_DLL_WARN)
41#pragma warning(disable: 4251)
50class sc_event_or_list;
51class sc_event_and_list;
54class sc_signal_channel;
75 : m_expr( new T(true) )
103 m_expr->push_back(el);
105 operator T
const &()
const
116 mutable type * m_expr;
141 {
return size() == 0; }
153 bool auto_delete_ =
false );
160 bool and_list()
const;
168 bool temporary()
const;
169 void auto_delete()
const;
176 std::vector<const sc_event*> m_events;
179 mutable unsigned m_busy;
286 {
return m_name.c_str(); }
288 {
return m_parent_with_hierarchy_flag; }
290 {
return m_parent_with_hierarchy_flag.get_flag() ==
true; }
318 void notify_internal(
const sc_time& );
319 void notify_next_delta();
326 void register_event(
const char* name,
bool is_kernel_event =
false );
333 enum notify_t { NONE, DELTA, TIMED };
337 notify_t m_notify_type;
338 int m_delta_event_index;
339 sc_event_timed* m_timed;
341 mutable std::vector<sc_method_handle> m_methods_static;
342 mutable std::vector<sc_method_handle> m_methods_dynamic;
343 mutable std::vector<sc_thread_handle> m_threads_static;
344 mutable std::vector<sc_thread_handle> m_threads_dynamic;
347 sc_ptr_flag<sc_object_host> m_parent_with_hierarchy_flag;
351 static struct kernel_tag {} kernel_event;
352 explicit sc_event( kernel_tag,
const char* name = NULL );
375 : m_event( e ), m_notify_time( t )
379 {
if( m_event != 0 ) { m_event->m_timed = 0; } }
384 const sc_time& notify_time()
const
385 {
return m_notify_time; }
387 static void*
operator new( std::size_t )
388 {
return allocate(); }
390 static void operator delete(
void* p, std::size_t )
396 static void* allocate();
397 static void deallocate(
void* );
402 sc_time m_notify_time;
408 sc_event_timed(
const sc_event_timed& );
409 sc_event_timed& operator = (
const sc_event_timed& );
425sc_event::notify_internal(
const sc_time& t )
429 m_delta_event_index = m_simc->add_delta_event(
this );
430 m_notify_type = DELTA;
434 m_simc->add_timed_event( et );
436 m_notify_type = TIMED;
442sc_event::notify_next_delta()
444 if( m_notify_type != NONE ) {
448 m_delta_event_index = m_simc->add_delta_event(
this );
449 m_notify_type = DELTA;
464 m_methods_static.push_back( method_h );
471 m_threads_static.push_back( thread_h );
478 m_methods_dynamic.push_back( method_h );
485 m_threads_dynamic.push_back( thread_h );
503 , m_and_list( and_list_ )
504 , m_auto_delete( auto_delete_ )
514 , m_and_list( and_list_ )
515 , m_auto_delete( auto_delete_ )
518 m_events.push_back( &e );
524 , m_and_list( that.m_and_list )
525 , m_auto_delete( false )
560 m_events.swap( that.m_events );
570 m_events = that.m_events;
578 return static_cast<int>(m_events.size());
601 return m_auto_delete && ! m_busy;
604#if defined(__GNUC__) && (__GNUC__ >= 11)
607#pragma GCC diagnostic push
608#pragma GCC diagnostic ignored "-Wfree-nonheap-object"
618 if( ! m_busy && m_auto_delete ) {
623#if defined(__GNUC__) && (__GNUC__ >= 11)
624#pragma GCC diagnostic pop
850#if defined(_MSC_VER) && !defined(SC_WIN_DLL_WARN)
#define SC_REPORT_ERROR(msg_type, msg)
sc_event_or_expr operator|(sc_event_or_expr expr, sc_event const &e)
class SC_API sc_simcontext
class sc_method_process * sc_method_handle
const char SC_ID_NOTIFY_DELAYED_[]
class sc_thread_process * sc_thread_handle
SC_API int sc_notify_time_compare(const void *, const void *)
sc_simcontext * sc_get_curr_simcontext()
SC_API const sc_time SC_ZERO_TIME
sc_event_expr< sc_event_or_list > sc_event_or_expr
class SC_API sc_object_host
sc_event_expr< sc_event_and_list > sc_event_and_expr
sc_event_and_expr operator&(sc_event_and_expr expr, sc_event const &e)
X & operator|=(sc_proxy< X > &px, const sc_proxy< Y > &py)
unsigned long long uint64
X & operator&=(sc_proxy< X > &px, const sc_proxy< Y > &py)
void push_back(type const &el) const
T const & release() const
sc_event_expr(sc_event_expr const &e)
void push_back(sc_event const &e) const
void push_back(const sc_event &)
void add_dynamic(sc_thread_handle) const
friend void sc_thread_cor_fn(void *arg)
void remove_dynamic(sc_thread_handle, const sc_event *) const
void report_invalid_modification() const
sc_event_list(const sc_event_list &)
void remove_dynamic(sc_method_handle, const sc_event *) const
sc_event_list & operator=(const sc_event_list &)
void move_from(const sc_event_list &)
void push_back(const sc_event_list &)
void report_premature_destruction() const
void add_dynamic(sc_method_handle) const
void swap(sc_event_list &)
void swap(sc_event_and_list &)
sc_event_and_list & operator&=(const sc_event &)
sc_event_expr< sc_event_and_list > operator&(const sc_event &)
sc_event_expr< sc_event_or_list > operator|(const sc_event &) const
sc_event_or_list & operator|=(const sc_event &)
void swap(sc_event_or_list &)
sc_event(const char *name)
friend void sc_thread_cor_fn(void *arg)
const char * basename() const
void notify_delayed(const sc_time &)
static const sc_event & none()
const char * name() const
bool in_hierarchy() const
sc_object * get_parent_object() const
friend class sc_event_timed
void notify(const sc_time &)
sc_event_or_expr operator|(const sc_event &) const
sc_event_and_expr operator&(const sc_event &) const
friend SC_API int sc_notify_time_compare(const void *, const void *)
const sc_time & time_stamp() const