31 #if !defined(sc_spawn_h_INCLUDED)
32 #define sc_spawn_h_INCLUDED
42 class sc_event_finder;
101 template <
typename T>
104 const char* name_p = 0,
112 if ( !opt_p || !opt_p->is_method() )
119 return thread_handle;
128 return method_handle;
182 #if !defined (__HP_aCC)
202 template <
typename T>
204 typename T::result_type* r_p,
206 const char* name_p = 0,
215 if ( !opt_p || !opt_p->is_method() )
222 return thread_handle;
231 return method_handle;
237 template<
typename T,
typename R>
238 class sc_spawn_object_v :
public sc_process_host {
255 template <
typename T,
typename R>
259 const char* name_p = 0,
260 const sc_spawn_options* opt_p = 0)
262 sc_simcontext* context_p;
263 sc_spawn_object_v<T,R>* spawn_p;
267 spawn_p =
new sc_spawn_object_v<T,R>(r_p, object);
268 if ( !opt_p || !opt_p->is_method() )
270 sc_process_handle thread_handle = context_p->create_thread_process(
272 static_cast<sc_core::SC_ENTRY_FUNC>(
273 &sc_spawn_object_v<T,R>::semantics),
276 return thread_handle;
280 sc_process_handle method_handle = context_p->create_method_process(
282 static_cast<sc_core::SC_ENTRY_FUNC>(
283 &sc_spawn_object_v<T,R>::semantics),
286 return method_handle;
335 #endif // !defined(sc_spawn_h_INCLUDED)
sc_spawn_object_v(typename T::result_type *r_p, T object)
sc_spawn_object(T object)
sc_process_b sc_process_b
sc_simcontext * sc_get_curr_simcontext()
#define SC_MAKE_FUNC_PTR(callback_tag, func)
sc_process_handle create_thread_process(const char *name_p, bool free_host, SC_ENTRY_FUNC method_p, sc_process_host *host_p, const sc_spawn_options *opt_p)
sc_process_handle sc_spawn(T object, const char *name_p=0, const sc_spawn_options *opt_p=0)
sc_process_handle create_method_process(const char *name_p, bool free_host, SC_ENTRY_FUNC method_p, sc_process_host *host_p, const sc_spawn_options *opt_p)
T::result_type * m_result_p