32 #ifndef __BASE_TIMEBUF_HH__
33 #define __BASE_TIMEBUF_HH__
119 return wire(
this, i);
132 return wire(
this, i);
146 for (
unsigned i = 0;
i <
size;
i++) {
148 std::memset(ptr, 0,
sizeof(T));
163 for (
unsigned i = 0;
i <
size; ++
i)
164 (reinterpret_cast<T *>(
index[
i]))->~T();
185 if (ptr >= (
int)
size)
187 (
reinterpret_cast<T *
>(
index[ptr]))->~T();
188 std::memset(
index[ptr], 0,
sizeof(T));
200 int vector_index = idx +
base;
201 if (vector_index >= (
int)
size) {
202 vector_index -=
size;
203 }
else if (vector_index < 0) {
204 vector_index +=
size;
215 return reinterpret_cast<T *
>(
index[vector_index]);
222 return reinterpret_cast<T &
>(*
index[vector_index]);
229 return reinterpret_cast<const T &
>(*
index[vector_index]);
236 return wire(
this, idx);
241 return wire(
this, 0);
250 #endif // __BASE_TIMEBUF_HH__
void valid(int idx) const
const wire & operator+=(int offset)
wire(TimeBuffer< T > *buf, int i)
std::vector< char * > index
int calculateVectorIndex(int idx) const
const wire & operator=(const wire &i)
const wire & operator-=(int offset)
const wire & operator=(int idx)