クラス テンプレート sc_dt::sc_subref_r< X >

#include <sc_bit_proxies.h>

sc_dt::sc_subref_r< X >に対する継承グラフ

Inheritance graph
[凡例]

すべてのメンバ一覧

Public メソッド

 sc_subref_r (const X &obj_, int hi_, int lo_)
 sc_subref_r (const sc_subref_r< X > &a)
sc_subref_r< X > * clone () const
int length () const
int size () const
sc_logic_value_t get_bit (int n) const
void set_bit (int n, sc_logic_value_t value)
sc_digit get_word (int i) const
void set_word (int i, sc_digit w)
sc_digit get_cword (int i) const
void set_cword (int i, sc_digit w)
void clean_tail ()
bool is_01 () const
bool reversed () const

Protected 変数

X & m_obj
int m_hi
int m_lo
int m_len

Private メソッド

void check_bounds ()
 sc_subref_r ()
sc_subref_r< X > & operator= (const sc_subref_r< X > &)


説明

template<class X>
class sc_dt::sc_subref_r< X >

sc_bit_proxies.h659 行で定義されています。


コンストラクタとデストラクタ

template<class X>
sc_dt::sc_subref_r< X >::sc_subref_r ( const X &  obj_,
int  hi_,
int  lo_ 
) [inline]

sc_bit_proxies.h668 行で定義されています。

00669         : m_obj( CCAST<X&>( obj_ ) ), m_hi( hi_ ), m_lo( lo_ ), m_len( 0 )
00670         { check_bounds(); }

template<class X>
sc_dt::sc_subref_r< X >::sc_subref_r ( const sc_subref_r< X > &  a  )  [inline]

sc_bit_proxies.h675 行で定義されています。

00676         : m_obj( a.m_obj ), m_hi( a.m_hi ), m_lo( a.m_lo ), m_len( a.m_len )
00677         {}

template<class X>
sc_dt::sc_subref_r< X >::sc_subref_r (  )  [private]


関数

template<class X>
void sc_dt::sc_subref_r< X >::check_bounds (  )  [inline, private]

sc_bit_proxies.h2510 行で定義されています。

02511 {
02512     int len = m_obj.length();
02513     if( m_hi < 0 || m_hi >= len || m_lo < 0 || m_lo >= len ) {
02514         SC_REPORT_ERROR( sc_core::SC_ID_OUT_OF_BOUNDS_, 0 );
02515     }
02516     if( reversed() ) {
02517         m_len = m_lo - m_hi + 1;
02518     } else {
02519         m_len = m_hi - m_lo + 1;
02520     }
02521 }

template<class X>
sc_subref_r<X>* sc_dt::sc_subref_r< X >::clone (  )  const [inline]

sc_dt::sc_subref< X >で再定義されています。

sc_bit_proxies.h682 行で定義されています。

00683         { return new sc_subref_r<X>( *this ); }

template<class X>
int sc_dt::sc_subref_r< X >::length (  )  const [inline]

sc_bit_proxies.h688 行で定義されています。

00689         { return m_len; }

template<class X>
int sc_dt::sc_subref_r< X >::size (  )  const [inline]

sc_bit_proxies.h691 行で定義されています。

00692         { return ( (length() - 1) / SC_DIGIT_SIZE + 1 ); }

template<class X>
sc_logic_value_t sc_dt::sc_subref_r< X >::get_bit ( int  n  )  const [inline]

sc_bit_proxies.h2529 行で定義されています。

02530 {
02531     if( reversed() ) {
02532         return m_obj.get_bit( m_lo - n );
02533     } else {
02534         return m_obj.get_bit( m_lo + n );
02535     }
02536 }

template<class X>
void sc_dt::sc_subref_r< X >::set_bit ( int  n,
sc_logic_value_t  value 
) [inline]

sc_bit_proxies.h2541 行で定義されています。

02542 {
02543     if( reversed() ) {
02544         m_obj.set_bit( m_lo - n, value );
02545     } else {
02546         m_obj.set_bit( m_lo + n, value );
02547     }
02548 }

template<class X>
sc_digit sc_dt::sc_subref_r< X >::get_word ( int  i  )  const [inline]

sc_bit_proxies.h2554 行で定義されています。

02555 {
02556     int n1 = 0;
02557     int n2 = 0;
02558     sc_digit result = 0;
02559     int k = 0;
02560     if( reversed() ) {
02561         n1 = m_lo - i * SC_DIGIT_SIZE;
02562         n2 = sc_max( n1 - SC_DIGIT_SIZE, m_hi - 1 );
02563         for( int n = n1; n > n2; n -- ) {
02564             result |= (m_obj[n].value() & SC_DIGIT_ONE) << k ++;
02565         }
02566     } else {
02567         n1 = m_lo + i * SC_DIGIT_SIZE;
02568         n2 = sc_min( n1 + SC_DIGIT_SIZE, m_hi + 1 );
02569         for( int n = n1; n < n2; n ++ ) {
02570             result |= (m_obj[n].value() & SC_DIGIT_ONE) << k ++;
02571         }
02572     }
02573     return result;
02574 }

template<class X>
void sc_dt::sc_subref_r< X >::set_word ( int  i,
sc_digit  w 
) [inline]

