gem5  v22.1.0.0
Public Member Functions | Private Member Functions | Private Attributes | List of all members
sc_core::sc_semaphore Class Reference

#include <sc_semaphore.hh>

Inheritance diagram for sc_core::sc_semaphore:
sc_core::sc_semaphore_if sc_core::sc_object sc_core::sc_interface

Public Member Functions

 sc_semaphore (int)
 
 sc_semaphore (const char *name, int)
 
virtual int wait ()
 
virtual int trywait ()
 
virtual int post ()
 
virtual int get_value () const
 
virtual const char * kind () const
 
- Public Member Functions inherited from sc_core::sc_interface
virtual void register_port (sc_port_base &, const char *)
 
virtual const sc_eventdefault_event () const
 
virtual ~sc_interface ()
 
- Public Member Functions inherited from sc_core::sc_object
const char * name () const
 
const char * basename () const
 
virtual void print (std::ostream &=std::cout) const
 
virtual void dump (std::ostream &=std::cout) const
 
virtual const std::vector< sc_object * > & get_child_objects () const
 
virtual const std::vector< sc_event * > & get_child_events () const
 
sc_objectget_parent_object () const
 
bool add_attribute (sc_attr_base &)
 
sc_attr_baseget_attribute (const std::string &)
 
sc_attr_baseremove_attribute (const std::string &)
 
void remove_all_attributes ()
 
int num_attributes () const
 
sc_attr_cltnattr_cltn ()
 
const sc_attr_cltnattr_cltn () const
 
sc_simcontextsimcontext () const
 

Private Member Functions

 sc_semaphore (const sc_semaphore &)
 
sc_semaphoreoperator= (const sc_semaphore &)
 

Private Attributes

int _value
 
sc_gem5::InternalScEvent posted
 

Additional Inherited Members

- Protected Member Functions inherited from sc_core::sc_semaphore_if
 sc_semaphore_if ()
 
- Protected Member Functions inherited from sc_core::sc_interface
 sc_interface ()
 
- Protected Member Functions inherited from sc_core::sc_object
 sc_object ()
 
 sc_object (const char *)
 
 sc_object (const sc_object &)
 
sc_objectoperator= (const sc_object &)
 
virtual ~sc_object ()
 

Detailed Description

Definition at line 38 of file sc_semaphore.hh.

Constructor & Destructor Documentation

◆ sc_semaphore() [1/3]

sc_core::sc_semaphore::sc_semaphore ( int  value)
explicit

Definition at line 38 of file sc_semaphore.cc.

◆ sc_semaphore() [2/3]

sc_core::sc_semaphore::sc_semaphore ( const char *  name,
int  value 
)

◆ sc_semaphore() [3/3]

sc_core::sc_semaphore::sc_semaphore ( const sc_semaphore )
inlineprivate

Definition at line 53 of file sc_semaphore.hh.

Member Function Documentation

◆ get_value()

int sc_core::sc_semaphore::get_value ( ) const
virtual

Implements sc_core::sc_semaphore_if.

Definition at line 77 of file sc_semaphore.cc.

References _value.

◆ kind()

virtual const char* sc_core::sc_semaphore::kind ( ) const
inlinevirtual

Reimplemented from sc_core::sc_object.

Definition at line 49 of file sc_semaphore.hh.

◆ operator=()

sc_semaphore& sc_core::sc_semaphore::operator= ( const sc_semaphore )
inlineprivate

Definition at line 57 of file sc_semaphore.hh.

◆ post()

int sc_core::sc_semaphore::post ( )
virtual

Implements sc_core::sc_semaphore_if.

Definition at line 70 of file sc_semaphore.cc.

References _value, sc_core::sc_event::notify(), and posted.

◆ trywait()

int sc_core::sc_semaphore::trywait ( )
virtual

Implements sc_core::sc_semaphore_if.

Definition at line 60 of file sc_semaphore.cc.

References _value.

Referenced by wait().

◆ wait()

int sc_core::sc_semaphore::wait ( )
virtual

Implements sc_core::sc_semaphore_if.

Definition at line 52 of file sc_semaphore.cc.

References posted, trywait(), and sc_core::wait().

Member Data Documentation

◆ _value

int sc_core::sc_semaphore::_value
private

Definition at line 59 of file sc_semaphore.hh.

Referenced by get_value(), post(), and trywait().

◆ posted

sc_gem5::InternalScEvent sc_core::sc_semaphore::posted
private

Definition at line 60 of file sc_semaphore.hh.

Referenced by post(), and wait().


The documentation for this class was generated from the following files:

Generated on Wed Dec 21 2022 10:25:07 for gem5 by doxygen 1.9.1