scc 2025.09
SystemC components library
ext_attribute.h
1/*******************************************************************************
2 * Copyright 2017, 2018 MINRES Technologies GmbH
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 *******************************************************************************/
16
17#ifndef _SCC_EXT_ATTRIBUTE_H_
18#define _SCC_EXT_ATTRIBUTE_H_
19
20#include "configurer.h"
21#include "utilities.h"
22
28namespace scc {
39template <typename T> class ext_attribute : public sc_core::sc_attribute<T> {
40public:
41 using base_type = sc_core::sc_attribute<T>;
48 ext_attribute(const std::string& name_, sc_core::sc_module* owner)
49 : base_type(name_)
50 , owner(owner) {
51 owner->add_attribute(*this);
53 }
54
61 ext_attribute(const std::string& name_, const T& value_, sc_core::sc_module* owner)
62 : base_type(name_, value_)
63 , owner(owner) {
64 owner->add_attribute(*this);
66 }
67
72 ext_attribute(const ext_attribute<T>& a) = delete;
76 ~ext_attribute() = default;
80 const sc_core::sc_module* owner;
81};
82}; // namespace scc // end of scc-sysc
84#endif /* _SYSC_EXT_ATTRIBUTE_H_ */
void set_configuration_value(sc_core::sc_attr_base *attr_base, sc_core::sc_object *owner)
static configurer & get()
Definition configurer.h:139
ext_attribute(const ext_attribute< T > &a)=delete
~ext_attribute()=default
ext_attribute(const std::string &name_, const T &value_, sc_core::sc_module *owner)
ext_attribute(const std::string &name_, sc_core::sc_module *owner)
const sc_core::sc_module * owner
SCC TLM utilities.