SystemC  Recoding Infrastructure for SystemC v0.6.2 derived from Accellera SystemC 2.3.1
Accellera SystemC proof-of-concept library
sc_vector.h
Go to the documentation of this file.
1 /*****************************************************************************
2 
3  The following code is derived, directly or indirectly, from the SystemC
4  source code Copyright (c) 1996-2014 by all Contributors.
5  All Rights reserved.
6 
7  The contents of this file are subject to the restrictions and limitations
8  set forth in the SystemC Open Source License (the "License");
9  You may not use this file except in compliance with such restrictions and
10  limitations. You may obtain instructions on how to receive a copy of the
11  License at http://www.accellera.org/. Software distributed by Contributors
12  under the License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF
13  ANY KIND, either express or implied. See the License for the specific
14  language governing rights and limitations under the License.
15 
16  *****************************************************************************/
17 
18 /*****************************************************************************
19 
20  sc_vector.h - A vector of named (SystemC) objects (modules, ports, channels)
21 
22  Original Author: Philipp A. Hartmann, OFFIS
23 
24  CHANGE LOG AT END OF FILE
25  *****************************************************************************/
26 
27 #ifndef SC_VECTOR_H_INCLUDED_
28 #define SC_VECTOR_H_INCLUDED_
29 
30 #include <vector>
31 #include <iterator>
32 #include <string>
33 #include <algorithm> // std::swap
34 
35 #include "sysc/kernel/sc_object.h"
36 #include "sysc/packages/boost/config.hpp"
37 #include "sysc/packages/boost/utility/enable_if.hpp"
38 
39 //#define SC_VECTOR_HEADER_ONLY_
40 
41 namespace sc_core {
42 namespace sc_meta {
43 
44  using ::sc_boost::enable_if;
45 
46  // simplistic version to avoid Boost et.al.
47  template< typename T > struct remove_const { typedef T type; };
48  template< typename T > struct remove_const<const T> { typedef T type; };
49 
50  template< typename T, typename U >
51  struct is_same { SC_BOOST_STATIC_CONSTANT( bool, value = false ); };
52  template< typename T >
53  struct is_same<T,T> { SC_BOOST_STATIC_CONSTANT( bool, value = true ); };
54 
55  template< typename T >
56  struct is_const { SC_BOOST_STATIC_CONSTANT( bool, value = false ); };
57  template< typename T >
58  struct is_const< const T> { SC_BOOST_STATIC_CONSTANT( bool, value = true ); };
59 
60  template< typename CT, typename T >
61  struct is_more_const {
63  = ( is_same< typename remove_const<CT>::type
64  , typename remove_const<T>::type
65  >::value
67  };
68 
69  struct special_result {};
70  template< typename T > struct remove_special_fptr {};
71  template< typename T >
72  struct remove_special_fptr< special_result& (*)( T ) >
73  { typedef T type; };
74 
75 #define SC_RPTYPE_(Type) \
76  typename ::sc_core::sc_meta::remove_special_fptr \
77  < ::sc_core::sc_meta::special_result& (*) Type >::type
78 
79 #define SC_ENABLE_IF_( Cond ) \
80  typename ::sc_core::sc_meta::enable_if \
81  < SC_RPTYPE_(Cond) >::type * = NULL
82 
83 } // namespace sc_meta
84 
85 // forward declarations
86 template< typename T > class sc_vector;
87 template< typename T, typename MT > class sc_vector_assembly;
88 template< typename T, typename MT > class sc_vector_iter;
89 
90 // implementation-defined
91 template< typename Container, typename ArgumentIterator >
92 typename Container::iterator
93 sc_vector_do_bind( Container & cont
94  , ArgumentIterator first
95  , ArgumentIterator last
96  , typename Container::iterator from );
97 
98 // implementation-defined
99 template< typename Container, typename ArgumentIterator >
100 typename Container::iterator
101 sc_vector_do_operator_paren( Container & cont
102  , ArgumentIterator first
103  , ArgumentIterator last
104  , typename Container::iterator from );
105 
107  : public sc_object
108 {
109 
110  template<typename,typename> friend class sc_vector_assembly;
111  template<typename,typename> friend class sc_vector_iter;
112 
113 public:
114 
115  typedef std::vector< void* > storage_type;
116  typedef storage_type::size_type size_type;
117  typedef storage_type::difference_type difference_type;
118 
119  const char * kind() const { return "sc_vector"; }
120 
121  std::vector<sc_object*> const & get_elements() const;
122 
123  size_type size() const
124  { return vec_.size(); }
125 
126 protected:
127 
128  // begin implementation defined
129 
130  typedef storage_type::iterator iterator;
131  typedef storage_type::const_iterator const_iterator;
132 
133  sc_vector_base();
134 
135  sc_vector_base( const char* prefix )
136  : sc_object( prefix )
137  , vec_()
138  , objs_vec_(0)
139  {}
140 
142  { delete objs_vec_; }
143 
144  void * & at( size_type i )
145  { return vec_[i]; }
146 
147  void const * at( size_type i ) const
148  { return vec_[i]; }
149 
150  void reserve( size_type n )
151  { vec_.reserve(n); }
152 
153  void clear()
154  { vec_.clear(); }
155 
156  void push_back( void* item )
157  { vec_.push_back(item); }
158 
159  void check_index( size_type i ) const;
160  bool check_init( size_type n ) const;
161 
162  static std::string make_name( const char* prefix, size_type index );
163 
164  iterator begin() { return vec_.begin(); }
165  iterator end() { return vec_.end(); }
166 
167  const_iterator begin() const { return vec_.begin(); }
168  const_iterator end() const { return vec_.end(); }
169 
170  virtual sc_object* object_cast( void* ) const = 0;
171 
172  sc_object* implicit_cast( sc_object* p ) const { return p; }
173  sc_object* implicit_cast( ... /* incompatible */ ) const;
174 
175 public:
176 
177  void report_empty_bind( const char* kind_, bool dst_range_ ) const;
178 
179 private:
180  storage_type vec_;
181  mutable std::vector< sc_object* >* objs_vec_;
182 
183  // disabled
184  sc_vector_base( const sc_vector_base& );
185  sc_vector_base& operator=( const sc_vector_base& );
186 
187 }; // sc_vector_base
188 
189 // iterator access adapters
190 template< typename ElementType >
192 {
193  typedef ElementType element_type;
196 
200 
203  // convert from any policy to (const) direct policy
204  template<typename U>
206  , SC_ENABLE_IF_((
208  )) )
209  {}
210 
211  type* get( type* this_ ) const
212  { return this_; }
213 };
214 
215 // iterator access adapters
216 template< typename ElementType
217  , typename AccessType >
219 {
220  public:
221  template< typename, typename > friend class sc_member_access;
222 
223  typedef ElementType element_type;
224  typedef AccessType access_type;
225  typedef access_type (ElementType::*member_type);
226  typedef access_type type;
229 
235 
237  : ptr_(ptr) {}
238 
240  : ptr_(other.ptr_)
241  {}
242 
243  access_type * get( element_type* this_ ) const
244  { return &(this_->*ptr_); }
245 
246  private:
247  member_type ptr_;
248 }; // sc_member_access
249 
250 
251 template< typename ElementType
252  , typename AccessPolicy = sc_direct_access<ElementType> >
253 class sc_vector_iter
254  : public std::iterator< std::random_access_iterator_tag
255  , typename AccessPolicy::type >
256  , private AccessPolicy
257 {
258  typedef ElementType element_type;
259  typedef typename AccessPolicy::policy access_policy;
260  typedef typename AccessPolicy::non_const_policy non_const_policy;
261  typedef typename AccessPolicy::const_policy const_policy;
262  typedef typename access_policy::type access_type;
263 
264  typedef typename sc_meta::remove_const<ElementType>::type plain_type;
265  typedef const plain_type const_plain_type;
266 
267  friend class sc_vector< plain_type >;
268  template< typename, typename > friend class sc_vector_assembly;
269  template< typename, typename > friend class sc_vector_iter;
270 
271  typedef std::iterator< std::random_access_iterator_tag, access_type > base_type;
272  typedef sc_vector_iter this_type;
274  typedef sc_vector_base::storage_type storage_type;
275 
276  // select correct base-type iterator
277  template< typename U > struct select_iter
278  { typedef typename storage_type::iterator type; };
279  template< typename U > struct select_iter< const U >
280  { typedef typename storage_type::const_iterator type; };
281 
282  typedef typename select_iter<ElementType>::type raw_iterator;
283  typedef sc_vector_iter< const_plain_type, const_policy > const_iterator;
284 
285  // underlying vector iterator
286 
287  raw_iterator it_;
288 
289  sc_vector_iter( raw_iterator it, access_policy acc = access_policy() )
290  : access_policy(acc), it_(it) {}
291 
292  access_policy const & get_policy() const { return *this; }
293 
294 public:
295  // interface for Random Access Iterator category,
296  // see ISO/IEC 14882:2003(E), 24.1 [lib.iterator.requirements]
297 
298  typedef typename base_type::difference_type difference_type;
299  typedef typename base_type::reference reference;
300  typedef typename base_type::pointer pointer;
301 
302  sc_vector_iter() : access_policy(), it_() {}
303 
304  // iterator conversions to more const, and/or direct iterators
305  template< typename OtherElement, typename OtherPolicy >
307  , SC_ENABLE_IF_((
308  sc_meta::is_more_const< element_type
309  , typename OtherPolicy::element_type >
310  ))
311  )
312  : access_policy( it.get_policy() ), it_( it.it_ )
313  {}
314 
315  // step
316  this_type& operator++(){ ++it_; return *this; }
317  this_type& operator--(){ --it_; return *this; }
318  this_type operator++(int){ this_type old(*this); ++it_; return old; }
319  this_type operator--(int){ this_type old(*this); --it_; return old; }
320 
321  // advance
323  { return this_type( it_ + n, get_policy()); }
325  { return this_type( it_ - n, get_policy()); }
326 
327  this_type& operator+=( difference_type n ) { it_+=n; return *this; }
328  this_type& operator-=( difference_type n ) { it_-=n; return *this; }
329 
330  // relations
331  bool operator== ( const this_type& that ) const { return it_ == that.it_; }
332  bool operator!= ( const this_type& that ) const { return it_ != that.it_; }
333  bool operator<= ( const this_type& that ) const { return it_ <= that.it_; }
334  bool operator>= ( const this_type& that ) const { return it_ >= that.it_; }
335  bool operator< ( const this_type& that ) const { return it_ < that.it_; }
336  bool operator> ( const this_type& that ) const { return it_ > that.it_; }
337 
338  // dereference
340  { return *access_policy::get( static_cast<element_type*>(*it_) ); }
342  { return access_policy::get( static_cast<element_type*>(*it_) ); }
344  { return *access_policy::get( static_cast<element_type*>(it_[n]) ); }
345 
346  // distance
347  difference_type operator-( this_type const& that ) const
348  { return it_-that.it_; }
349 
350 }; // sc_vector_iter
351 
352 template< typename T >
353 class sc_vector
354  : public sc_vector_base
355 {
356  typedef sc_vector_base base_type;
357  typedef sc_vector<T> this_type;
358 
359 public:
360  typedef T element_type;
363 
365 
366  explicit sc_vector( const char* prefix )
367  : base_type( prefix )
368  {}
369 
370  explicit sc_vector( const char* prefix, size_type n )
371  : base_type( prefix )
372  { init(n); }
373 
374  template< typename Creator >
375  sc_vector( const char* prefix, size_type n, Creator creator )
376  : base_type( prefix )
377  {
378  init( n, creator );
379  }
380 
381  virtual ~sc_vector();
382 
384  { return *static_cast<element_type*>( base_type::at(i) ); }
385 
387  { check_index(i); return (*this)[i]; }
388 
390  { return *static_cast<element_type const *>( base_type::at(i) ); }
391 
392  const element_type& at( size_type i ) const
393  { check_index(i); return (*this)[i]; }
394 
395  void init( size_type n )
396  { init( n, &this_type::create_element ); }
397 
398  template< typename Creator >
399  void init( size_type n, Creator c );
400 
401  static element_type * create_element( const char* prefix, size_type index );
402 
404  iterator end() { return base_type::end(); }
405 
406  const_iterator begin() const { return base_type::begin(); }
407  const_iterator end() const { return base_type::end(); }
408 
409  const_iterator cbegin() const { return base_type::begin(); }
410  const_iterator cend() const { return base_type::end(); }
411 
412  template< typename ContainerType, typename ArgumentType >
414  { return bind( c.begin(), c.end() ); }
415 
416  template< typename BindableContainer >
417  iterator bind( BindableContainer & c )
418  { return bind( c.begin(), c.end() ); }
419 
420  template< typename BindableIterator >
421  iterator bind( BindableIterator first, BindableIterator last )
422  { return bind( first, last, this->begin() ); }
423 
424  template< typename BindableIterator >
425  iterator bind( BindableIterator first, BindableIterator last
426  , iterator from )
427  { return sc_vector_do_bind( *this, first, last, from ); }
428 
429  template< typename ContainerType, typename ArgumentType >
431  { return operator()( c.begin(), c.end() ); }
432 
433  template< typename ArgumentContainer >
434  iterator operator()( ArgumentContainer & c )
435  { return operator()( c.begin(), c.end() ); }
436 
437  template< typename ArgumentIterator >
438  iterator operator()( ArgumentIterator first, ArgumentIterator last )
439  { return operator()( first, last, this->begin() ); }
440 
441  template< typename ArgumentIterator >
442  iterator operator()( ArgumentIterator first, ArgumentIterator last
443  , iterator from )
444  { return sc_vector_do_operator_paren( *this, first, last, from ); }
445 
446  // member-wise access
447 
448  template< typename MT >
449  sc_vector_assembly<T,MT> assemble( MT (T::*member_ptr) )
450  { return sc_vector_assembly<T,MT>( *this, member_ptr ); }
451 
452 protected:
453 
454  void clear();
455 
456  virtual sc_object* object_cast( void* p ) const
457  { return implicit_cast( static_cast<element_type*>(p) ); }
458 
459 };
460 
461 template< typename T, typename MT >
462 class sc_vector_assembly
463 {
464  template< typename U > friend class sc_vector;
465 
466 public:
467 
469 
471  typedef sc_vector_iter< const T
473 
474  typedef T element_type;
475  typedef MT access_type;
476 
477  typedef typename base_type::size_type size_type;
479  typedef typename iterator::reference reference;
480  typedef typename iterator::pointer pointer;
483 
484 
485  typedef access_type (T::*member_type);
486 
487  const char* name() const { return vec_->name(); }
488  const char* kind() const { return "sc_vector_assembly"; }
489 
491  { return iterator( (*vec_).begin().it_, ptr_ ); }
493  { return iterator( (*vec_).end().it_, ptr_ ); }
494 
496  { return const_iterator( (*vec_).cbegin().it_, ptr_ ); }
498  { return const_iterator( (*vec_).cend().it_, ptr_ ); }
499 
501  { return const_iterator( (*vec_).begin().it_, ptr_ ); }
503  { return const_iterator( (*vec_).end().it_, ptr_ ); }
504 
505  size_type size() const { return vec_->size(); }
506  const std::vector< sc_object* > & get_elements() const;
507 
509  { return (*vec_)[idx].*ptr_; }
511  { return vec_->at(idx).*ptr_; }
513  { return (*vec_)[idx].*ptr_; }
515  { return vec_->at(idx).*ptr_; }
516 
517  template< typename ContainerType, typename ArgumentType >
519  { return bind( c.begin(), c.end() ); }
520 
521  template< typename BindableContainer >
522  iterator bind( BindableContainer & c )
523  { return bind( c.begin(), c.end() ); }
524 
525  template< typename BindableIterator >
526  iterator bind( BindableIterator first, BindableIterator last )
527  { return bind( first, last, this->begin() ); }
528 
529  template< typename BindableIterator >
530  iterator bind( BindableIterator first, BindableIterator last
531  , iterator from )
532  { return sc_vector_do_bind( *this, first, last, from ); }
533 
534  template< typename BindableIterator >
535  iterator bind( BindableIterator first, BindableIterator last
536  , typename base_type::iterator from )
537  { return bind( first, last, iterator(from.it_, ptr_) ); }
538 
539  template< typename ContainerType, typename ArgumentType >
541  { return operator()( c.begin(), c.end() ); }
542 
543  template< typename ArgumentContainer >
544  iterator operator()( ArgumentContainer & c )
545  { return operator()( c.begin(), c.end() ); }
546 
547  template< typename ArgumentIterator >
548  iterator operator()( ArgumentIterator first, ArgumentIterator last )
549  { return operator()( first, last, this->begin() ); }
550 
551  template< typename ArgumentIterator >
552  iterator operator()( ArgumentIterator first, ArgumentIterator last
553  , iterator from )
554  { return sc_vector_do_operator_paren( *this, first, last, from ); }
555 
556  template< typename ArgumentIterator >
557  iterator operator()( ArgumentIterator first, ArgumentIterator last
558  , typename base_type::iterator from )
559  { return operator()( first, last, iterator(from.it_, ptr_) ); }
560 
562  : vec_( other.vec_ )
563  , ptr_( other.ptr_ )
564  , child_vec_(0)
565  {}
566 
568  {
569  swap( other_copy );
570  return *this;
571  }
572 
573  void swap( sc_vector_assembly & that )
574  {
575  using std::swap;
576  swap( vec_, that.vec_ );
577  swap( ptr_, that.ptr_ );
578  swap( child_vec_, that.child_vec_ );
579  }
580 
581  void report_empty_bind( const char* kind_, bool dst_empty_ ) const
582  { vec_->report_empty_bind( kind_, dst_empty_ ); }
583 
585  { delete child_vec_; }
586 
587 private:
588 
590  : vec_(&v)
591  , ptr_(ptr)
592  , child_vec_(0)
593  {}
594 
595  sc_object* object_cast( pointer p ) const
596  { return vec_->implicit_cast( p ); }
597 
598  base_type * vec_;
599  member_type ptr_;
600 
601  mutable std::vector< sc_object* >* child_vec_;
602 };
603 
604 template< typename T, typename MT >
605 sc_vector_assembly<T,MT>
606 sc_assemble_vector( sc_vector<T> & vec, MT (T::*ptr) )
607 {
608  return vec.assemble( ptr );
609 }
610 
611 template< typename T >
612 typename sc_vector<T>::element_type *
613 sc_vector<T>::create_element( const char* name, size_type /* idx */ )
614 {
615  return new T( name );
616 }
617 
618 template< typename T >
619 template< typename Creator >
620 void
622 {
623  if ( base_type::check_init(n) )
624  {
625  base_type::reserve( n );
626  try
627  {
628  for ( size_type i = 0; i<n; ++i )
629  {
630  // this workaround is needed for SystemC 2.2/2.3 sc_bind
631  std::string name = make_name( basename(), i );
632  const char* cname = name.c_str();
633 
634  void* p = c( cname, i ) ; // call Creator
635  base_type::push_back(p);
636  }
637  }
638  catch ( ... )
639  {
640  clear();
641  throw;
642  }
643  }
644 }
645 
646 template< typename T >
647 void
649 {
650  size_type i = size();
651  while ( i --> 0 )
652  {
653  delete &( (*this)[i] );
654  base_type::at(i) = 0;
655  }
656  base_type::clear();
657 }
658 
659 template< typename Container, typename ArgumentIterator >
660 typename Container::iterator
661 sc_vector_do_bind( Container & cont
662  , ArgumentIterator first
663  , ArgumentIterator last
664  , typename Container::iterator from )
665 {
666  typename Container::iterator end = cont.end();
667 
668  if( !cont.size() || from == end || first == last )
669  cont.report_empty_bind( cont.kind(), from == end );
670 
671  while( from!=end && first != last )
672  (*from++).bind( *first++ );
673  return from;
674 }
675 
676 template< typename Container, typename ArgumentIterator >
677 typename Container::iterator
679  , ArgumentIterator first
680  , ArgumentIterator last
681  , typename Container::iterator from )
682 {
683  typename Container::iterator end = cont.end();
684 
685  if( !cont.size() || from == end || first == last )
686  cont.report_empty_bind( cont.kind(), from == end );
687 
688  while( from!=end && first != last )
689  (*from++)( *first++ );
690  return from;
691 }
692 
693 template< typename T >
695 {
696  clear();
697 }
698 
699 template< typename T, typename MT >
700 std::vector< sc_object* > const &
702 {
703  if( !child_vec_ )
704  child_vec_ = new std::vector< sc_object* >;
705 
706  if( child_vec_->size() || !size() )
707  return *child_vec_;
708 
709  child_vec_->reserve( size() );
710  for( const_iterator it=begin(); it != end(); ++it )
711  if( sc_object * obj = object_cast( const_cast<MT*>(&*it) ) )
712  child_vec_->push_back( obj );
713 
714  return *child_vec_;
715 }
716 
717 } // namespace sc_core
718 #undef SC_RPTYPE_
719 #undef SC_ENABLE_IF_
720 
721 // $Log: sc_vector.h,v $
722 // Revision 1.17 2011/08/26 20:46:20 acg
723 // Andy Goodrich: moved the modification log to the end of the file to
724 // eliminate source line number skew when check-ins are done.
725 //
726 // Revision 1.16 2011/07/25 10:21:17 acg
727 // Andy Goodrich: check in aftermath of call to automake.
728 //
729 // Revision 1.15 2011/04/02 00:04:32 acg
730 // Philipp A. Hartmann: fix distance from member iterators, and
731 // add iterator conversions.
732 //
733 // Revision 1.14 2011/04/01 22:35:19 acg
734 // Andy Goodrich: spelling fix.
735 //
736 // Revision 1.13 2011/03/28 13:03:09 acg
737 // Andy Goodrich: Philipp's latest update.
738 //
739 // Revision 1.12 2011/03/23 16:16:28 acg
740 // Philipp A. Hartmann: rebase implementation on void*
741 // - supports virtual inheritance from sc_object again
742 // - build up get_elements result on demand
743 // - still requires element type to be derived from sc_object
744 //
745 // Revision 1.11 2011/02/19 16:46:36 acg
746 // Andy Goodrich: finally get the update from Philipp correct!
747 //
748 
749 #endif // SC_VECTOR_H_INCLUDED_
750 // Taf!
const_iterator::pointer const_pointer
Definition: sc_vector.h:482
sc_direct_access< const plain_type > const_policy
Definition: sc_vector.h:199
sc_vector(const char *prefix, size_type n, Creator creator)
Definition: sc_vector.h:375
this_type & operator-=(difference_type n)
Definition: sc_vector.h:328
iterator bind(BindableIterator first, BindableIterator last, iterator from)
Definition: sc_vector.h:530
sc_member_access(const non_const_policy &other)
Definition: sc_vector.h:239
const_iterator end() const
Definition: sc_vector.h:502
iterator operator()(ArgumentIterator first, ArgumentIterator last)
Definition: sc_vector.h:548
sc_vector_iter< const T, sc_member_access< const T, const MT > > const_iterator
Definition: sc_vector.h:472
const_iterator end() const
Definition: sc_vector.h:407
bool operator>(const this_type &that) const
Definition: sc_vector.h:336
const_iterator cbegin() const
Definition: sc_vector.h:495
#define SC_ENABLE_IF_(Cond)
Definition: sc_vector.h:79
iterator bind(BindableIterator first, BindableIterator last)
Definition: sc_vector.h:421
this_type operator++(int)
Definition: sc_vector.h:318
const char * kind() const
Definition: sc_vector.h:119
iterator::pointer pointer
Definition: sc_vector.h:480
size_type size() const
Definition: sc_vector.h:505
static std::string make_name(const char *prefix, size_type index)
reference operator*() const
Definition: sc_vector.h:339
sc_direct_access(const U &, SC_ENABLE_IF_((sc_meta::is_more_const< type, typename U::policy::element_type >)))
Definition: sc_vector.h:205
sc_vector_assembly(const sc_vector_assembly &other)
Definition: sc_vector.h:561
void init(size_type n)
Definition: sc_vector.h:395
base_type::size_type size_type
Definition: sc_vector.h:477
sc_vector< T > base_type
Definition: sc_vector.h:468
void const * at(size_type i) const
Definition: sc_vector.h:147
void report_empty_bind(const char *kind_, bool dst_range_) const
iterator operator()(ArgumentContainer &c)
Definition: sc_vector.h:544
const_iterator begin() const
Definition: sc_vector.h:500
iterator bind(BindableContainer &c)
Definition: sc_vector.h:417
storage_type::difference_type difference_type
Definition: sc_vector.h:117
iterator begin()
Definition: sc_vector.h:403
const char * name() const
Definition: sc_object.h:71
const_iterator end() const
Definition: sc_vector.h:168
pointer operator->() const
Definition: sc_vector.h:341
std::vector< sc_object * > const & get_elements() const
sc_vector(const char *prefix)
Definition: sc_vector.h:366
virtual sc_object * object_cast(void *p) const
Definition: sc_vector.h:456
base_type::pointer pointer
Definition: sc_vector.h:300
access_typeT::* member_type
Definition: sc_vector.h:485
static element_type * create_element(const char *prefix, size_type index)
Definition: sc_vector.h:613
reference operator[](size_type idx)
Definition: sc_vector.h:508
SC_BOOST_STATIC_CONSTANT(bool, value=(is_same< typename remove_const< CT >::type, typename remove_const< T >::type >::value &&(is_const< CT >::value >=is_const< T >::value)))
this_type operator--(int)
Definition: sc_vector.h:319
storage_type::size_type size_type
Definition: sc_vector.h:116
sc_vector_iter(const sc_vector_iter< OtherElement, OtherPolicy > &it, SC_ENABLE_IF_((sc_meta::is_more_const< element_type, typename OtherPolicy::element_type >)))
Definition: sc_vector.h:306
sc_member_access(member_type ptr)
Definition: sc_vector.h:236
const_iterator::reference const_reference
Definition: sc_vector.h:481
void swap(sc_vector_assembly &that)
Definition: sc_vector.h:573
void push_back(void *item)
Definition: sc_vector.h:156
iterator operator()(ArgumentIterator first, ArgumentIterator last, iterator from)
Definition: sc_vector.h:552
const_reference operator[](size_type idx) const
Definition: sc_vector.h:512
SC_BOOST_STATIC_CONSTANT(bool, value=false)
sc_direct_access< plain_type > non_const_policy
Definition: sc_vector.h:198
base_type::difference_type difference_type
Definition: sc_vector.h:298
iterator bind(BindableIterator first, BindableIterator last)
Definition: sc_vector.h:526
iterator bind(sc_vector_assembly< ContainerType, ArgumentType > c)
Definition: sc_vector.h:518
this_type operator+(difference_type n) const
Definition: sc_vector.h:322
iterator bind(BindableIterator first, BindableIterator last, typename base_type::iterator from)
Definition: sc_vector.h:535
bool check_init(size_type n) const
std::vector< void * > storage_type
Definition: sc_vector.h:115
void check_index(size_type i) const
base_type::reference reference
Definition: sc_vector.h:299
const_reference at(size_type idx) const
Definition: sc_vector.h:514
sc_vector_iter< const element_type > const_iterator
Definition: sc_vector.h:362
base_type::difference_type difference_type
Definition: sc_vector.h:478
sc_member_access< element_type, access_type > policy
Definition: sc_vector.h:230
bool operator<=(const this_type &that) const
Definition: sc_vector.h:333
sc_member_access< const plain_elem_type, const plain_type > const_policy
Definition: sc_vector.h:234
sc_vector_assembly & operator=(sc_vector_assembly other_copy)
Definition: sc_vector.h:567
sc_vector(const char *prefix, size_type n)
Definition: sc_vector.h:370
iterator operator()(ArgumentIterator first, ArgumentIterator last, typename base_type::iterator from)
Definition: sc_vector.h:557
sc_meta::remove_const< ElementType >::type plain_elem_type
Definition: sc_vector.h:228
iterator operator()(sc_vector_assembly< ContainerType, ArgumentType > c)
Definition: sc_vector.h:540
const char * kind() const
Definition: sc_vector.h:488
sc_member_access< plain_elem_type, plain_type > non_const_policy
Definition: sc_vector.h:232
this_type & operator--()
Definition: sc_vector.h:317
Container::iterator sc_vector_do_bind(Container &cont, ArgumentIterator first, ArgumentIterator last, typename Container::iterator from)
Definition: sc_vector.h:661
virtual ~sc_vector()
Definition: sc_vector.h:694
reference at(size_type idx)
Definition: sc_vector.h:510
reference operator[](difference_type n) const
Definition: sc_vector.h:343
access_typeElementType::* member_type
Definition: sc_vector.h:225
sc_object * implicit_cast(sc_object *p) const
Definition: sc_vector.h:172
storage_type::iterator iterator
Definition: sc_vector.h:130
bool operator<(const this_type &that) const
Definition: sc_vector.h:335
element_type & operator[](size_type i)
Definition: sc_vector.h:383
sc_direct_access(const non_const_policy &)
Definition: sc_vector.h:202
void reserve(size_type n)
Definition: sc_vector.h:150
void report_empty_bind(const char *kind_, bool dst_empty_) const
Definition: sc_vector.h:581
const std::vector< sc_object * > & get_elements() const
Definition: sc_vector.h:701
sc_vector_iter< element_type > iterator
Definition: sc_vector.h:361
sc_vector_assembly< T, MT > assemble(MT(T::*member_ptr))
Definition: sc_vector.h:449
sc_direct_access< type > policy
Definition: sc_vector.h:197
iterator operator()(ArgumentIterator first, ArgumentIterator last, iterator from)
Definition: sc_vector.h:442
virtual sc_object * object_cast(void *) const =0
iterator::reference reference
Definition: sc_vector.h:479
sc_meta::remove_const< type >::type plain_type
Definition: sc_vector.h:195
const_iterator begin() const
Definition: sc_vector.h:167
this_type & operator+=(difference_type n)
Definition: sc_vector.h:327
const_iterator cbegin() const
Definition: sc_vector.h:409
sc_meta::remove_const< type >::type plain_type
Definition: sc_vector.h:227
iterator bind(sc_vector_assembly< ContainerType, ArgumentType > c)
Definition: sc_vector.h:413
void *& at(size_type i)
Definition: sc_vector.h:144
iterator operator()(ArgumentIterator first, ArgumentIterator last)
Definition: sc_vector.h:438
difference_type operator-(this_type const &that) const
Definition: sc_vector.h:347
iterator operator()(sc_vector_assembly< ContainerType, ArgumentType > c)
Definition: sc_vector.h:430
const_iterator cend() const
Definition: sc_vector.h:410
iterator bind(BindableIterator first, BindableIterator last, iterator from)
Definition: sc_vector.h:425
sc_clock period is zero sc_clock low time is zero sc_fifo< T > cannot have more than one writer bind interface to port failed complete binding failed remove port failed insert primitive channel failed sc_signal< T > cannot have more than one driver resolved port not bound to resolved signal sc_semaphore requires an initial value
iterator bind(BindableContainer &c)
Definition: sc_vector.h:522
iterator end()
Definition: sc_vector.h:404
iterator operator()(ArgumentContainer &c)
Definition: sc_vector.h:434
sc_vector_iter< T, sc_member_access< T, MT > > iterator
Definition: sc_vector.h:470
element_type & at(size_type i)
Definition: sc_vector.h:386
const char * name() const
Definition: sc_vector.h:487
sc_vector_base(const char *prefix)
Definition: sc_vector.h:135
Container::iterator sc_vector_do_operator_paren(Container &cont, ArgumentIterator first, ArgumentIterator last, typename Container::iterator from)
Definition: sc_vector.h:678
ElementType element_type
Definition: sc_vector.h:223
bool operator==(const this_type &that) const
Definition: sc_vector.h:331
bool operator>=(const this_type &that) const
Definition: sc_vector.h:334
this_type & operator++()
Definition: sc_vector.h:316
this_type operator-(difference_type n) const
Definition: sc_vector.h:324
const_iterator cend() const
Definition: sc_vector.h:497
const_iterator begin() const
Definition: sc_vector.h:406
bool operator!=(const this_type &that) const
Definition: sc_vector.h:332
SC_BOOST_STATIC_CONSTANT(bool, value=false)
size_type size() const
Definition: sc_vector.h:123
const element_type & at(size_type i) const
Definition: sc_vector.h:392
Abstract base class of all SystemC `simulation&#39; objects.
Definition: sc_object.h:51
storage_type::const_iterator const_iterator
Definition: sc_vector.h:131
const element_type & operator[](size_type i) const
Definition: sc_vector.h:389
ElementType element_type
Definition: sc_vector.h:193