クラス テンプレート sc_dt::sc_concref_r< X, Y >

#include <sc_bit_proxies.h>

sc_dt::sc_concref_r< X, Y >に対する継承グラフ

Inheritance graph
[凡例]

すべてのメンバ一覧

Public メソッド

 sc_concref_r (const X &left_, const Y &right_, int delete_=0)
 sc_concref_r (const sc_concref_r< X, Y > &a)
virtual ~sc_concref_r ()
sc_concref_r< X, Y > * 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

Protected 変数

X & m_left
Y & m_right
int m_delete
int & m_refs

Private メソッド

 sc_concref_r ()
sc_concref_r< X, Y > & operator= (const sc_concref_r< X, Y > &)


説明

template<class X, class Y>
class sc_dt::sc_concref_r< X, Y >

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


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

template<class X, class Y>
sc_dt::sc_concref_r< X, Y >::sc_concref_r ( const X &  left_,
const Y &  right_,
int  delete_ = 0 
) [inline]

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

01141         : m_left( CCAST<X&>( left_ ) ), m_right( CCAST<Y&>( right_ ) ),
01142           m_delete( delete_ ), m_refs( *new int( 1 ) )
01143         {}

template<class X, class Y>
sc_dt::sc_concref_r< X, Y >::sc_concref_r ( const sc_concref_r< X, Y > &  a  )  [inline]

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

01149         : m_left( a.m_left ), m_right( a.m_right ),
01150           m_delete( a.m_delete ), m_refs( a.m_refs )
01151         { ++ m_refs; }

template<class X, class Y>
sc_dt::sc_concref_r< X, Y >::~sc_concref_r (  )  [inline, virtual]

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

03018 {
03019     if( -- m_refs == 0 ) {
03020         delete &m_refs;
03021         if( m_delete == 0 ) {
03022             return;
03023         }
03024         if( m_delete & 1 ) {
03025             delete &m_left;
03026         }
03027         if( m_delete & 2 ) {
03028             delete &m_right;
03029         }
03030     }
03031 }

template<class X, class Y>
sc_dt::sc_concref_r< X, Y >::sc_concref_r (  )  [private]


関数

template<class X, class Y>
sc_concref_r<X,Y>* sc_dt::sc_concref_r< X, Y >::clone (  )  const [inline]

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

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

01162         { return new sc_concref_r<X,Y>( *this ); }

template<class X, class Y>
int sc_dt::sc_concref_r< X, Y >::length (  )  const [inline]

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

01168         { return ( m_left.length() + m_right.length() ); }

template<class X, class Y>
int sc_dt::sc_concref_r< X, Y >::size (  )  const [inline]

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

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

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

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

03040 {
03041     int r_len = m_right.length();
03042     if( n < r_len ) {
03043         return m_right.get_bit( n );
03044     } else if( n < r_len + m_left.length() ) {
03045         return m_left.get_bit( n - r_len );
03046     } else {
03047         SC_REPORT_ERROR( sc_core::SC_ID_OUT_OF_BOUNDS_, 0 );
03048         // never reached
03049         return Log_0;
03050     }
03051 }

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

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

03057 {
03058     int r_len = m_right.length();
03059     if( n < r_len ) {
03060         m_right.set_bit( n, v );
03061     } else if( n < r_len + m_left.length() ) {
03062         m_left.set_bit( n - r_len, v );
03063     } else {
03064         SC_REPORT_ERROR( sc_core::SC_ID_OUT_OF_BOUNDS_, 0 );
03065     }
03066 }

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

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

03073 {
03074     if( i < 0 || i >= size() ) {
03075         SC_REPORT_ERROR( sc_core::SC_ID_OUT_OF_BOUNDS_, 0 );
03076     }
03077     // 0 <= i < size()
03078     Y& r = m_right;
03079     int r_len = r.length();
03080     int border = r_len / SC_DIGIT_SIZE;
03081     if( i < border ) {
03082         return r.get_word( i );
03083     }
03084     // border <= i < size()
03085     X& l = m_left;
03086     int shift = r_len % SC_DIGIT_SIZE;
03087     int j = i - border;
03088     if( shift == 0 ) {
03089         return l.get_word( j );
03090     }
03091     // border <= i < size() && shift != 0
03092     int nshift = SC_DIGIT_SIZE - shift;
03093     if( i == border ) {
03094         sc_digit rl_mask = ~SC_DIGIT_ZERO >> nshift;
03095         return ( (r.get_word( i ) & rl_mask) | (l.get_word( 0 ) << shift) );
03096     }
03097     // border < i < size() && shift != 0
03098     if ( j < l.size() )
03099         return ( (l.get_word( j - 1 ) >> nshift) | (l.get_word( j ) << shift) );
03100     else
03101         return (l.get_word( j - 1 ) >> nshift);
03102 }

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

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

