Deleted Added
sdiff udiff text old ( 13089:2cd69e58c0f8 ) new ( 13132:1fb4a87f550f )
full compact
1/*
2 * Copyright 2018 Google, Inc.
3 *
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are
6 * met: redistributions of source code must retain the above copyright
7 * notice, this list of conditions and the following disclaimer;
8 * redistributions in binary form must reproduce the above copyright

--- 50 unchanged lines hidden (view full) ---

59class sc_event_finder
60{
61 protected:
62 virtual ~sc_event_finder() {}
63
64 public:
65 // Should be "implementation defined" but used in the tests.
66 virtual const sc_event &find_event(sc_interface *if_p=NULL) const = 0;
67};
68
69template <class IF>
70class sc_event_finder_t : public sc_event_finder
71{
72 public:
73 sc_event_finder_t(const sc_port_base &p,
74 const sc_event & (IF::*_method)() const) :
75 _method(_method)
76 {
77 _port = dynamic_cast<const sc_port_b<IF> *>(&p);
78 assert(_port);
79 }
80
81 virtual ~sc_event_finder_t() {}
82
83 const sc_event &
84 find_event(sc_interface *if_p=NULL) const override
85 {
86 const IF *iface = if_p ? dynamic_cast<const IF *>(if_p) :
87 dynamic_cast<const IF *>(_port->get_interface());
88 return (const_cast<IF *>(iface)->*_method)();
89 }
90

--- 158 unchanged lines hidden ---