summaryrefslogtreecommitdiff
path: root/src/systemc/ext/core/sc_attr.hh
diff options
context:
space:
mode:
authorGabe Black <gabeblack@google.com>2018-06-22 14:14:47 -0700
committerGabe Black <gabeblack@google.com>2018-09-05 06:00:06 +0000
commit642fa515b822aca10839e0382e3a5d94eca20dd2 (patch)
treefa9adb998dc7aca23c88fbeda8bad48b0a329b0c /src/systemc/ext/core/sc_attr.hh
parentd86151e70ff6046fd1cfadf675d686309271fcf1 (diff)
downloadgem5-642fa515b822aca10839e0382e3a5d94eca20dd2.tar.xz
systemc: Implement the sc_attr classes.
Change-Id: Ibbe6da957b1b36687178f226e80718adc0f4ab81 Reviewed-on: https://gem5-review.googlesource.com/11609 Reviewed-by: Gabe Black <gabeblack@google.com> Maintainer: Gabe Black <gabeblack@google.com>
Diffstat (limited to 'src/systemc/ext/core/sc_attr.hh')
-rw-r--r--src/systemc/ext/core/sc_attr.hh31
1 files changed, 11 insertions, 20 deletions
diff --git a/src/systemc/ext/core/sc_attr.hh b/src/systemc/ext/core/sc_attr.hh
index e1c5ae771..16b0b1bed 100644
--- a/src/systemc/ext/core/sc_attr.hh
+++ b/src/systemc/ext/core/sc_attr.hh
@@ -39,40 +39,32 @@ namespace sc_core
class sc_attr_base
{
public:
- sc_attr_base(const std::string &);
- sc_attr_base(const sc_attr_base &);
+ sc_attr_base(const std::string &_name);
+ sc_attr_base(const sc_attr_base &other);
virtual ~sc_attr_base();
const std::string &name() const;
- protected:
- void warn_unimpl(const char *func);
-
private:
// Disabled
sc_attr_base();
sc_attr_base &operator = (const sc_attr_base &);
+
+ const std::string _name;
};
template <class T>
class sc_attribute : public sc_attr_base
{
public:
- sc_attribute(const std::string &_name) : sc_attr_base(_name)
- {
- warn_unimpl(__PRETTY_FUNCTION__);
- }
+ sc_attribute(const std::string &_name) : sc_attr_base(_name) {}
sc_attribute(const std::string &_name, const T &t) :
sc_attr_base(_name), value(t)
- {
- warn_unimpl(__PRETTY_FUNCTION__);
- }
+ {}
sc_attribute(const sc_attribute<T> &other) :
sc_attr_base(other.name()), value(other.value)
- {
- warn_unimpl(__PRETTY_FUNCTION__);
- }
- virtual ~sc_attribute() { warn_unimpl(__PRETTY_FUNCTION__); }
+ {}
+ virtual ~sc_attribute() {}
T value;
private:
@@ -85,8 +77,8 @@ class sc_attr_cltn
{
public:
typedef sc_attr_base *elem_type;
- typedef elem_type *iterator;
- typedef const elem_type *const_iterator;
+ typedef std::vector<elem_type>::iterator iterator;
+ typedef std::vector<elem_type>::const_iterator const_iterator;
iterator begin();
const_iterator begin() const;
@@ -114,8 +106,7 @@ class sc_attr_cltn
sc_attr_base *remove(const std::string &name);
void remove_all();
-
- int size() const { return cltn.size(); }
+ int size() const;
private:
std::vector<sc_attr_base *> cltn;