sc_bit_proxies.h2579 行で定義されています。

02580 {
02581     int n1 = 0;
02582     int n2 = 0;
02583     int k = 0;
02584     if( reversed() ) {
02585         n1 = m_lo - i * SC_DIGIT_SIZE;
02586         n2 = sc_max( n1 - SC_DIGIT_SIZE, m_hi - 1 );
02587         for( int n = n1; n > n2; n -- ) {
02588             m_obj.set_bit( n, sc_logic_value_t( (w >> k ++) & SC_DIGIT_ONE |
02589                                                 m_obj[n].value() & SC_DIGIT_TWO ) );
02590         }
02591     } else {
02592         n1 = m_lo + i * SC_DIGIT_SIZE;
02593         n2 = sc_min( n1 + SC_DIGIT_SIZE, m_hi + 1 );
02594         for( int n = n1; n < n2; n ++ ) {
02595             m_obj.set_bit( n, sc_logic_value_t( (w >> k ++) & SC_DIGIT_ONE |
02596                                                 m_obj[n].value() & SC_DIGIT_TWO ) );
02597         }
02598     }
02599 }

template<class X>
sc_digit sc_dt::sc_subref_r< X >::get_cword ( int  i  )  const [inline]

sc_bit_proxies.h2605 行で定義されています。

02606 {
02607     int n1 = 0;
02608     int n2 = 0;
02609     sc_digit result = 0;
02610     int k = 0;
02611     if( reversed() ) {
02612         n1 = m_lo - i * SC_DIGIT_SIZE;
02613         n2 = sc_max( n1 - SC_DIGIT_SIZE, m_hi - 1 );
02614         for( int n = n1; n > n2; n -- ) {
02615             result |= ((m_obj[n].value() & SC_DIGIT_TWO) >> 1) << k ++;
02616         }
02617     } else {
02618         n1 = m_lo + i * SC_DIGIT_SIZE;
02619         n2 = sc_min( n1 + SC_DIGIT_SIZE, m_hi + 1 );
02620         for( int n = n1; n < n2; n ++ ) {
02621             result |= ((m_obj[n].value() & SC_DIGIT_TWO) >> 1) << k ++;
02622         }
02623     }
02624     return result;
02625 }

template<class X>
void sc_dt::sc_subref_r< X >::set_cword ( int  i,
sc_digit  w 
) [inline]

sc_bit_proxies.h2630 行で定義されています。

02631 {
02632     int n1 = 0;
02633     int n2 = 0;
02634     int k = 0;
02635     if( reversed() ) {
02636         n1 = m_lo - i * SC_DIGIT_SIZE;
02637         n2 = sc_max( n1 - SC_DIGIT_SIZE, m_hi - 1 );
02638         for( int n = n1; n > n2; n -- ) {
02639             m_obj.set_bit( n, sc_logic_value_t( ((w >> k ++) & SC_DIGIT_ONE) << 1 |
02640                                                 m_obj[n].value() & SC_DIGIT_ONE ) );
02641         }
02642     } else {
02643         n1 = m_lo + i * SC_DIGIT_SIZE;
02644         n2 = sc_min( n1 + SC_DIGIT_SIZE, m_hi + 1 );
02645         for( int n = n1; n < n2; n ++ ) {
02646             m_obj.set_bit( n, sc_logic_value_t( ((w >> k ++) & SC_DIGIT_ONE) << 1 |
02647                                                 m_obj[n].value() & SC_DIGIT_ONE ) );
02648         }
02649     }
02650 }

template<class X>
void sc_dt::sc_subref_r< X >::clean_tail (  )  [inline]

sc_bit_proxies.h703 行で定義されています。

00704         { m_obj.clean_tail(); }

template<class X>
bool sc_dt::sc_subref_r< X >::is_01 (  )  const [inline]

sc_bit_proxies.h2658 行で定義されています。

02659 {
02660     int sz = size();
02661     for( int i = 0; i < sz; ++ i ) {
02662         if( get_cword( i ) != SC_DIGIT_ZERO ) {
02663             return false;
02664         }
02665     }
02666     return true;
02667 }

template<class X>
bool sc_dt::sc_subref_r< X >::reversed (  )  const [inline]

sc_bit_proxies.h711 行で定義されています。

00712         { return m_lo > m_hi; }

template<class X>
sc_subref_r<X>& sc_dt::sc_subref_r< X >::operator= ( const sc_subref_r< X > &   )  [private]

sc_dt::sc_subref< X >で再定義されています。


変数

template<class X>
X& sc_dt::sc_subref_r< X >::m_obj [mutable, protected]

sc_bit_proxies.h716 行で定義されています。

template<class X>
int sc_dt::sc_subref_r< X >::m_hi [protected]

sc_bit_proxies.h717 行で定義されています。

template<class X>
int sc_dt::sc_subref_r< X >::m_lo [protected]

sc_bit_proxies.h718 行で定義されています。

template<class X>
int sc_dt::sc_subref_r< X >::m_len [protected]

sc_bit_proxies.h719 行で定義されています。


このクラスの説明は次のファイルから生成されました:

SystemCに対してFri Jun 6 20:12:36 2008に生成されました。  doxygen 1.5.6