template <typename T>
inline void
-_format_char(std::ostream &out, const T& data, Format &fmt)
+_format_char(std::ostream &out, const T &data, Format &fmt)
{
using namespace std;
template <typename T>
inline void
-_format_integer(std::ostream &out, const T& data, Format &fmt)
+_format_integer(std::ostream &out, const T &data, Format &fmt)
{
using namespace std;
template <typename T>
inline void
-_format_float(std::ostream &out, const T& data, Format &fmt)
+_format_float(std::ostream &out, const T &data, Format &fmt)
{
using namespace std;
template <typename T>
inline void
-_format_string(std::ostream &out, const T& data, Format &fmt)
+_format_string(std::ostream &out, const T &data, Format &fmt)
{
using namespace std;
//
template <typename T>
inline void
-format_char(std::ostream &out, const T& data, Format &fmt)
+format_char(std::ostream &out, const T &data, Format &fmt)
{ out << "<bad arg type for char format>"; }
inline void
//
template <typename T>
inline void
-format_float(std::ostream &out, const T& data, Format &fmt)
+format_float(std::ostream &out, const T &data, Format &fmt)
{ out << "<bad arg type for float format>"; }
inline void
//
template <typename T>
inline void
-format_string(std::ostream &out, const T& data, Format &fmt)
+format_string(std::ostream &out, const T &data, Format &fmt)
{ _format_string(out, data, fmt); }
inline void
Range(const Range &r) { operator=(r); }
- Range(const T& s, const T& e)
+ Range(const T &s, const T &e)
: start(s), end(e)
{
valid = (start <= end);
public:
RefCountingPtr() : data(NULL) {}
RefCountingPtr(T *data) { copy(data); }
- RefCountingPtr(const RefCountingPtr& r) { copy(r.data); }
+ RefCountingPtr(const RefCountingPtr &r) { copy(r.data); }
~RefCountingPtr() { del(); }
T *operator->() { return data; }
return *this;
}
- RefCountingPtr &operator=(const RefCountingPtr& r) {
+ RefCountingPtr &operator=(const RefCountingPtr &r) {
if (data != r.data) {
del();
copy(r.data);
iterator prev(void) { return iterator(p->prev); }
bool operator== (iterator x) { return (x.p == this->p); }
bool operator != (iterator x) { return (x.p != this->p); }
- T& operator * (void) { return *(p->data); }
+ T &operator * (void) { return *(p->data); }
T* operator -> (void) { return p->data; }
bool isnull(void) { return (p==0); }
bool notnull(void) { return (p!=0); }
* @param v The new value.
*/
template <typename U>
- void operator=(const U& v) { data()->set(v, params); }
+ void operator=(const U &v) { data()->set(v, params); }
/**
* Increment the stat by the given value. This calls the associated
* @param v The value to add.
*/
template <typename U>
- void operator+=(const U& v) { data()->inc(v, params); }
+ void operator+=(const U &v) { data()->inc(v, params); }
/**
* Decrement the stat by the given value. This calls the associated
* @param v The value to substract.
*/
template <typename U>
- void operator-=(const U& v) { data()->dec(v, params); }
+ void operator-=(const U &v) { data()->dec(v, params); }
/**
* Return the number of elements, always 1 for a scalar.
* @param v The new value.
*/
template <typename U>
- void operator=(const U& v) { data()->set(v, *params); }
+ void operator=(const U &v) { data()->set(v, *params); }
/**
* Increment the stat by the given value. This calls the associated
* @param v The value to add.
*/
template <typename U>
- void operator+=(const U& v) { data()->inc(v, *params); }
+ void operator+=(const U &v) { data()->inc(v, *params); }
/**
* Decrement the stat by the given value. This calls the associated
* @param v The value to substract.
*/
template <typename U>
- void operator-=(const U& v) { data()->dec(v, *params); }
+ void operator-=(const U &v) { data()->dec(v, *params); }
/**
* Return the number of elements, always 1 for a scalar.
* @param number The number of times to add the value.
* @param p The paramters of the distribution.
*/
- void sample(T val, int number, const Params& p)
+ void sample(T val, int number, const Params &p)
{
T value = val * number;
sum += value;
* @param n The number of times to add it, defaults to 1.
*/
template <typename U>
- void sample(const U& v, int n = 1) { data()->sample(v, n, params); }
+ void sample(const U &v, int n = 1) { data()->sample(v, n, params); }
/**
* Return the number of entries in this stat.
public:
template <typename U>
- void sample(const U& v, int n = 1) { data()->sample(v, n, cstat->params); }
+ void sample(const U &v, int n = 1) { data()->sample(v, n, cstat->params); }
size_t size() const { return 1; }
bool zero() const { return data()->zero(cstat->params); }
* @param v The new value.
*/
template <typename U>
- void operator=(const U& v) { Base::operator=(v); }
+ void operator=(const U &v) { Base::operator=(v); }
};
/**
* @param v The new value.
*/
template <typename U>
- void operator=(const U& v) { Base::operator=(v); }
+ void operator=(const U &v) { Base::operator=(v); }
};
/**
template <class T>
inline std::string
-to_string(const T& value)
+to_string(const T &value)
{
std::stringstream str;
str << value;
#endif
template <class T>
- Fault read(MemReqPtr &req, T& data)
+ Fault read(MemReqPtr &req, T &data)
{
#if defined(TARGET_ALPHA) && defined(FULL_SYSTEM)
if (req->flags & LOCKED) {
}
template <class T>
- Fault write(MemReqPtr &req, T& data)
+ Fault write(MemReqPtr &req, T &data)
{
#if defined(TARGET_ALPHA) && defined(FULL_SYSTEM)
// precise architected memory state accessor macros
template <class T>
Fault
-SimpleCPU::read(Addr addr, T& data, unsigned flags)
+SimpleCPU::read(Addr addr, T &data, unsigned flags)
{
memReq->reset(addr, sizeof(T), flags);
virtual void unserialize(Checkpoint *cp, const std::string §ion);
template <class T>
- Fault read(Addr addr, T& data, unsigned flags);
+ Fault read(Addr addr, T &data, unsigned flags);
template <class T>
Fault write(T data, Addr addr, unsigned flags,
template <class T>
void
-paramOut(ostream &os, const std::string &name, const T& param)
+paramOut(ostream &os, const std::string &name, const T ¶m)
{
os << name << "=";
showParam(os, param);
template <class T>
void
paramIn(Checkpoint *cp, const std::string §ion,
- const std::string &name, T& param)
+ const std::string &name, T ¶m)
{
std::string str;
if (!cp->find(section, name, str) || !parseParam(str, param)) {
class Checkpoint;
template <class T>
-void paramOut(std::ostream &os, const std::string &name, const T& param);
+void paramOut(std::ostream &os, const std::string &name, const T ¶m);
template <class T>
void paramIn(Checkpoint *cp, const std::string §ion,
- const std::string &name, T& param);
+ const std::string &name, T ¶m);
template <class T>
void arrayParamOut(std::ostream &os, const std::string &name,
operator T*() { return (T *)bufPtr; }
// dereference operators
- T& operator*() { return *((T *)bufPtr); }
+ T &operator*() { return *((T *)bufPtr); }
T* operator->() { return (T *)bufPtr; }
- T& operator[](int i) { return ((T *)bufPtr)[i]; }
+ T &operator[](int i) { return ((T *)bufPtr)[i]; }
};
//////////////////////////////////////////////////////////////////////