gem5  v22.1.0.0
sc_vector.hh
Go to the documentation of this file.
1 /*****************************************************************************
2 
3  Licensed to Accellera Systems Initiative Inc. (Accellera) under one or
4  more contributor license agreements. See the NOTICE file distributed
5  with this work for additional information regarding copyright ownership.
6  Accellera licenses this file to you under the Apache License, Version 2.0
7  (the "License"); you may not use this file except in compliance with the
8  License. You may obtain a copy of the License at
9 
10  http://www.apache.org/licenses/LICENSE-2.0
11 
12  Unless required by applicable law or agreed to in writing, software
13  distributed under the License is distributed on an "AS IS" BASIS,
14  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
15  implied. See the License for the specific language governing
16  permissions and limitations under the License.
17 
18  *****************************************************************************/
19 
20 /*
21  * Copyright 2018 Google, Inc.
22  *
23  * Redistribution and use in source and binary forms, with or without
24  * modification, are permitted provided that the following conditions are
25  * met: redistributions of source code must retain the above copyright
26  * notice, this list of conditions and the following disclaimer;
27  * redistributions in binary form must reproduce the above copyright
28  * notice, this list of conditions and the following disclaimer in the
29  * documentation and/or other materials provided with the distribution;
30  * neither the name of the copyright holders nor the names of its
31  * contributors may be used to endorse or promote products derived from
32  * this software without specific prior written permission.
33  *
34  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
35  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
36  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
37  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
38  * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
39  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
40  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
41  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
42  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
43  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
44  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
45  */
46 
47 #ifndef __SYSTEMC_EXT_UTIL_SC_VECTOR_HH__
48 #define __SYSTEMC_EXT_UTIL_SC_VECTOR_HH__
49 
50 #include <stdint.h>
51 
52 #include <exception>
53 #include <iterator>
54 #include <vector>
55 
56 #include "../core/sc_module.hh"
57 #include "../core/sc_object.hh"
58 #include "messages.hh"
59 
60 namespace sc_gem5
61 {
62 
63 // Goop for supporting sc_vector_iter, simplified from the Accellera version.
64 
65 #if __cplusplus >= 201103L
66 
67 using std::enable_if;
68 using std::remove_const;
69 using std::is_same;
70 using std::is_const;
71 
72 #else
73 
74 template<bool Cond, typename T=void>
75 struct enable_if
76 {};
77 
78 template<typename T>
79 struct enable_if<true, T>
80 {
81  typedef T type;
82 };
83 
84 template <typename T>
86 {
87  typedef T type;
88 };
89 template <typename T>
90 struct remove_const<const T>
91 {
92  typedef T type;
93 };
94 
95 template <typename T, typename U>
96 struct is_same
97 {
98  static const bool value = false;
99 };
100 template <typename T>
101 struct is_same<T, T>
102 {
103  static const bool value = true;
104 };
105 
106 template <typename T>
107 struct is_const
108 {
109  static const bool value = false;
110 };
111 template <typename T>
112 struct is_const<const T>
113 {
114  static const bool value = true;
115 };
116 
117 #endif
118 
119 template <typename CT, typename T>
121 {
122  static const bool value =
124  typename remove_const<T>::type>::value &&
126 };
127 
129 {};
130 
131 template <typename T>
133 {};
134 
135 template <typename T>
137 {
138  typedef T type;
139 };
140 
141 #define SC_RPTYPE_(Type) \
142  ::sc_gem5::remove_special_fptr< \
143  ::sc_gem5::special_result & (*) Type>::type::value
144 
145 #define SC_ENABLE_IF_(Cond) \
146  typename ::sc_gem5::enable_if<SC_RPTYPE_(Cond)>::type * = NULL
147 
148 } // namespace sc_gem5
149 
150 namespace sc_core
151 {
152 
153 template <typename T, typename MT>
154 class sc_vector_assembly;
155 
156 template <typename T>
157 class sc_vector;
158 
159 template <typename T, typename MT>
161  sc_vector<T> &, MT(T::* member_ptr));
162 
163 class sc_vector_base : public sc_object
164 {
165  public:
166  typedef size_t size_type;
167 
168  sc_vector_base(const char *_name) : sc_object(_name) {}
169 
170  virtual const char *kind() const { return "sc_vector"; }
171  size_type size() const;
172  const std::vector<sc_object *> &get_elements() const;
173 
174  protected:
176 
177  // What's returned by get_elements, which really returns the elemenets
178  // which are also objects.
180 
181  sc_object *implicitCast(sc_object *p) const { return p; }
183  {
185  return nullptr;
186  }
187  virtual sc_object *objectCast(void *) const = 0;
188 
189  void checkIndex(size_type index) const;
190  void forceParent() const;
191  void unforceParent() const;
192 
193  void reportEmpty(const char *kind_, bool empty_dest) const;
194 };
195 
196 
197 /*
198  * Non-standard iterator access adapters. Without using these, the classes as
199  * defined in the standard won't compile because of redundant bind() overloads.
200  */
201 
202 template <typename Element>
204 {
205  public:
206  typedef Element ElementType;
207  typedef ElementType Type;
209 
213 
216 
217  template <typename U>
218  sc_direct_access(const U &,
219  SC_ENABLE_IF_((
221  ElementType, typename U::Policy::ElementType>
222  ))
223  )
224  {}
225 
226  ElementType *
227  get(ElementType *this_) const
228  {
229  return this_;
230  }
231 };
232 
233 template <typename Element, typename Access>
235 {
236  public:
237  template <typename, typename>
238  friend class sc_member_access;
239 
240  typedef Element ElementType;
243  typedef AccessType Type;
246 
250 
252  sc_member_access(const NonConstPolicy &other) : ptr_(other.ptr_) {}
253 
254  AccessType *get(ElementType *this_) const { return &(this_->*ptr_); }
255 
256  private:
258 };
259 
260 template <typename Element,
261  typename AccessPolicy=sc_direct_access<Element> >
263  public std::iterator<std::random_access_iterator_tag,
264  typename AccessPolicy::Type>,
265  private AccessPolicy
266 {
267  private:
268  typedef Element ElementType;
269  typedef typename AccessPolicy::Policy Policy;
270  typedef typename AccessPolicy::NonConstPolicy NonConstPolicy;
271  typedef typename AccessPolicy::ConstPolicy ConstPolicy;
272  typedef typename Policy::Type AccessType;
273 
275  typedef const PlainType ConstPlainType;
278 
279  friend class sc_vector<PlainType>;
280  template <typename, typename>
281  friend class sc_vector_assembly;
282  template <typename, typename>
283  friend class sc_vector_iter;
284 
285  typedef std::iterator<std::random_access_iterator_tag, AccessType>
290 
291  template <typename U>
292  struct SelectIter
293  {
295  };
296  template <typename U>
297  struct SelectIter<const U>
298  {
300  };
305 
307 
309  Policy(acc), it_(it)
310  {}
311 
312  Policy const &get_policy() const { return *this; }
313 
314  public:
315  // Conforms to Random Access Iterator category.
316  // See ISO/IEC 14882:2003(E), 24.1 [lib.iterator.requirements]
317 
318  typedef typename BaseType::difference_type difference_type;
319  typedef typename BaseType::reference reference;
320  typedef typename BaseType::pointer pointer;
321 
323 
324  template <typename It>
325  sc_vector_iter(const It &it,
326  SC_ENABLE_IF_((
328  ElementType, typename It::Policy::ElementType>
329  ))
330  ) : Policy(it.get_policy()), it_(it.it_)
331  {}
332 
333  ThisType &
335  {
336  ++it_;
337  return *this;
338  }
339  ThisType &
341  {
342  --it_;
343  return *this;
344  }
345  ThisType
347  {
348  ThisType old(*this);
349  ++it_;
350  return old;
351  }
352  ThisType
354  {
355  ThisType old(*this);
356  --it_;
357  return old;
358  }
359 
360  ThisType
362  {
363  return ThisType(it_ + n, get_policy());
364  }
365  ThisType
367  {
368  return ThisType(it_ - n, get_policy());
369  }
370 
371  ThisType &
373  {
374  it_ += n;
375  return *this;
376  }
377 
378  ThisType &
380  {
381  it_ -= n;
382  return *this;
383  }
384 
385  bool
386  operator == (const ConstDirectIterator &other) const
387  {
388  return it_ == other.it_;
389  }
390  bool
391  operator != (const ConstDirectIterator &other) const
392  {
393  return it_ != other.it_;
394  }
395  bool
396  operator <= (const ConstDirectIterator &other) const
397  {
398  return it_ <= other.it_;
399  }
400  bool
401  operator >= (const ConstDirectIterator &other) const
402  {
403  return it_ >= other.it_;
404  }
405  bool
406  operator < (const ConstDirectIterator &other) const
407  {
408  return it_ < other.it_;
409  }
410  bool
411  operator > (const ConstDirectIterator &other) const
412  {
413  return it_ > other.it_;
414  }
415 
416  reference
417  operator * () const
418  {
419  return *Policy::get(static_cast<ElementType *>((void *)*it_));
420  }
421  pointer
422  operator -> () const
423  {
424  return Policy::get(static_cast<ElementType *>((void *)*it_));
425  }
426  reference
428  {
429  return *Policy::get(static_cast<ElementType *>((void *)it_[n]));
430  }
431 
433  operator - (ConstDirectIterator const &other) const
434  {
435  return it_ - other.it_;
436  }
437 };
438 
439 template <typename T>
440 class sc_vector : public sc_vector_base
441 {
442  public:
446 
448  explicit sc_vector(const char *_name) : sc_vector_base(_name) {}
449  sc_vector(const char *_name, size_type _size) : sc_vector_base(_name)
450  {
451  init(_size);
452  }
453  template <typename Creator>
454  sc_vector(const char *_name, size_type _size, Creator creator) :
455  sc_vector_base(_name)
456  {
457  init(_size, creator);
458  }
459  virtual ~sc_vector() { clear(); }
460 
461  void
463  {
465  }
466  static T *
467  create_element(const char *_name, size_type index)
468  {
469  return new T(_name);
470  }
471 
472  template <typename Creator>
473  void
474  init(size_type _size, Creator creator)
475  {
476  forceParent();
477  try {
478  for (size_type i = 0; i < _size; i++) {
479  // XXX The name and scope of these objects needs to be handled
480  // specially.
481  T *p = creator(sc_gen_unique_name(basename()), i);
482  objs.push_back(p);
483  }
484  } catch (...) {
485  unforceParent();
486  clear();
487  throw;
488  }
489  unforceParent();
490  }
491 
492  T &operator [] (size_type index) { return *static_cast<T *>(objs[index]); }
493  const T &
495  {
496  return *static_cast<const T *>(objs[index]);
497  }
498 
499  T &
501  {
502  this->checkIndex(index);
503  return *static_cast<T *>(objs[index]);
504  }
505  const T &
507  {
508  this->checkIndex(index);
509  return *static_cast<const T *>(objs[index]);
510  }
511 
512  iterator begin() { return objs.begin(); }
513  iterator end() { return objs.end(); }
514  const_iterator begin() const { return objs.begin(); }
515  const_iterator end() const { return objs.end(); }
516  const_iterator cbegin() const { return objs.begin(); }
517  const_iterator cend() const { return objs.end(); }
518 
519  template <typename ContainerType, typename ArgumentType>
520  iterator
522  {
523  return bind(c.begin(), c.end());
524  }
525 
526  template <typename BindableContainer>
527  iterator
528  bind(BindableContainer &c)
529  {
530  return bind(c.begin(), c.end());
531  }
532 
533  template <typename BindableIterator>
534  iterator
535  bind(BindableIterator first, BindableIterator last)
536  {
537  return bind(first, last, this->begin());
538  }
539 
540  template <typename BindableIterator>
541  iterator
542  bind(BindableIterator first, BindableIterator last, iterator from)
543  {
544  if (!size() || from == end() || first == last)
545  reportEmpty(kind(), from == end());
546 
547  while (from != end() && first != last)
548  (*from++).bind(*first++);
549  return from;
550  }
551 
552  template <typename ContainerType, typename ArgumentType>
553  iterator
555  {
556  return (*this)(c.begin(), c.end());
557  }
558 
559  template <typename ArgumentContainer>
560  iterator
561  operator () (ArgumentContainer &c)
562  {
563  return (*this)(c.begin(), c.end());
564  }
565 
566  template <typename ArgumentIterator>
567  iterator
568  operator () (ArgumentIterator first, ArgumentIterator last)
569  {
570  return (*this)(first, last, this->begin());
571  }
572 
573  template <typename ArgumentIterator>
574  iterator
575  operator () (ArgumentIterator first, ArgumentIterator last, iterator from)
576  {
577  if (!size() || from == end() || first == last)
578  reportEmpty(kind(), from == end());
579 
580  while (from != end() && first != last)
581  (*from++)(*first++);
582  return from;
583  }
584 
585  private:
586  // Disabled
589 
590  void
592  {
593  for (auto obj: objs)
594  delete static_cast<T *>(obj);
595  }
596 
597  template <typename, typename>
598  friend class sc_vector_assembly;
599 
600  sc_object *
601  objectCast(void *ptr) const
602  {
603  return implicitCast(static_cast<T *>(ptr));
604  }
605 };
606 
607 template <typename T, typename MT>
609 {
610  public:
611  friend sc_vector_assembly<T, MT> sc_assemble_vector<>(
612  sc_vector<T> &, MT (T::*));
613 
614  typedef size_t size_type;
616  typedef sc_vector_iter<
618  typedef MT (T::*MemberType);
619 
621  vec_(other.vec_), ptr_(other.ptr_)
622  {}
623 
624  iterator begin() { return iterator(vec_->begin().it_, ptr_); }
625  iterator end() { return iterator(vec_->end().it_, ptr_); }
626 
628  cbegin() const
629  {
630  return const_iterator(vec_->begin().it_, ptr_);
631  }
633  cend() const
634  {
635  return const_iterator(vec_->end().it_, ptr_);
636  }
637 
639  begin() const
640  {
641  return const_iterator(vec_->begin().it_, ptr_);
642  }
644  end() const
645  {
646  return const_iterator(vec_->end().it_, ptr_);
647  }
648 
649  size_type size() const { return vec_->size(); }
650 
652  get_elements() const
653  {
655  for (const_iterator it = begin(); it != end(); it++) {
656  sc_object *obj_ptr = vec_->objectCast(const_cast<MT *>(&*it));
657 
658  if (obj_ptr)
659  ret.push_back(obj_ptr);
660  }
661  return ret;
662  }
663 
664  typename iterator::reference
666  {
667  return (*vec_)[i].*ptr_;
668  }
671  {
672  return (*vec_)[i].*ptr_;
673  }
674 
675  typename iterator::reference
677  {
678  return vec_->at(i).*ptr_;
679  }
681  at(size_type i) const
682  {
683  return vec_->at(i).*ptr_;
684  }
685 
686  template <typename ContainerType, typename ArgumentType>
687  iterator
689  {
690  return bind(c.begin(), c.end());
691  }
692 
693  template <typename BindableContainer>
694  iterator
695  bind(BindableContainer &c)
696  {
697  return bind(c.begin(), c.end());
698  }
699 
700  template <typename BindableIterator>
701  iterator
702  bind(BindableIterator first, BindableIterator last)
703  {
704  return bind(first, last, this->begin());
705  }
706 
707  template <typename BindableIterator>
708  iterator
709  bind(BindableIterator first, BindableIterator last, iterator from)
710  {
711  if (!size() || from == end() || first == last)
712  vec_->reportEmpty("sc_vector_assembly", from == end());
713 
714  while (from != end() && first != last)
715  (*from++).bind(*first++);
716  return from;
717  }
718 
719  template <typename BindableIterator>
720  iterator
721  bind(BindableIterator first, BindableIterator last,
722  typename sc_vector<T>::iterator from)
723  {
724  return bind(first, last, iterator(from.it_, ptr_));
725  }
726 
727  template <typename ContainerType, typename ArgumentType>
728  iterator
730  {
731  return (*this)(c.begin(), c.end());
732  }
733 
734  template <typename ArgumentContainer>
735  iterator
736  operator () (ArgumentContainer &c)
737  {
738  return (*this)(c.begin(), c.end());
739  }
740 
741  template <typename ArgumentIterator>
742  iterator
743  operator () (ArgumentIterator first, ArgumentIterator last)
744  {
745  return (*this)(first, last, this->begin());
746  }
747 
748  template <typename ArgumentIterator>
749  iterator
750  operator () (ArgumentIterator first, ArgumentIterator last, iterator from)
751  {
752  if (!size() || from == end() || first == last)
753  vec_->reportEmpty("sc_vector_assembly", from == end());
754 
755  while (from != end() && first != last)
756  (*from++)(*first++);
757  return from;
758  }
759 
760  template <typename ArgumentIterator>
761  iterator
762  operator () (ArgumentIterator first, ArgumentIterator last,
763  typename sc_vector<T>::iterator from)
764  {
765  return (*this)(first, last, iterator(from.it_, ptr_));
766  }
767 
768  private:
770  vec_(&v), ptr_(ptr)
771  {}
772 
775 };
776 
777 template <typename T, typename MT>
780 {
781  return sc_vector_assembly<T, MT>(v, ptr);
782 }
783 
784 } // namespace sc_core
785 
786 #endif //__SYSTEMC_EXT_UTIL_SC_VECTOR_HH__
sc_direct_access(const U &, SC_ENABLE_IF_((sc_gem5::is_more_const< ElementType, typename U::Policy::ElementType >)))
Definition: sc_vector.hh:218
sc_gem5::remove_const< ElementType >::type PlainType
Definition: sc_vector.hh:208
sc_direct_access(const NonConstPolicy &)
Definition: sc_vector.hh:215
sc_direct_access< ElementType > Policy
Definition: sc_vector.hh:210
ElementType * get(ElementType *this_) const
Definition: sc_vector.hh:227
sc_direct_access< PlainType > NonConstPolicy
Definition: sc_vector.hh:211
sc_direct_access< const PlainType > ConstPolicy
Definition: sc_vector.hh:212
AccessTypeElementType::* MemberType
Definition: sc_vector.hh:242
sc_member_access(const NonConstPolicy &other)
Definition: sc_vector.hh:252
sc_member_access< ElementType, AccessType > Policy
Definition: sc_vector.hh:247
sc_member_access< PlainElemType, PlainType > NonConstPolicy
Definition: sc_vector.hh:248
sc_gem5::remove_const< ElementType >::type PlainElemType
Definition: sc_vector.hh:245
sc_member_access< const PlainElemType, const PlainType > ConstPolicy
Definition: sc_vector.hh:249
sc_gem5::remove_const< AccessType >::type PlainType
Definition: sc_vector.hh:244
sc_member_access(MemberType ptr)
Definition: sc_vector.hh:251
AccessType * get(ElementType *this_) const
Definition: sc_vector.hh:254
const char * name() const
Definition: sc_object.cc:44
const char * basename() const
Definition: sc_object.cc:50
iterator bind(sc_vector_assembly< ContainerType, ArgumentType > c)
Definition: sc_vector.hh:688
const_iterator cbegin() const
Definition: sc_vector.hh:628
iterator bind(BindableContainer &c)
Definition: sc_vector.hh:695
iterator operator()(sc_vector_assembly< ContainerType, ArgumentType > c)
Definition: sc_vector.hh:729
iterator bind(BindableIterator first, BindableIterator last, iterator from)
Definition: sc_vector.hh:709
const_iterator cend() const
Definition: sc_vector.hh:633
sc_vector_assembly(sc_vector< T > &v, MemberType ptr)
Definition: sc_vector.hh:769
iterator bind(BindableIterator first, BindableIterator last, typename sc_vector< T >::iterator from)
Definition: sc_vector.hh:721
sc_vector_iter< const T, sc_member_access< const T, const MT > > const_iterator
Definition: sc_vector.hh:617
sc_vector< T > * vec_
Definition: sc_vector.hh:773
const_iterator end() const
Definition: sc_vector.hh:644
iterator::reference operator[](size_type i)
Definition: sc_vector.hh:665
size_type size() const
Definition: sc_vector.hh:649
iterator::reference at(size_type i)
Definition: sc_vector.hh:676
const_iterator::reference at(size_type i) const
Definition: sc_vector.hh:681
std::vector< sc_object * > get_elements() const
Definition: sc_vector.hh:652
iterator bind(BindableIterator first, BindableIterator last)
Definition: sc_vector.hh:702
const_iterator begin() const
Definition: sc_vector.hh:639
sc_vector_iter< T, sc_member_access< T, MT > > iterator
Definition: sc_vector.hh:615
sc_vector_assembly(const sc_vector_assembly &other)
Definition: sc_vector.hh:620
sc_object * implicitCast(...) const
Definition: sc_vector.hh:182
virtual sc_object * objectCast(void *) const =0
sc_vector_base(const char *_name)
Definition: sc_vector.hh:168
size_type size() const
Definition: sc_vector.cc:58
void forceParent() const
Definition: sc_vector.cc:84
void unforceParent() const
Definition: sc_vector.cc:90
void reportEmpty(const char *kind_, bool empty_dest) const
Definition: sc_vector.cc:96
std::vector< void * > objs
Definition: sc_vector.hh:175
void checkIndex(size_type index) const
Definition: sc_vector.cc:73
const std::vector< sc_object * > & get_elements() const
Definition: sc_vector.cc:61
sc_object * implicitCast(sc_object *p) const
Definition: sc_vector.hh:181
std::vector< sc_object * > elements
Definition: sc_vector.hh:179
virtual const char * kind() const
Definition: sc_vector.hh:170
sc_vector_iter(const It &it, SC_ENABLE_IF_((sc_gem5::is_more_const< ElementType, typename It::Policy::ElementType >)))
Definition: sc_vector.hh:325
const PlainType ConstPlainType
Definition: sc_vector.hh:275
BaseType::reference reference
Definition: sc_vector.hh:319
sc_vector_iter< ConstPlainType, ConstDirectPolicy > ConstDirectIterator
Definition: sc_vector.hh:304
sc_vector< PlainType > VectorType
Definition: sc_vector.hh:288
reference operator[](difference_type n) const
Definition: sc_vector.hh:427
bool operator<(const ConstDirectIterator &other) const
Definition: sc_vector.hh:406
bool operator>(const ConstDirectIterator &other) const
Definition: sc_vector.hh:411
std::iterator< std::random_access_iterator_tag, AccessType > BaseType
Definition: sc_vector.hh:286
pointer operator->() const
Definition: sc_vector.hh:422
BaseType::difference_type difference_type
Definition: sc_vector.hh:318
std::vector< void * > StorageType
Definition: sc_vector.hh:289
ThisType & operator--()
Definition: sc_vector.hh:340
sc_vector_iter ThisType
Definition: sc_vector.hh:287
SelectIter< ElementType >::type RawIterator
Definition: sc_vector.hh:301
sc_vector_iter(RawIterator it, Policy acc=Policy())
Definition: sc_vector.hh:308
AccessPolicy::Policy Policy
Definition: sc_vector.hh:269
ThisType operator+(difference_type n) const
Definition: sc_vector.hh:361
ThisType & operator-=(difference_type n)
Definition: sc_vector.hh:379
ThisType operator-(difference_type n) const
Definition: sc_vector.hh:366
Policy::Type AccessType
Definition: sc_vector.hh:272
sc_gem5::remove_const< ElementType >::type PlainType
Definition: sc_vector.hh:274
bool operator<=(const ConstDirectIterator &other) const
Definition: sc_vector.hh:396
AccessPolicy::NonConstPolicy NonConstPolicy
Definition: sc_vector.hh:270
bool operator>=(const ConstDirectIterator &other) const
Definition: sc_vector.hh:401
ThisType & operator++()
Definition: sc_vector.hh:334
bool operator!=(const ConstDirectIterator &other) const
Definition: sc_vector.hh:391
Policy const & get_policy() const
Definition: sc_vector.hh:312
BaseType::pointer pointer
Definition: sc_vector.hh:320
sc_vector_iter< ConstPlainType, ConstPolicy > ConstIterator
Definition: sc_vector.hh:302
ThisType & operator+=(difference_type n)
Definition: sc_vector.hh:372
sc_direct_access< PlainType >::ConstPolicy ConstDirectPolicy
Definition: sc_vector.hh:277
AccessPolicy::ConstPolicy ConstPolicy
Definition: sc_vector.hh:271
bool operator==(const ConstDirectIterator &other) const
Definition: sc_vector.hh:386
reference operator*() const
Definition: sc_vector.hh:417
T & at(size_type index)
Definition: sc_vector.hh:500
sc_vector & operator=(const sc_vector &)
sc_vector(const char *_name, size_type _size, Creator creator)
Definition: sc_vector.hh:454
iterator bind(BindableIterator first, BindableIterator last, iterator from)
Definition: sc_vector.hh:542
iterator bind(sc_vector_assembly< ContainerType, ArgumentType > c)
Definition: sc_vector.hh:521
virtual ~sc_vector()
Definition: sc_vector.hh:459
static T * create_element(const char *_name, size_type index)
Definition: sc_vector.hh:467
const_iterator cbegin() const
Definition: sc_vector.hh:516
void init(size_type _size)
Definition: sc_vector.hh:462
sc_vector(const char *_name, size_type _size)
Definition: sc_vector.hh:449
sc_object * objectCast(void *ptr) const
Definition: sc_vector.hh:601
iterator bind(BindableContainer &c)
Definition: sc_vector.hh:528
const T & at(size_type index) const
Definition: sc_vector.hh:506
iterator begin()
Definition: sc_vector.hh:512
iterator end()
Definition: sc_vector.hh:513
void init(size_type _size, Creator creator)
Definition: sc_vector.hh:474
sc_vector_iter< T > iterator
Definition: sc_vector.hh:444
T & operator[](size_type index)
Definition: sc_vector.hh:492
iterator bind(BindableIterator first, BindableIterator last)
Definition: sc_vector.hh:535
sc_vector_iter< const T > const_iterator
Definition: sc_vector.hh:445
const_iterator end() const
Definition: sc_vector.hh:515
const_iterator begin() const
Definition: sc_vector.hh:514
const_iterator cend() const
Definition: sc_vector.hh:517
sc_vector(const sc_vector &)
iterator operator()(sc_vector_assembly< ContainerType, ArgumentType > c)
Definition: sc_vector.hh:554
sc_vector(const char *_name)
Definition: sc_vector.hh:448
STL vector class.
Definition: stl.hh:37
Bitfield< 31 > n
Definition: misc_types.hh:462
Bitfield< 7 > i
Definition: misc_types.hh:67
Bitfield< 30, 0 > index
Bitfield< 0 > v
Definition: pagetable.hh:65
Bitfield< 2 > c
Definition: pagetable.hh:63
Bitfield< 54 > p
Definition: pagetable.hh:70
const char SC_ID_VECTOR_NONOBJECT_ELEMENTS_[]
Definition: messages.cc:54
sc_vector_assembly< T, MT > sc_assemble_vector(sc_vector< T > &, MT(T::*member_ptr))
const char * sc_gen_unique_name(const char *seed)
Definition: sc_module.cc:820
#define SC_REPORT_ERROR(msg_type, msg)
#define SC_ENABLE_IF_(Cond)
Definition: sc_vector.hh:145
std::vector< void * >::const_iterator type
Definition: sc_vector.hh:299
std::vector< void * >::iterator type
Definition: sc_vector.hh:294
static const bool value
Definition: sc_vector.hh:109
static const bool value
Definition: sc_vector.hh:122
static const bool value
Definition: sc_vector.hh:98

Generated on Wed Dec 21 2022 10:22:42 for gem5 by doxygen 1.9.1