03108 {
03109     if( i < 0 || i >= size() ) {
03110         SC_REPORT_ERROR( sc_core::SC_ID_OUT_OF_BOUNDS_, 0 );
03111     }
03112     // 0 <= i < size()
03113     Y& r = m_right;
03114     int r_len = r.length();
03115     int border = r_len / SC_DIGIT_SIZE;
03116     if( i < border ) {
03117         r.set_word( i, w );
03118         return;
03119     }
03120     // border <= i < size()
03121     X& l = m_left;
03122     int shift = r_len % SC_DIGIT_SIZE;
03123     int j = i - border;
03124     if( shift == 0 ) {
03125         l.set_word( j, w );
03126         return;
03127     }
03128     // border <= i < size() && shift != 0
03129     int nshift = SC_DIGIT_SIZE - shift;
03130     sc_digit lh_mask = ~SC_DIGIT_ZERO << nshift;
03131     if( i == border ) {
03132         sc_digit rl_mask = ~SC_DIGIT_ZERO >> nshift;
03133         r.set_word( i, w & rl_mask );
03134         l.set_word( 0, (l.get_word( 0 ) & lh_mask) | (w >> shift) );
03135         return;
03136     }
03137     // border < i < size() && shift != 0
03138     sc_digit ll_mask = ~SC_DIGIT_ZERO >> shift;
03139     l.set_word( j - 1, (l.get_word( j - 1 ) & ll_mask) | (w << nshift) );
03140     if ( j < l.size() )
03141         l.set_word( j, (l.get_word( j ) & lh_mask) | (w >> shift) );
03142 }

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

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

03149 {
03150     if( i < 0 || i >= size() ) {
03151         SC_REPORT_ERROR( sc_core::SC_ID_OUT_OF_BOUNDS_, 0 );
03152     }
03153     // 0 <= i < size()
03154     Y& r = m_right;
03155     int r_len = r.length();
03156     int border = r_len / SC_DIGIT_SIZE;
03157     if( i < border ) {
03158         return r.get_cword( i );
03159     }
03160     // border <= i < size()
03161     X& l = m_left;
03162     int shift = r_len % SC_DIGIT_SIZE;
03163     int j = i - border;
03164     if( shift == 0 ) {
03165         return l.get_cword( j );
03166     }
03167     // border <= i < size() && shift != 0
03168     int nshift = SC_DIGIT_SIZE - shift;
03169     if( i == border ) {
03170         sc_digit rl_mask = ~SC_DIGIT_ZERO >> nshift;
03171         return ( (r.get_cword( i ) & rl_mask) | (l.get_cword( 0 ) << shift) );
03172     }
03173     // border < i < size() && shift != 0
03174     if ( j < l.size() )
03175         return ( (l.get_cword(j - 1) >> nshift) | (l.get_cword(j) << shift) );
03176     else
03177         return (l.get_cword( j - 1 ) >> nshift);
03178 }

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

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

03184 {
03185     if( i < 0 || i >= size() ) {
03186         SC_REPORT_ERROR( sc_core::SC_ID_OUT_OF_BOUNDS_, 0 );
03187     }
03188     // 0 <= i < size()
03189     Y& r = m_right;
03190     int r_len = r.length();
03191     int border = r_len / SC_DIGIT_SIZE;
03192     if( i < border ) {
03193         r.set_cword( i, w );
03194         return;
03195     }
03196     // border <= i < size()
03197     X& l = m_left;
03198     int shift = r_len % SC_DIGIT_SIZE;
03199     int j = i - border;
03200     if( shift == 0 ) {
03201         l.set_cword( j, w );
03202         return;
03203     }
03204     // border <= i < size() && shift != 0
03205     int nshift = SC_DIGIT_SIZE - shift;
03206     sc_digit lh_mask = ~SC_DIGIT_ZERO << nshift;
03207     if( i == border ) {
03208         sc_digit rl_mask = ~SC_DIGIT_ZERO >> nshift;
03209         r.set_cword( i, w & rl_mask );
03210         l.set_cword( 0, (l.get_cword( 0 ) & lh_mask) | (w >> shift) );
03211         return;
03212     }
03213     // border < i < size() && shift != 0
03214     sc_digit ll_mask = ~SC_DIGIT_ZERO >> shift;
03215     l.set_cword( j - 1, (l.get_cword( j - 1 ) & ll_mask) | (w << nshift) );
03216     if ( j < l.size() )
03217         l.set_cword( j, (l.get_cword( j ) & lh_mask) | (w >> shift) );
03218 }

template<class X, class Y>
void sc_dt::sc_concref_r< X, Y >::clean_tail (  )  [inline]

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

01183         { m_left.clean_tail(); m_right.clean_tail(); }

template<class X, class Y>
bool sc_dt::sc_concref_r< X, Y >::is_01 (  )  const [inline]

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

01189         { return ( m_left.is_01() && m_right.is_01() ); }

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


変数

template<class X, class Y>
X& sc_dt::sc_concref_r< X, Y >::m_left [mutable, protected]

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

template<class X, class Y>
Y& sc_dt::sc_concref_r< X, Y >::m_right [mutable, protected]

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

template<class X, class Y>
int sc_dt::sc_concref_r< X, Y >::m_delete [mutable, protected]

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

template<class X, class Y>
int& sc_dt::sc_concref_r< X, Y >::m_refs [mutable, protected]

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


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

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