本文整理汇总了C++中sc_event::add_static方法的典型用法代码示例。如果您正苦于以下问题:C++ sc_event::add_static方法的具体用法?C++ sc_event::add_static怎么用?C++ sc_event::add_static使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类sc_event
的用法示例。
在下文中一共展示了sc_event::add_static方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: add_static_event
//------------------------------------------------------------------------------
//"sc_process_b::add_static_event"
//
// This method adds an event to the list of static events, and sets the
// event up to call back this process when it fires.
//------------------------------------------------------------------------------
void sc_process_b::add_static_event( const sc_event& e )
{
sc_method_handle method_h; // This process as a method.
sc_thread_handle thread_h; // This process as a thread.
// CHECK TO SEE IF WE ARE ALREADY REGISTERED WITH THE EVENT:
for( int i = m_static_events.size() - 1; i >= 0; -- i ) {
if( &e == m_static_events[i] ) {
return;
}
}
// REMEMBER THE EVENT AND THEN REGISTER OUR OBJECT INSTANCE WITH IT:
m_static_events.push_back( &e );
switch ( m_process_kind )
{
case SC_THREAD_PROC_:
case SC_CTHREAD_PROC_:
thread_h = SCAST<sc_thread_handle>( this );
e.add_static( thread_h );
break;
case SC_METHOD_PROC_:
method_h = SCAST<sc_method_handle>( this );
e.add_static( method_h );
break;
default:
assert( false );
break;
}
}