30template <
typename T>
class sc_attribute_randomized :
public sc_core::sc_attribute<T> {
32 sc_attribute_randomized(
const std::string& name_)
33 : sc_core::sc_attribute<T>(name_) {}
35 sc_attribute_randomized(
const std::string& name_,
const T& value_)
36 : sc_core::sc_attribute<T>(name_) {}
38 sc_attribute_randomized(
const sc_core::sc_attribute<T>& a)
39 : sc_core::sc_attribute<T>(a.name()) {}
43 virtual ~sc_attribute_randomized() {}
45 template <
bool cond,
typename U>
using resolvedType =
typename std::enable_if<cond, U>::type;
47 template <
typename U = T> resolvedType<std::is_signed<T>::value, U> get_value() {
54 template <
typename U = T> resolvedType<std::is_unsigned<T>::value, U> get_value() {
return this->value; }