29#ifndef __BASE_TIMEBUF_HH__
30#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);
wire(TimeBuffer< T > *buf, int i)
const wire & operator=(int idx)
const wire & operator+=(int offset)
const wire & operator-=(int offset)
const wire & operator=(const wire &i)
std::vector< char * > index
void valid(int idx) const
int calculateVectorIndex(int idx) const
Copyright (c) 2024 - Pranith Kumar Copyright (c) 2020 Inria All rights reserved.