SystemC  2.3.2
Accellera SystemC proof-of-concept library
sc_vector.h
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 
22  sc_vector.h - A vector of named (SystemC) objects (modules, ports, channels)
23 
24  Original Author: Philipp A. Hartmann, OFFIS
25 
26  CHANGE LOG AT END OF FILE
27  *****************************************************************************/
28 
29 #ifndef SC_VECTOR_H_INCLUDED_
30 #define SC_VECTOR_H_INCLUDED_
31 
32 #include <vector>
33 #include <iterator>
34 #include <string>
35 #include <algorithm> // std::swap
36 
37 #include "sysc/kernel/sc_object.h"
38 
39 #if SC_CPLUSPLUS >= 201103L // use C++11 for type traits
40 # include <type_traits>
41 #else // use Boost for type traits
42 # include "sysc/packages/boost/config.hpp"
43 # include "sysc/packages/boost/utility/enable_if.hpp"
44 #endif // type traits
45 
46 #if defined(_MSC_VER) && !defined(SC_WIN_DLL_WARN)
47 #pragma warning(push)
48 #pragma warning(disable: 4251) // DLL import for std::vector
49 #endif
50 
51 namespace sc_core {
52 namespace sc_meta {
53 
54 #if SC_CPLUSPLUS >= 201103L // use C++11 for type traits
55  using std::enable_if;
56  using std::remove_const;
57  using std::is_same;
58  using std::is_const;
59 
60 # define SC_STATIC_CONSTANT_(Type,Value) \
61  static const Type Value
62 
63 #else // use Boost/local implementation for type traits
64  template<bool Cond, typename T = void>
65  struct enable_if : sc_boost::enable_if_c<Cond, T> {};
66 
67 # define SC_STATIC_CONSTANT_(Type,Value) \
68  SC_BOOST_STATIC_CONSTANT(Type,Value)
69 
70  // simplistic version to reduce Boost usage
71  template< typename T > struct remove_const { typedef T type; };
72  template< typename T > struct remove_const<const T> { typedef T type; };
73 
74  template< typename T, typename U >
75  struct is_same { SC_BOOST_STATIC_CONSTANT( bool, value = false ); };
76  template< typename T >
77  struct is_same<T,T> { SC_BOOST_STATIC_CONSTANT( bool, value = true ); };
78 
79  template< typename T >
80  struct is_const { SC_BOOST_STATIC_CONSTANT( bool, value = false ); };
81  template< typename T >
82  struct is_const< const T> { SC_BOOST_STATIC_CONSTANT( bool, value = true ); };
83 
84 #endif // type traits
85 
86  template< typename CT, typename T >
87  struct is_more_const {
89  = ( is_same< typename remove_const<CT>::type
90  , typename remove_const<T>::type
91  >::value
93  };
94 
95  struct special_result {};
96  template< typename T > struct remove_special_fptr {};
97  template< typename T >
98  struct remove_special_fptr< special_result& (*)( T ) >
99  { typedef T type; };
100 
102 #define SC_RPTYPE_(Type) \
103  ::sc_core::sc_meta::remove_special_fptr \
104  < ::sc_core::sc_meta::special_result& (*) Type >::type::value
105 
107 #define SC_ENABLE_IF_( Cond ) \
108  typename ::sc_core::sc_meta::enable_if \
109  < SC_RPTYPE_(Cond) >::type * = NULL
110 
111 } // namespace sc_meta
112 
113 // forward declarations
114 template< typename T > class sc_vector;
115 template< typename T, typename MT > class sc_vector_assembly;
116 template< typename T, typename MT > class sc_vector_iter;
117 
118 // implementation-defined
119 template< typename Container, typename ArgumentIterator >
120 typename Container::iterator
121 sc_vector_do_bind( Container & cont
122  , ArgumentIterator first
123  , ArgumentIterator last
124  , typename Container::iterator from );
125 
126 // implementation-defined
127 template< typename Container, typename ArgumentIterator >
128 typename Container::iterator
129 sc_vector_do_operator_paren( Container & cont
130  , ArgumentIterator first
131  , ArgumentIterator last
132  , typename Container::iterator from );
133 
134 class sc_vector_element; // opaque pointer
135 
137  : public sc_object
138 {
139 
140  template<typename,typename> friend class sc_vector_assembly;
141  template<typename,typename> friend class sc_vector_iter;
142 
143 public:
144 
145  typedef sc_vector_element* handle_type;
146  typedef std::vector< handle_type > storage_type;
147  typedef storage_type::size_type size_type;
148  typedef storage_type::difference_type difference_type;
149 
150  const char * kind() const { return "sc_vector"; }
151 
152  std::vector<sc_object*> const & get_elements() const;
153 
154  size_type size() const
155  { return vec_.size(); }
156 
157 protected:
158 
159  // begin implementation defined
160 
161  typedef storage_type::iterator iterator;
162  typedef storage_type::const_iterator const_iterator;
163 
164  sc_vector_base();
165 
166  sc_vector_base( const char* prefix )
167  : sc_object( prefix )
168  , vec_()
169  , objs_vec_(0)
170  {}
171 
173  { delete objs_vec_; }
174 
175  void * at( size_type i )
176  { return vec_[i]; }
177 
178  void const * at( size_type i ) const
179  { return vec_[i]; }
180 
181  void reserve( size_type n )
182  { vec_.reserve(n); }
183 
184  void clear()
185  { vec_.clear(); }
186 
187  void push_back( void* item )
188  { vec_.push_back( static_cast<handle_type>(item) ); }
189 
190  void check_index( size_type i ) const;
191  bool check_init( size_type n ) const;
192 
193  static std::string make_name( const char* prefix, size_type index );
194 
195  iterator begin() { return vec_.begin(); }
196  iterator end() { return vec_.end(); }
197 
198  const_iterator begin() const { return vec_.begin(); }
199  const_iterator end() const { return vec_.end(); }
200 
201  virtual sc_object* object_cast( void* ) const = 0;
202 
203  sc_object* implicit_cast( sc_object* p ) const { return p; }
204  sc_object* implicit_cast( ... /* incompatible */ ) const;
205 
207  {
208  sc_vector_base* owner_;
209  public:
210  explicit context_scope(sc_vector_base* owner);
211  ~context_scope();
212  };
213 
214 public:
215  void report_empty_bind( const char* kind_, bool dst_range_ ) const;
216 
217 private:
218  storage_type vec_;
219  mutable std::vector< sc_object* >* objs_vec_;
220 
221  // disabled
222  sc_vector_base( const sc_vector_base& );
223  sc_vector_base& operator=( const sc_vector_base& );
224 
225 }; // sc_vector_base
226 
227 // iterator access adapters
228 template< typename ElementType >
230 {
231  typedef ElementType element_type;
232  typedef element_type type;
234 
238 
240  sc_direct_access( const non_const_policy& ) {}
241  // convert from any policy to (const) direct policy
242  template<typename U>
244  , SC_ENABLE_IF_((
246  )) )
247  {}
248 
249  type* get( type* this_ ) const
250  { return this_; }
251 };
252 
253 // iterator access adapters
254 template< typename ElementType
255  , typename AccessType >
257 {
258  public:
259  template< typename, typename > friend class sc_member_access;
260 
261  typedef ElementType element_type;
262  typedef AccessType access_type;
263  typedef access_type (ElementType::*member_type);
264  typedef access_type type;
267 
273 
275  : ptr_(ptr) {}
276 
277  sc_member_access( const non_const_policy& other )
278  : ptr_(other.ptr_)
279  {}
280 
281  access_type * get( element_type* this_ ) const
282  { return &(this_->*ptr_); }
283 
284  private:
285  member_type ptr_;
286 }; // sc_member_access
287 
288 
289 template< typename ElementType
290  , typename AccessPolicy = sc_direct_access<ElementType> >
291 class sc_vector_iter
292  : public std::iterator< std::random_access_iterator_tag
293  , typename AccessPolicy::type >
294  , private AccessPolicy
295 {
296  typedef ElementType element_type;
297  typedef typename AccessPolicy::policy access_policy;
298  typedef typename AccessPolicy::non_const_policy non_const_policy;
299  typedef typename AccessPolicy::const_policy const_policy;
300  typedef typename access_policy::type access_type;
301 
302  typedef typename sc_meta::remove_const<ElementType>::type plain_type;
303  typedef const plain_type const_plain_type;
305  const_direct_policy;
306 
307  friend class sc_vector< plain_type >;
308  template< typename, typename > friend class sc_vector_assembly;
309  template< typename, typename > friend class sc_vector_iter;
310 
311  typedef std::iterator< std::random_access_iterator_tag, access_type > base_type;
312  typedef sc_vector_iter this_type;
314  typedef sc_vector_base::storage_type storage_type;
315 
316  // select correct base-type iterator
317  template< typename U > struct select_iter
318  { typedef typename storage_type::iterator type; };
319  template< typename U > struct select_iter< const U >
320  { typedef typename storage_type::const_iterator type; };
321 
322  typedef typename select_iter<ElementType>::type raw_iterator;
326 
327  // underlying vector iterator
328 
329  raw_iterator it_;
330 
331  sc_vector_iter( raw_iterator it, access_policy acc = access_policy() )
332  : access_policy(acc), it_(it) {}
333 
334  access_policy const & get_policy() const { return *this; }
335 
336 public:
337  // interface for Random Access Iterator category,
338  // see ISO/IEC 14882:2003(E), 24.1 [lib.iterator.requirements]
339 
340  typedef typename base_type::difference_type difference_type;
341  typedef typename base_type::reference reference;
342  typedef typename base_type::pointer pointer;
343 
344  sc_vector_iter() : access_policy(), it_() {}
345 
346  // iterator conversions to more const, and/or direct iterators
347  //
348  // Note: There is a minor risk to match unrelated classes (i.e. not sc_vector_iter<T,POL>),
349  // but MSVC 2005 does not correctly consider a restricted conversion constructor
350  // sc_vector_iter( const sc_vector_iter<OtherType,OtherPolicy>, SC_ENABLE_IF_ ...).
351  // To reduce this risk, the types used in the enable-if condition could be further
352  // tailored towards sc_vector(_iter), should the need arise.
353  //
354  // See also: sc_direct_access conversion constructor
355  template< typename It >
356  sc_vector_iter( const It& it
357  , SC_ENABLE_IF_((
358  sc_meta::is_more_const< element_type
359  , typename It::policy::element_type >
360  )) )
361  : access_policy( it.get_policy() ), it_( it.it_ )
362  {}
363 
364  // step
365  this_type& operator++(){ ++it_; return *this; }
366  this_type& operator--(){ --it_; return *this; }
367  this_type operator++(int){ this_type old(*this); ++it_; return old; }
368  this_type operator--(int){ this_type old(*this); --it_; return old; }
369 
370  // advance
371  this_type operator+( difference_type n ) const
372  { return this_type( it_ + n, get_policy()); }
373  this_type operator-( difference_type n ) const
374  { return this_type( it_ - n, get_policy()); }
375 
376  this_type& operator+=( difference_type n ) { it_+=n; return *this; }
377  this_type& operator-=( difference_type n ) { it_-=n; return *this; }
378 
379  // relations
380  bool operator==( const const_direct_iterator& that ) const
381  { return it_ == that.it_; }
382  bool operator!=( const const_direct_iterator& that ) const
383  { return it_ != that.it_; }
384  bool operator<=( const const_direct_iterator& that ) const
385  { return it_ <= that.it_; }
386  bool operator>=( const const_direct_iterator& that ) const
387  { return it_ >= that.it_; }
388  bool operator< ( const const_direct_iterator& that ) const
389  { return it_ < that.it_; }
390  bool operator> ( const const_direct_iterator& that ) const
391  { return it_ > that.it_; }
392 
393  // dereference
394  reference operator*() const
395  { return *access_policy::get( static_cast<element_type*>((void*)*it_) ); }
396  pointer operator->() const
397  { return access_policy::get( static_cast<element_type*>((void*)*it_) ); }
398  reference operator[]( difference_type n ) const
399  { return *access_policy::get( static_cast<element_type*>((void*)it_[n]) ); }
400 
401  // distance
402  difference_type operator-( const_direct_iterator const& that ) const
403  { return it_-that.it_; }
404 
405 }; // sc_vector_iter
406 
407 template< typename T >
408 class sc_vector
409  : public sc_vector_base
410 {
411  typedef sc_vector_base base_type;
412  typedef sc_vector<T> this_type;
413 
414 public:
415  typedef T element_type;
418 
420 
421  explicit sc_vector( const char* prefix )
422  : base_type( prefix )
423  {}
424 
425  explicit sc_vector( const char* prefix, size_type n )
426  : base_type( prefix )
427  { init(n); }
428 
429  template< typename Creator >
430  sc_vector( const char* prefix, size_type n, Creator creator )
431  : base_type( prefix )
432  {
433  init( n, creator );
434  }
435 
436  virtual ~sc_vector();
437 
438  element_type& operator[]( size_type i )
439  { return *static_cast<element_type*>( base_type::at(i) ); }
440 
441  element_type& at( size_type i )
442  { check_index(i); return (*this)[i]; }
443 
444  const element_type& operator[]( size_type i ) const
445  { return *static_cast<element_type const *>( base_type::at(i) ); }
446 
447  const element_type& at( size_type i ) const
448  { check_index(i); return (*this)[i]; }
449 
450  void init( size_type n )
451  { init( n, &this_type::create_element ); }
452 
453  template< typename Creator >
454  void init( size_type n, Creator c );
455 
456  static element_type * create_element( const char* prefix, size_type index );
457 
458  iterator begin() { return base_type::begin(); }
459  iterator end() { return base_type::end(); }
460 
461  const_iterator begin() const { return base_type::begin(); }
462  const_iterator end() const { return base_type::end(); }
463 
464  const_iterator cbegin() const { return base_type::begin(); }
465  const_iterator cend() const { return base_type::end(); }
466 
467  template< typename ContainerType, typename ArgumentType >
469  { return bind( c.begin(), c.end() ); }
470 
471  template< typename BindableContainer >
472  iterator bind( BindableContainer & c )
473  { return bind( c.begin(), c.end() ); }
474 
475  template< typename BindableIterator >
476  iterator bind( BindableIterator first, BindableIterator last )
477  { return bind( first, last, this->begin() ); }
478 
479  template< typename BindableIterator >
480  iterator bind( BindableIterator first, BindableIterator last
481  , iterator from )
482  { return sc_vector_do_bind( *this, first, last, from ); }
483 
484  template< typename ContainerType, typename ArgumentType >
486  { return operator()( c.begin(), c.end() ); }
487 
488  template< typename ArgumentContainer >
489  iterator operator()( ArgumentContainer & c )
490  { return operator()( c.begin(), c.end() ); }
491 
492  template< typename ArgumentIterator >
493  iterator operator()( ArgumentIterator first, ArgumentIterator last )
494  { return operator()( first, last, this->begin() ); }
495 
496  template< typename ArgumentIterator >
497  iterator operator()( ArgumentIterator first, ArgumentIterator last
498  , iterator from )
499  { return sc_vector_do_operator_paren( *this, first, last, from ); }
500 
501  // member-wise access
502 
503  template< typename MT >
504  sc_vector_assembly<T,MT> assemble( MT (T::*member_ptr) )
505  { return sc_vector_assembly<T,MT>( *this, member_ptr ); }
506 
507 protected:
508 
509  void clear();
510 
511  virtual sc_object* object_cast( void* p ) const
512  { return implicit_cast( static_cast<element_type*>(p) ); }
513 
514 };
515 
516 template< typename T, typename MT >
517 class sc_vector_assembly
518 {
519  template< typename U > friend class sc_vector;
520 
521 public:
522 
524 
526  typedef sc_vector_iter< const T
528 
529  typedef T element_type;
530  typedef MT access_type;
531 
532  typedef typename base_type::size_type size_type;
534  typedef typename iterator::reference reference;
535  typedef typename iterator::pointer pointer;
538 
539 
540  typedef access_type (T::*member_type);
541 
542  const char* name() const { return vec_->name(); }
543  const char* kind() const { return "sc_vector_assembly"; }
544 
545  iterator begin()
546  { return iterator( (*vec_).begin().it_, ptr_ ); }
547  iterator end()
548  { return iterator( (*vec_).end().it_, ptr_ ); }
549 
550  const_iterator cbegin() const
551  { return const_iterator( (*vec_).cbegin().it_, ptr_ ); }
552  const_iterator cend() const
553  { return const_iterator( (*vec_).cend().it_, ptr_ ); }
554 
555  const_iterator begin() const
556  { return const_iterator( (*vec_).begin().it_, ptr_ ); }
557  const_iterator end() const
558  { return const_iterator( (*vec_).end().it_, ptr_ ); }
559 
560  size_type size() const { return vec_->size(); }
561  const std::vector< sc_object* > & get_elements() const;
562 
563  reference operator[]( size_type idx )
564  { return (*vec_)[idx].*ptr_; }
565  reference at( size_type idx )
566  { return vec_->at(idx).*ptr_; }
567  const_reference operator[]( size_type idx ) const
568  { return (*vec_)[idx].*ptr_; }
569  const_reference at( size_type idx ) const
570  { return vec_->at(idx).*ptr_; }
571 
572  template< typename ContainerType, typename ArgumentType >
574  { return bind( c.begin(), c.end() ); }
575 
576  template< typename BindableContainer >
577  iterator bind( BindableContainer & c )
578  { return bind( c.begin(), c.end() ); }
579 
580  template< typename BindableIterator >
581  iterator bind( BindableIterator first, BindableIterator last )
582  { return bind( first, last, this->begin() ); }
583 
584  template< typename BindableIterator >
585  iterator bind( BindableIterator first, BindableIterator last
586  , iterator from )
587  { return sc_vector_do_bind( *this, first, last, from ); }
588 
589  template< typename BindableIterator >
590  iterator bind( BindableIterator first, BindableIterator last
591  , typename base_type::iterator from )
592  { return bind( first, last, iterator(from.it_, ptr_) ); }
593 
594  template< typename ContainerType, typename ArgumentType >
596  { return operator()( c.begin(), c.end() ); }
597 
598  template< typename ArgumentContainer >
599  iterator operator()( ArgumentContainer & c )
600  { return operator()( c.begin(), c.end() ); }
601 
602  template< typename ArgumentIterator >
603  iterator operator()( ArgumentIterator first, ArgumentIterator last )
604  { return operator()( first, last, this->begin() ); }
605 
606  template< typename ArgumentIterator >
607  iterator operator()( ArgumentIterator first, ArgumentIterator last
608  , iterator from )
609  { return sc_vector_do_operator_paren( *this, first, last, from ); }
610 
611  template< typename ArgumentIterator >
612  iterator operator()( ArgumentIterator first, ArgumentIterator last
613  , typename base_type::iterator from )
614  { return operator()( first, last, iterator(from.it_, ptr_) ); }
615 
617  : vec_( other.vec_ )
618  , ptr_( other.ptr_ )
619  , child_vec_(0)
620  {}
621 
623  {
624  swap( other_copy );
625  return *this;
626  }
627 
628  void swap( sc_vector_assembly & that )
629  {
630  using std::swap;
631  swap( vec_, that.vec_ );
632  swap( ptr_, that.ptr_ );
633  swap( child_vec_, that.child_vec_ );
634  }
635 
636  void report_empty_bind( const char* kind_, bool dst_empty_ ) const
637  { vec_->report_empty_bind( kind_, dst_empty_ ); }
638 
640  { delete child_vec_; }
641 
642 private:
643 
644  sc_vector_assembly( base_type & v, member_type ptr )
645  : vec_(&v)
646  , ptr_(ptr)
647  , child_vec_(0)
648  {}
649 
650  sc_object* object_cast( pointer p ) const
651  { return vec_->implicit_cast( p ); }
652 
653  base_type * vec_;
654  member_type ptr_;
655 
656  mutable std::vector< sc_object* >* child_vec_;
657 };
658 
659 template< typename T, typename MT >
661 sc_assemble_vector( sc_vector<T> & vec, MT (T::*ptr) )
662 {
663  return vec.assemble( ptr );
664 }
665 
666 template< typename T >
668 sc_vector<T>::create_element( const char* name, size_type /* idx */ )
669 {
670  return new T( name );
671 }
672 
673 template< typename T >
674 template< typename Creator >
675 void
677 {
678  if ( base_type::check_init(n) )
679  {
680  // restore SystemC hierarchy context, if needed
681  sc_vector_base::context_scope scope( this );
682 
683  base_type::reserve( n );
684  try
685  {
686  for ( size_type i = 0; i<n; ++i )
687  {
688  // this workaround is needed for SystemC 2.2/2.3 sc_bind
689  std::string name = make_name( basename(), i );
690  const char* cname = name.c_str();
691 
692  element_type* p = c( cname, i ) ; // call Creator
693  base_type::push_back(p);
694  }
695  }
696  catch ( ... )
697  {
698  clear();
699  throw;
700  }
701  }
702 }
703 
704 template< typename T >
705 void
707 {
708  size_type i = size();
709  while ( i --> 0 )
710  {
711  delete &( (*this)[i] );
712  }
713  base_type::clear();
714 }
715 
716 template< typename Container, typename ArgumentIterator >
717 typename Container::iterator
718 sc_vector_do_bind( Container & cont
719  , ArgumentIterator first
720  , ArgumentIterator last
721  , typename Container::iterator from )
722 {
723  typename Container::iterator end = cont.end();
724 
725  if( !cont.size() || from == end || first == last )
726  cont.report_empty_bind( cont.kind(), from == end );
727 
728  while( from!=end && first != last )
729  (*from++).bind( *first++ );
730  return from;
731 }
732 
733 template< typename Container, typename ArgumentIterator >
734 typename Container::iterator
736  , ArgumentIterator first
737  , ArgumentIterator last
738  , typename Container::iterator from )
739 {
740  typename Container::iterator end = cont.end();
741 
742  if( !cont.size() || from == end || first == last )
743  cont.report_empty_bind( cont.kind(), from == end );
744 
745  while( from!=end && first != last )
746  (*from++)( *first++ );
747  return from;
748 }
749 
750 template< typename T >
752 {
753  clear();
754 }
755 
756 template< typename T, typename MT >
757 std::vector< sc_object* > const &
759 {
760  if( !child_vec_ )
761  child_vec_ = new std::vector< sc_object* >;
762 
763  if( child_vec_->size() || !size() )
764  return *child_vec_;
765 
766  child_vec_->reserve( size() );
767  for( const_iterator it=begin(); it != end(); ++it )
768  if( sc_object * obj = object_cast( const_cast<MT*>(&*it) ) )
769  child_vec_->push_back( obj );
770 
771  return *child_vec_;
772 }
773 
774 } // namespace sc_core
775 
776 #undef SC_STATIC_CONSTANT_
777 #undef SC_RPTYPE_
778 #undef SC_ENABLE_IF_
779 
780 #if defined(_MSC_VER) && !defined(SC_WIN_DLL_WARN)
781 #pragma warning(pop)
782 #endif
783 
784 // $Log: sc_vector.h,v $
785 // Revision 1.17 2011/08/26 20:46:20 acg
786 // Andy Goodrich: moved the modification log to the end of the file to
787 // eliminate source line number skew when check-ins are done.
788 //
789 // Revision 1.16 2011/07/25 10:21:17 acg
790 // Andy Goodrich: check in aftermath of call to automake.
791 //
792 // Revision 1.15 2011/04/02 00:04:32 acg
793 // Philipp A. Hartmann: fix distance from member iterators, and
794 // add iterator conversions.
795 //
796 // Revision 1.14 2011/04/01 22:35:19 acg
797 // Andy Goodrich: spelling fix.
798 //
799 // Revision 1.13 2011/03/28 13:03:09 acg
800 // Andy Goodrich: Philipp's latest update.
801 //
802 // Revision 1.12 2011/03/23 16:16:28 acg
803 // Philipp A. Hartmann: rebase implementation on void*
804 // - supports virtual inheritance from sc_object again
805 // - build up get_elements result on demand
806 // - still requires element type to be derived from sc_object
807 //
808 // Revision 1.11 2011/02/19 16:46:36 acg
809 // Andy Goodrich: finally get the update from Philipp correct!
810 //
811 
812 #endif // SC_VECTOR_H_INCLUDED_
813 // Taf!
storage_type::size_type size_type
Definition: sc_vector.h:147
sc_vector_iter(const It &it, SC_ENABLE_IF_((sc_meta::is_more_const< element_type, typename It::policy::element_type >)))
Definition: sc_vector.h:356
sc_vector_element * handle_type
Definition: sc_vector.h:145
bool operator<=(const const_direct_iterator &that) const
Definition: sc_vector.h:384
sc_direct_access< const plain_type > const_policy
Definition: sc_vector.h:237
static element_type * create_element(const char *prefix, size_type index)
Definition: sc_vector.h:668
this_type operator++(int)
Definition: sc_vector.h:367
const char * kind() const
Definition: sc_vector.h:150
sc_vector_iter< const element_type > const_iterator
Definition: sc_vector.h:417
const_iterator end() const
Definition: sc_vector.h:462
const_iterator begin() const
Definition: sc_vector.h:198
const_reference at(size_type idx) const
Definition: sc_vector.h:569
Abstract base class of all SystemC `simulation&#39; objects.
Definition: sc_object.h:61
iterator operator()(sc_vector_assembly< ContainerType, ArgumentType > c)
Definition: sc_vector.h:485
this_type & operator-=(difference_type n)
Definition: sc_vector.h:377
this_type operator+(difference_type n) const
Definition: sc_vector.h:371
element_type & at(size_type i)
Definition: sc_vector.h:441
sc_object * implicit_cast(sc_object *p) const
Definition: sc_vector.h:203
#define SC_ENABLE_IF_(Cond)
Definition: sc_vector.h:107
reference operator*() const
Definition: sc_vector.h:394
sc_vector_assembly(const sc_vector_assembly &other)
Definition: sc_vector.h:616
storage_type::iterator iterator
Definition: sc_vector.h:161
const_iterator cbegin() const
Definition: sc_vector.h:464
sc_member_access< const plain_elem_type, const plain_type > const_policy
Definition: sc_vector.h:272
iterator bind(sc_vector_assembly< ContainerType, ArgumentType > c)
Definition: sc_vector.h:573
iterator bind(BindableContainer &c)
Definition: sc_vector.h:472
void report_empty_bind(const char *kind_, bool dst_empty_) const
Definition: sc_vector.h:636
void init(size_type n)
Definition: sc_vector.h:450
size_type size() const
Definition: sc_vector.h:560
sc_direct_access< plain_type > non_const_policy
Definition: sc_vector.h:236
this_type operator-(difference_type n) const
Definition: sc_vector.h:373
sc_direct_access< type > policy
Definition: sc_vector.h:235
iterator operator()(ArgumentIterator first, ArgumentIterator last, iterator from)
Definition: sc_vector.h:607
difference_type operator-(const_direct_iterator const &that) const
Definition: sc_vector.h:402
base_type::difference_type difference_type
Definition: sc_vector.h:340
iterator bind(BindableIterator first, BindableIterator last, typename base_type::iterator from)
Definition: sc_vector.h:590
virtual sc_object * object_cast(void *p) const
Definition: sc_vector.h:511
const char * name() const
Definition: sc_vector.h:542
const char * kind() const
Definition: sc_vector.h:543
size_type size() const
Definition: sc_vector.h:154
const std::vector< sc_object *> & get_elements() const
Definition: sc_vector.h:758
sc_member_access< element_type, access_type > policy
Definition: sc_vector.h:268
Container::iterator sc_vector_do_bind(Container &cont, ArgumentIterator first, ArgumentIterator last, typename Container::iterator from)
Definition: sc_vector.h:718
reference operator[](difference_type n) const
Definition: sc_vector.h:398
iterator::reference reference
Definition: sc_vector.h:534
const_iterator cend() const
Definition: sc_vector.h:552
sc_vector_base(const char *prefix)
Definition: sc_vector.h:166
iterator bind(BindableIterator first, BindableIterator last)
Definition: sc_vector.h:581
pointer operator->() const
Definition: sc_vector.h:396
const_iterator begin() const
Definition: sc_vector.h:555
iterator operator()(ArgumentIterator first, ArgumentIterator last, typename base_type::iterator from)
Definition: sc_vector.h:612
iterator bind(BindableIterator first, BindableIterator last, iterator from)
Definition: sc_vector.h:480
element_type & operator[](size_type i)
Definition: sc_vector.h:438
const_iterator cend() const
Definition: sc_vector.h:465
sc_direct_access(const non_const_policy &)
Definition: sc_vector.h:240
const_iterator begin() const
Definition: sc_vector.h:461
this_type operator--(int)
Definition: sc_vector.h:368
base_type::difference_type difference_type
Definition: sc_vector.h:533
iterator::pointer pointer
Definition: sc_vector.h:535
iterator bind(BindableContainer &c)
Definition: sc_vector.h:577
void reserve(size_type n)
Definition: sc_vector.h:181
void swap(sc_vector_assembly &that)
Definition: sc_vector.h:628
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
sc_vector(const char *prefix, size_type n)
Definition: sc_vector.h:425
sc_vector_iter< T, sc_member_access< T, MT > > iterator
Definition: sc_vector.h:525
bool operator>(const sc_int_base &a, const sc_int_base &b)
Definition: sc_int_base.h:738
Abstract base class of all SystemC `simulation&#39; objects.
const_iterator cbegin() const
Definition: sc_vector.h:550
const_iterator end() const
Definition: sc_vector.h:199
const_iterator::pointer const_pointer
Definition: sc_vector.h:537
iterator bind(BindableIterator first, BindableIterator last, iterator from)
Definition: sc_vector.h:585
bool operator!=(const const_direct_iterator &that) const
Definition: sc_vector.h:382
void const * at(size_type i) const
Definition: sc_vector.h:178
iterator bind(sc_vector_assembly< ContainerType, ArgumentType > c)
Definition: sc_vector.h:468
const_iterator::reference const_reference
Definition: sc_vector.h:536
sc_vector(const char *prefix)
Definition: sc_vector.h:421
ElementType element_type
Definition: sc_vector.h:231
reference at(size_type idx)
Definition: sc_vector.h:565
const_iterator end() const
Definition: sc_vector.h:557
iterator begin()
Definition: sc_vector.h:458
sc_direct_access(const U &, SC_ENABLE_IF_((sc_meta::is_more_const< type, typename U::policy::element_type >)))
Definition: sc_vector.h:243
const element_type & operator[](size_type i) const
Definition: sc_vector.h:444
#define SC_STATIC_CONSTANT_(Type, Value)
Definition: sc_vector.h:67
Container::iterator sc_vector_do_operator_paren(Container &cont, ArgumentIterator first, ArgumentIterator last, typename Container::iterator from)
Definition: sc_vector.h:735
base_type::pointer pointer
Definition: sc_vector.h:342
sc_member_access< plain_elem_type, plain_type > non_const_policy
Definition: sc_vector.h:270
sc_vector_iter< element_type > iterator
Definition: sc_vector.h:416
iterator operator()(ArgumentContainer &c)
Definition: sc_vector.h:489
storage_type::const_iterator const_iterator
Definition: sc_vector.h:162
bool operator<(const sc_process_handle &left, const sc_process_handle &right)
bool operator==(const const_direct_iterator &that) const
Definition: sc_vector.h:380
this_type & operator++()
Definition: sc_vector.h:365
std::vector< handle_type > storage_type
Definition: sc_vector.h:146
iterator operator()(ArgumentContainer &c)
Definition: sc_vector.h:599
void push_back(void *item)
Definition: sc_vector.h:187
access_typeElementType::* member_type
Definition: sc_vector.h:263
sc_vector_assembly< T, MT > sc_assemble_vector(sc_vector< T > &vec, MT(T::*ptr))
Definition: sc_vector.h:661
iterator end()
Definition: sc_vector.h:459
ElementType element_type
Definition: sc_vector.h:261
sc_vector_assembly< T, MT > assemble(MT(T::*member_ptr))
Definition: sc_vector.h:504
sc_meta::remove_const< type >::type plain_type
Definition: sc_vector.h:233
base_type::reference reference
Definition: sc_vector.h:341
sc_member_access(const non_const_policy &other)
Definition: sc_vector.h:277
const_reference operator[](size_type idx) const
Definition: sc_vector.h:567
sc_meta::remove_const< type >::type plain_type
Definition: sc_vector.h:265
bool operator>=(const const_direct_iterator &that) const
Definition: sc_vector.h:386
sc_vector_assembly & operator=(sc_vector_assembly other_copy)
Definition: sc_vector.h:622
sc_vector_iter< const T, sc_member_access< const T, const MT > > const_iterator
Definition: sc_vector.h:527
iterator operator()(ArgumentIterator first, ArgumentIterator last)
Definition: sc_vector.h:493
sc_vector(const char *prefix, size_type n, Creator creator)
Definition: sc_vector.h:430
void * at(size_type i)
Definition: sc_vector.h:175
storage_type::difference_type difference_type
Definition: sc_vector.h:148
sc_member_access(member_type ptr)
Definition: sc_vector.h:274
this_type & operator+=(difference_type n)
Definition: sc_vector.h:376
sc_meta::remove_const< ElementType >::type plain_elem_type
Definition: sc_vector.h:266
virtual ~sc_vector()
Definition: sc_vector.h:751
const element_type & at(size_type i) const
Definition: sc_vector.h:447
sc_vector< T > base_type
Definition: sc_vector.h:523
iterator operator()(sc_vector_assembly< ContainerType, ArgumentType > c)
Definition: sc_vector.h:595
iterator operator()(ArgumentIterator first, ArgumentIterator last, iterator from)
Definition: sc_vector.h:497
#define SC_API
Definition: sc_cmnhdr.h:168
this_type & operator--()
Definition: sc_vector.h:366
iterator bind(BindableIterator first, BindableIterator last)
Definition: sc_vector.h:476
access_typeT::* member_type
Definition: sc_vector.h:540
iterator operator()(ArgumentIterator first, ArgumentIterator last)
Definition: sc_vector.h:603
reference operator[](size_type idx)
Definition: sc_vector.h:563
base_type::size_type size_type
Definition: sc_vector.h:532