40 template <
class BaseType,
class CoType>
43 Active<BaseType, CoType> *a,
49 redundantAge_(0,max-1, 0)
51 n_ = (max < a->number()) ? max : a->number();
53 for (
int i = 0; i < n_; i++)
54 active_[i] =
new PoolSlotRef<BaseType, CoType>(*(a->active_[i]));
58 template <
class BaseType,
class CoType>
59 Active<BaseType, CoType>::Active(
const Active<BaseType, CoType> &rhs)
64 redundantAge_(0, rhs.max()-1, 0)
66 for (
int i = 0; i < n_; i++) {
67 active_[i] =
new PoolSlotRef<BaseType, CoType>(*(rhs.active_[i]));
68 redundantAge_[i] = rhs.redundantAge_[i];
73 template <
class BaseType,
class CoType>
74 Active<BaseType, CoType>::~Active()
76 for (
int i = 0; i < n_; i++)
81 template <
class BaseType,
class CoType>
82 std::ostream &
operator<<(std::ostream &out,
const Active<BaseType, CoType> &rhs)
84 for (
int i = 0; i < rhs.n_; i++) {
86 BaseType *cv = rhs.active_[i]->conVar();
90 out <<
"void" << std::endl;
96 template <
class BaseType,
class CoType>
97 void Active<BaseType, CoType>::insert(PoolSlot<BaseType, CoType> *ps)
101 active_[n_] =
new PoolSlotRef<BaseType, CoType>(ps);
102 redundantAge_[n_] = 0;
107 template <
class BaseType,
class CoType>
108 void Active<BaseType, CoType>::insert(
109 ArrayBuffer<PoolSlot<BaseType, CoType> *> &ps)
111 const int nPs = ps.size();
113 for(
int i = 0; i < nPs; i++)
118 template <
class BaseType,
class CoType>
121 const int nDel = del.size();
123 for(
int i = 0; i < nDel; i++)
124 delete active_[del[i]];
125 active_.leftShift(del);
126 redundantAge_.leftShift(del);
131 template <
class BaseType,
class CoType>
132 void Active<BaseType, CoType>::realloc(
int newSize)
134 active_.resize(newSize);
135 redundantAge_.resize(newSize);