SystemC 3.0.0
Accellera SystemC proof-of-concept library
sc_dynamic_processes.h
Go to the documentation of this file.
1/*****************************************************************************
2
3 Licensed to Accellera Systems Initiative Inc. (Accellera) under one or
4 more contributor license agreements. See the NOTICE file distributed
5 with this work for additional information regarding copyright ownership.
6 Accellera licenses this file to you under the Apache License, Version 2.0
7 (the "License"); you may not use this file except in compliance with the
8 License. You may obtain a copy of the License at
9
10 http://www.apache.org/licenses/LICENSE-2.0
11
12 Unless required by applicable law or agreed to in writing, software
13 distributed under the License is distributed on an "AS IS" BASIS,
14 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
15 implied. See the License for the specific language governing
16 permissions and limitations under the License.
17
18 *****************************************************************************/
19
20/*****************************************************************************
21
22 sc_dynamic_process.h -- Dynamic Process Package Definitions
23
24 Original Author: Andy Goodrich, Forte Design Systems, 5 May 2003
25
26 CHANGE LOG AT THE END OF THE FILE
27 *****************************************************************************/
28
29
30#ifndef SC_DYNAMIC_PROCESSES_H
31#define SC_DYNAMIC_PROCESSES_H
32
36#include "sysc/kernel/sc_join.h"
37
38#include <functional>
39
40namespace sc_unnamed {
41using namespace std::placeholders;
42} // namespace sc_unnamed
43
44namespace sc_core {
45
46template<typename F, typename... Args>
47auto sc_bind( F&& f, Args&&... args )
48 -> decltype( std::bind( std::forward<F>(f), std::forward<Args>(args)... ) )
49 { return std::bind( std::forward<F>(f), std::forward<Args>(args)... ); }
50
51template<typename R, typename F, typename... Args>
52auto sc_bind( F&& f, Args&&... args )
53 -> decltype( std::bind<R>( std::forward<F>(f), std::forward<Args>(args)... ) )
54 { return std::bind<R>( std::forward<F>(f), std::forward<Args>(args)... ); }
55
56template<typename T>
57auto sc_ref( T&& v )
58 { return std::ref( std::forward<T>(v) ); }
59
60template<typename T>
61auto sc_cref( T&& v )
62 { return std::cref( std::forward<T>(v) ); }
63
64} // namespace sc_core
65
66// bring sc_bind, sc_ref, sc_cref into global namespace - unless asked not to
67// TODO: invert default for IEEE 1666-202x
68#if ! (defined(SC_BIND_IN_GLOBAL_NAMESPACE) && SC_BIND_IN_GLOBAL_NAMESPACE == 0)
70using sc_core::sc_ref;
72#endif // SC_BIND_IN_GLOBAL_NAMESPACE
73
74// $Log: sc_dynamic_processes.h,v $
75// Revision 1.5 2011/08/26 20:46:09 acg
76// Andy Goodrich: moved the modification log to the end of the file to
77// eliminate source line number skew when check-ins are done.
78//
79// Revision 1.4 2011/02/18 20:27:14 acg
80// Andy Goodrich: Updated Copyrights.
81//
82// Revision 1.3 2011/02/13 21:47:37 acg
83// Andy Goodrich: update copyright notice.
84//
85// Revision 1.2 2008/05/22 17:06:25 acg
86// Andy Goodrich: updated copyright notice to include 2008.
87//
88// Revision 1.1.1.1 2006/12/15 20:20:05 acg
89// SystemC 2.3
90//
91// Revision 1.5 2006/04/20 17:08:16 acg
92// Andy Goodrich: 3.0 style process changes.
93//
94// Revision 1.4 2006/04/11 23:13:20 acg
95// Andy Goodrich: Changes for reduced reset support that only includes
96// sc_cthread, but has preliminary hooks for expanding to method and thread
97// processes also.
98//
99// Revision 1.3 2006/01/13 18:44:29 acg
100// Added $Log to record CVS changes into the source.
101//
102
103#endif // SC_DYNAMIC_PROCESSES_H
auto sc_bind(F &&f, Args &&... args) -> decltype(std::bind(std::forward< F >(f), std::forward< Args >(args)...))
auto sc_ref(T &&v)
auto sc_cref(T &&v)