SystemC  2.3.2
Accellera SystemC proof-of-concept library
sc_semaphore_if.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_semaphore_if.h -- The sc_semaphore_if interface class.
23 */
33 #ifndef SC_SEMAPHORE_IF_H
34 #define SC_SEMAPHORE_IF_H
35 
37 
38 namespace sc_core {
39 
47 : virtual public sc_interface
48 {
49 public:
50 
51  // the classical operations: wait(), trywait(), and post()
52 
53  // lock (take) the semaphore, block if not available
54  virtual int wait() = 0;
55 
56  // lock (take) the semaphore, return -1 if not available
57  virtual int trywait() = 0;
58 
59  // unlock (give) the semaphore
60  virtual int post() = 0;
61 
62  // get the value of the semphore
63  virtual int get_value() const = 0;
64 
65 protected:
66 
67  // constructor
68 
70  {}
71 
72 private:
73 
74  // disabled
76  sc_semaphore_if& operator = ( const sc_semaphore_if& );
77 };
78 
79 } // namespace sc_core
80 
81 //$Log: sc_semaphore_if.h,v $
82 //Revision 1.3 2011/08/26 20:45:42 acg
83 // Andy Goodrich: moved the modification log to the end of the file to
84 // eliminate source line number skew when check-ins are done.
85 //
86 //Revision 1.2 2011/02/18 20:23:45 acg
87 // Andy Goodrich: Copyright update.
88 //
89 //Revision 1.1.1.1 2006/12/15 20:20:04 acg
90 //SystemC 2.3
91 //
92 //Revision 1.2 2006/01/03 23:18:26 acg
93 //Changed copyright to include 2006.
94 //
95 //Revision 1.1.1.1 2005/12/19 23:16:43 acg
96 //First check in of SystemC 2.1 into its own archive.
97 //
98 //Revision 1.8 2005/06/10 22:43:55 acg
99 //Added CVS change log annotation.
100 //
101 
102 #endif
103 
104 // Taf!
Abstract base class of all interface classes.
The sc_semaphore_if interface class.
Abstract base class of all interface classes.
Definition: sc_interface.h:51
#define SC_API
Definition: sc_cmnhdr.h:168
void SC_API wait(int, sc_simcontext *)