12 #ifndef SSTMAC_SOFTWARE_PROCESS_GLOBAL_PTR_ARRAY_H_INCLUDED 13 #define SSTMAC_SOFTWARE_PROCESS_GLOBAL_PTR_ARRAY_H_INCLUDED 20 template<
typename T,
int N>
25 typedef spkt_unordered_map<long, T*>
val_map;
35 "sstmac_global*::check_init: trying to access index %d outside of array size %d",
39 if (vals_[n].find(ptxt) == vals_[n].end()) {
40 vals_[n][ptxt] = init_;
71 "sstmac_global*::get_val: trying to access index %d outside of array size %d",
75 val_map& vals =
const_cast<val_map&
> (vals_[n]);
77 typename val_map::iterator it = vals.find(ptxt);
78 if (it == vals.end()) {
79 T*& ret = vals[ptxt] = init_;
86 return const_cast<T*&
> (init_);
99 T*& myval = get_val();
107 T*& myval = get_val();
151 return (
char*) get_val();
155 return (
int*) get_val();
159 return (
long*) get_val();
163 return (
void*) get_val();
166 operator const char*()
const {
167 return (
const char*) get_val();
170 operator const int*()
const {
171 return (
const int*) get_val();
174 operator const long*()
const {
175 return (
const long*) get_val();
178 operator const void*()
const {
179 return (
const void*) get_val();
190 T* myval = get_val();
191 T* otherval = (T*) b;
192 return myval == otherval;
T * operator+(const U &b)
T *& operator[](long idx)
sstmac_global_builtin_arr()
virtual T *& get_val(int n=0) const
val_map::const_iterator const_iterator
bool check_init(process_context ptxt, int n=0)
virtual ~sstmac_global_builtin_arr()
spkt_unordered_map< long, T * > val_map
parallel_runtime * init()
SUMI = Simulator unified messagine interface It is also the name for a solid ink in Japanese - i...
#define spkt_throw_printf(exc, template_str,...)
sstmac_global_builtin_arr(T *init)
virtual std::string to_string() const
T * operator++(int dummy)
bool operator==(const software_id &a, const software_id &b)
T * operator-(const U &b)
T * operator--(int dummy)
T *& operator=(const sstmac_global_builtin< U > &b)
Error indicating some internal value was unexpected.