gem5 [DEVELOP-FOR-25.1]
Loading...
Searching...
No Matches
sc_object.cc
Go to the documentation of this file.
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
9 * notice, this list of conditions and the following disclaimer in the
10 * documentation and/or other materials provided with the distribution;
11 * neither the name of the copyright holders nor the names of its
12 * contributors may be used to endorse or promote products derived from
13 * this software without specific prior written permission.
14 *
15 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
16 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
17 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
18 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
19 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
20 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
21 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
22 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
23 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
25 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 */
27
28#include <vector>
29
32
33namespace sc_core
34{
35
36const char *
38{
39 return _gem5_object->name();
40}
41
42const char *
44{
45 return _gem5_object->basename();
46}
47
48void
49sc_object::print(std::ostream &out) const
50{
51 _gem5_object->print(out);
52}
53
54void
55sc_object::dump(std::ostream &out) const
56{
57 _gem5_object->dump(out);
58}
59
62{
63 return _gem5_object->get_child_objects();
64}
65
68{
69 return _gem5_object->get_child_events();
70}
71
74{
75 return _gem5_object->get_parent_object();
76}
77
78bool
80{
81 return _gem5_object->add_attribute(attr);
82}
83
85sc_object::get_attribute(const std::string &name)
86{
87 return _gem5_object->get_attribute(name);
88}
89
92{
93 return _gem5_object->remove_attribute(name);
94}
95
96void
98{
99 return _gem5_object->remove_all_attributes();
100}
101
102int
104{
105 return _gem5_object->num_attributes();
106}
107
110{
111 return _gem5_object->attr_cltn();
112}
113
114const sc_attr_cltn &
116{
117 return _gem5_object->attr_cltn();
118}
119
122{
123 return _gem5_object->simcontext();
124}
125
129
131 : _gem5_object(new sc_gem5::Object(this, name))
132{
133}
134
136 : _gem5_object(new sc_gem5::Object(this, *other._gem5_object))
137{
138}
139
140sc_object &
142{
143 *_gem5_object = *other._gem5_object;
144 return *this;
145}
146
148{
149 delete _gem5_object;
150}
151
157
158sc_object *
160{
162}
163
164} // namespace sc_core
sc_attr_base * get_attribute(const std::string &)
Definition sc_object.cc:85
sc_object * get_parent_object() const
Definition sc_object.cc:73
sc_object & operator=(const sc_object &)
Definition sc_object.cc:141
virtual ~sc_object()
Definition sc_object.cc:147
virtual const std::vector< sc_event * > & get_child_events() const
Definition sc_object.cc:67
const char * name() const
Definition sc_object.cc:37
const char * basename() const
Definition sc_object.cc:43
int num_attributes() const
Definition sc_object.cc:103
sc_gem5::Object * _gem5_object
Definition sc_object.hh:85
bool add_attribute(sc_attr_base &)
Definition sc_object.cc:79
sc_simcontext * simcontext() const
Definition sc_object.cc:121
virtual const std::vector< sc_object * > & get_child_objects() const
Definition sc_object.cc:61
void remove_all_attributes()
Definition sc_object.cc:97
virtual void print(std::ostream &=std::cout) const
Definition sc_object.cc:49
friend class sc_gem5::Object
Definition sc_object.hh:84
sc_attr_cltn & attr_cltn()
Definition sc_object.cc:109
sc_attr_base * remove_attribute(const std::string &)
Definition sc_object.cc:91
virtual void dump(std::ostream &=std::cout) const
Definition sc_object.cc:55
STL vector class.
Definition stl.hh:37
sc_object * sc_find_object(const char *name)
Definition sc_object.cc:159
const std::vector< sc_object * > & sc_get_top_level_objects()
Definition sc_object.cc:153
sc_core::sc_object * findObject(const char *name)
Definition object.cc:309
Objects topLevelObjects
Definition object.cc:91
const std::string & name()
Definition trace.cc:48

Generated on Mon Oct 27 2025 04:13:04 for gem5 by doxygen 1.14.0