Gabe Black has uploaded this change for review. ( https://gem5-review.googlesource.com/c/public/gem5/+/15057

Change subject: systemc: Fix style issues in the TLM header files.
......................................................................

systemc: Fix style issues in the TLM header files.

Change-Id: Id12ffb9b56b3887afcf30120f81ce5eb75a5987b
---
M src/systemc/ext/tlm_core/tlm_1/tlm_req_rsp/tlm_ports/tlm_event_finder.h
1 file changed, 26 insertions(+), 54 deletions(-)



diff --git a/src/systemc/ext/tlm_core/tlm_1/tlm_req_rsp/tlm_ports/tlm_event_finder.h b/src/systemc/ext/tlm_core/tlm_1/tlm_req_rsp/tlm_ports/tlm_event_finder.h
index 60874ce..cfa4d1b 100644
--- a/src/systemc/ext/tlm_core/tlm_1/tlm_req_rsp/tlm_ports/tlm_event_finder.h +++ b/src/systemc/ext/tlm_core/tlm_1/tlm_req_rsp/tlm_ports/tlm_event_finder.h
@@ -17,78 +17,50 @@

*****************************************************************************/

-#ifndef __TLM_EVENT_FINDER_H__
-#define __TLM_EVENT_FINDER_H__
-
-//#include <systemc>
+#ifndef __SYSTEMC_EXT_TLM_CORE_TLM_1_TLM_REQ_RSP_TLM_PORTS_TLM_EVENT_FINDER_H__ +#define __SYSTEMC_EXT_TLM_CORE_TLM_1_TLM_REQ_RSP_TLM_PORTS_TLM_EVENT_FINDER_H__

 #include "tlm_core/tlm_1/tlm_req_rsp/tlm_1_interfaces/tlm_tag.h"

-namespace tlm {
-
-template <class IF , class T>
-class tlm_event_finder_t
-: public sc_core::sc_event_finder
+namespace tlm
 {
-public:

-    // constructor
+template <class IF, class T>
+class tlm_event_finder_t : public sc_core::sc_event_finder
+{
+  public:
+    tlm_event_finder_t(const sc_core::sc_port_base &port_,
+                       const sc_core::sc_event &(IF::*event_method_)(
+                           tlm_tag<T> *) const) :
+        sc_core::sc_event_finder( port_ ), m_event_method( event_method_ )
+    {}

-    tlm_event_finder_t( const sc_core::sc_port_base& port_,
- const sc_core::sc_event& (IF::*event_method_) ( tlm_tag<T> * ) const ) - : sc_core::sc_event_finder( port_ ), m_event_method( event_method_ )
-        {}
+    virtual ~tlm_event_finder_t() {}

-    // destructor (does nothing)
-
-    virtual ~tlm_event_finder_t()
-        {}
-#if !(defined SYSTEMC_VERSION & SYSTEMC_VERSION <= 20050714)
- virtual const sc_core::sc_event& find_event( sc_core::sc_interface* if_p = 0 ) const;
-#else
     virtual const sc_core::sc_event& find_event() const;
-#endif

-private:
+  private:
+    const sc_core::sc_event &(IF::*m_event_method)(tlm_tag<T> *) const;

-    const sc_core::sc_event& (IF::*m_event_method) ( tlm_tag<T> * ) const;
-
-private:
-
+  private:
     // disabled
     tlm_event_finder_t();
-    tlm_event_finder_t( const tlm_event_finder_t<IF,T>& );
- tlm_event_finder_t<IF,T>& operator = ( const tlm_event_finder_t<IF,T>& );
+    tlm_event_finder_t(const tlm_event_finder_t<IF, T> &);
+ tlm_event_finder_t<IF, T> &operator = (const tlm_event_finder_t<IF, T> &);
 };

-
-#if !(defined SYSTEMC_VERSION & SYSTEMC_VERSION <= 20050714)
-template <class IF , class T>
-inline
-const sc_core::sc_event&
-tlm_event_finder_t<IF,T>::find_event( sc_core::sc_interface* if_p ) const
+template <class IF, class T>
+inline const sc_core::sc_event &
+tlm_event_finder_t<IF, T>::find_event() const
 {
-    const IF* iface = ( if_p ) ? dynamic_cast<const IF*>( if_p ) :
- dynamic_cast<const IF*>( port().get_interface() );
-    if( iface == 0 ) {
-  report_error( sc_core::SC_ID_FIND_EVENT_, "port is not bound" );
+    const IF *iface = dynamic_cast<const IF *>(port().get_interface());
+    if (iface == 0) {
+        report_error(sc_core::SC_ID_FIND_EVENT_, "port is not bound");
     }
-    return (const_cast<IF*>( iface )->*m_event_method) ( 0 );
+    return (const_cast<IF *>(iface)->*m_event_method)(0);
 }
-#else
-template <class IF , class T>
-inline
-const sc_core::sc_event&
-tlm_event_finder_t<IF,T>::find_event() const
-{
-    const IF* iface = dynamic_cast<const IF*>( port().get_interface() );
-    if( iface == 0 ) {
-  report_error( sc_core::SC_ID_FIND_EVENT_, "port is not bound" );
-    }
-    return (const_cast<IF*>( iface )->*m_event_method) ( 0 );
-}
-#endif

 } // namespace tlm

+// __SYSTEMC_EXT_TLM_CORE_TLM_1_TLM_REQ_RSP_TLM_PORTS_TLM_EVENT_FINDER_H__
 #endif

--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/15057
To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings

Gerrit-Project: public/gem5
Gerrit-Branch: master
Gerrit-Change-Id: Id12ffb9b56b3887afcf30120f81ce5eb75a5987b
Gerrit-Change-Number: 15057
Gerrit-PatchSet: 1
Gerrit-Owner: Gabe Black <[email protected]>
Gerrit-MessageType: newchange
_______________________________________________
gem5-dev mailing list
[email protected]
http://m5sim.org/mailman/listinfo/gem5-dev

Reply via email to