event.cc (13127:d3318222cf09) event.cc (13179:7445c43d036b)
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

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

56
57 if (p)
58 parent = p->obj()->sc_obj();
59 else if (scheduler.current())
60 parent = scheduler.current();
61 else
62 parent = nullptr;
63
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

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

56
57 if (p)
58 parent = p->obj()->sc_obj();
59 else if (scheduler.current())
60 parent = scheduler.current();
61 else
62 parent = nullptr;
63
64 pickUniqueName(parent, _basename);
64 std::string original_name = _basename;
65 _basename = pickUniqueName(parent, _basename);
65
66 if (parent) {
67 Object *obj = Object::getFromScObject(parent);
68 obj->addChildEvent(_sc_event);
69 } else {
70 topLevelEvents.emplace(topLevelEvents.end(), _sc_event);
71 }
72
66
67 if (parent) {
68 Object *obj = Object::getFromScObject(parent);
69 obj->addChildEvent(_sc_event);
70 } else {
71 topLevelEvents.emplace(topLevelEvents.end(), _sc_event);
72 }
73
73 if (parent)
74 _name = std::string(parent->name()) + "." + _basename;
75 else
76 _name = _basename;
74 std::string path = parent ? (std::string(parent->name()) + ".") : "";
77
75
76 if (original_name != "" && _basename != original_name) {
77 std::string message = path + original_name +
78 ". Latter declaration will be renamed to " +
79 path + _basename;
80 SC_REPORT_WARNING("(W505) object already exists", message.c_str());
81 }
82
83 _name = path + _basename;
84
78 allEvents.emplace(allEvents.end(), _sc_event);
79
80 // Determine if we're in the hierarchy (created once initialization starts
81 // means no).
82}
83
84Event::~Event()
85{

--- 95 unchanged lines hidden ---
85 allEvents.emplace(allEvents.end(), _sc_event);
86
87 // Determine if we're in the hierarchy (created once initialization starts
88 // means no).
89}
90
91Event::~Event()
92{

--- 95 unchanged lines hidden ---