object.cc (13127:d3318222cf09) | object.cc (13161:8bef8ce2784f) |
---|---|
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 --- 21 unchanged lines hidden (view full) --- 30#include "systemc/core/object.hh" 31 32#include <algorithm> 33 34#include "base/logging.hh" 35#include "systemc/core/event.hh" 36#include "systemc/core/module.hh" 37#include "systemc/core/scheduler.hh" | 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 --- 21 unchanged lines hidden (view full) --- 30#include "systemc/core/object.hh" 31 32#include <algorithm> 33 34#include "base/logging.hh" 35#include "systemc/core/event.hh" 36#include "systemc/core/module.hh" 37#include "systemc/core/scheduler.hh" |
38#include "systemc/ext/core/sc_module.hh" |
|
38 39namespace sc_gem5 40{ 41 42namespace 43{ 44 45ObjectsIt --- 31 unchanged lines hidden (view full) --- 77 for (auto event: *events) 78 if (!strcmp(event->basename(), name.c_str())) 79 return false; 80 return true; 81} 82 83} // anonymous namespace 84 | 39 40namespace sc_gem5 41{ 42 43namespace 44{ 45 46ObjectsIt --- 31 unchanged lines hidden (view full) --- 78 for (auto event: *events) 79 if (!strcmp(event->basename(), name.c_str())) 80 return false; 81 return true; 82} 83 84} // anonymous namespace 85 |
85Object::Object(sc_core::sc_object *_sc_obj) : Object(_sc_obj, "object") {} | 86Object::Object(sc_core::sc_object *_sc_obj) : Object(_sc_obj, nullptr) {} |
86 87Object::Object(sc_core::sc_object *_sc_obj, const char *obj_name) : 88 _sc_obj(_sc_obj), _basename(obj_name ? obj_name : ""), parent(nullptr) 89{ 90 if (_basename == "") | 87 88Object::Object(sc_core::sc_object *_sc_obj, const char *obj_name) : 89 _sc_obj(_sc_obj), _basename(obj_name ? obj_name : ""), parent(nullptr) 90{ 91 if (_basename == "") |
91 _basename = "object"; | 92 _basename = ::sc_core::sc_gen_unique_name("object"); |
92 93 Module *p = currentModule(); 94 if (!p) 95 p = callbackModule(); 96 97 Module *n = newModule(); 98 if (n) { 99 // We are a module in the process of being constructed. --- 200 unchanged lines hidden --- | 93 94 Module *p = currentModule(); 95 if (!p) 96 p = callbackModule(); 97 98 Module *n = newModule(); 99 if (n) { 100 // We are a module in the process of being constructed. --- 200 unchanged lines hidden --- |