eventq.hh (12080:2e61522397dd) eventq.hh (12082:ffa559ffeecc)
1/*
2 * Copyright (c) 2000-2005 The Regents of The University of Michigan
3 * Copyright (c) 2013 Advanced Micro Devices, Inc.
4 * Copyright (c) 2013 Mark D. Hill and David A. Wood
5 * All rights reserved.
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions are

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

795 name() const
796 {
797 return object->name() + ".wrapped_event";
798 }
799
800 const char *description() const { return "EventWrapped"; }
801};
802
1/*
2 * Copyright (c) 2000-2005 The Regents of The University of Michigan
3 * Copyright (c) 2013 Advanced Micro Devices, Inc.
4 * Copyright (c) 2013 Mark D. Hill and David A. Wood
5 * All rights reserved.
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions are

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

795 name() const
796 {
797 return object->name() + ".wrapped_event";
798 }
799
800 const char *description() const { return "EventWrapped"; }
801};
802
803class EventFunctionWrapper : public Event
804{
805 private:
806 std::function<void(void)> callback;
807 std::string _name;
808
809 public:
810 EventFunctionWrapper(const std::function<void(void)> &callback,
811 const std::string &name,
812 bool del = false,
813 Priority p = Default_Pri)
814 : Event(p), callback(callback), _name(name)
815 {
816 if (del)
817 setFlags(AutoDelete);
818 }
819
820 void process() { callback(); }
821
822 const std::string
823 name() const
824 {
825 return _name + ".wrapped_function_event";
826 }
827
828 const char *description() const { return "EventFunctionWrapped"; }
829};
830
803#endif // __SIM_EVENTQ_HH__
831#endif // __SIM_EVENTQ_HH__