クラス テンプレート shttl::shttl_bitset< N, T >

#include <bitset.h>

shttl::shttl_bitset< N, T >のコラボレーション図

Collaboration graph
[凡例]
すべてのメンバ一覧

Public 型

typedef size_t size_type
typedef shttl_bitset< N, T > this_type
typedef T value_type

Public メソッド

bool any () const
reference at (size_type p)
size_t count () const
this_typeflip (size_type p)
this_typeflip ()
bool none () const
this_typeoperator &= (const this_type &i)
bool operator!= (const this_type &i) const
this_type operator<< (size_type s) const
this_typeoperator<<= (size_type w)
bool operator== (const this_type &i) const
this_type operator>> (size_type s) const
this_typeoperator>>= (size_type w)
reference operator[] (size_type p)
this_typeoperator^= (const this_type &i)
this_typeoperator|= (const this_type &i)
this_type operator~ () const
this_typereset (size_type p)
this_typereset ()
this_typeset (size_type p, int v=1)
this_typeset ()
template<class C, class R, class A>
 shttl_bitset (const std::basic_string< C, R, A > &s, typename std::basic_string< C, R, A >::size_type p=0, typename std::basic_string< C, R, A >::size_type l=-1)
 shttl_bitset (u64 v=0)
size_t size () const
bool test (size_type p) const
std::string to_string () const
u64 to_ulong () const

Protected 変数

value_type _v

フレンド

class reference

構成

class  reference

説明

template<size_t N, class T = u64>
class shttl::shttl_bitset< N, T >

bitset.h55 行で定義されています。


型定義

template<size_t N, class T = u64>
typedef size_t shttl::shttl_bitset< N, T >::size_type

shttl::xbitset< N >で再定義されています。

bitset.h63 行で定義されています。

template<size_t N, class T = u64>
typedef shttl_bitset<N, T> shttl::shttl_bitset< N, T >::this_type

shttl::xbitset< N >で再定義されています。

bitset.h62 行で定義されています。

template<size_t N, class T = u64>
typedef T shttl::shttl_bitset< N, T >::value_type

bitset.h61 行で定義されています。


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

template<size_t N, class T = u64>
shttl::shttl_bitset< N, T >::shttl_bitset ( u64  v = 0  )  [inline]

bitset.h75 行で定義されています。

00075                                 :
00076           _v( (value_type)( v & umax(size()) ) )
00077         {
00078         }

template<size_t N, class T = u64>
template<class C, class R, class A>
shttl::shttl_bitset< N, T >::shttl_bitset ( const std::basic_string< C, R, A > &  s,
typename std::basic_string< C, R, A >::size_type  p = 0,
typename std::basic_string< C, R, A >::size_type  l = -1 
) [inline, explicit]

bitset.h82 行で定義されています。

00087         {
00088             std::bitset<u64_bits> bs;
00089             try {
00090                 bs = std::bitset<u64_bits>(s, p, l);
00091             }
00092             catch (std::invalid_argument) {
00093                 throw std::invalid_argument("shttl_bitset::shttl_bitset");
00094             }
00095             _v = (value_type)( bs.to_ulong() & umax(size()) );
00096         }


関数

template<size_t N, class T = u64>
bool shttl::shttl_bitset< N, T >::any (  )  const [inline]

shttl::xbitset< N >で再定義されています。

bitset.h227 行で定義されています。

00227 { return _v != 0; }

template<size_t N, class T = u64>
reference shttl::shttl_bitset< N, T >::at ( size_type  p  )  [inline]

bitset.h201 行で定義されています。

00202         { 
00203             if (p < 0 || size() <= p)
00204                 throw std::out_of_range("shttl_bitset<N, T>::at");
00205             return reference(*this, p); 
00206         }

template<size_t N, class T>
size_t shttl::shttl_bitset< N, T >::count (  )  const

bitset.h295 行で定義されています。

参照先 shttl::shttl_bitset< N, T >::size()shttl::shttl_bitset< N, T >::test().

00296     {
00297         int s = 0;
00298         for (int p = 0; p < size(); ++p) 
00299             if (test(p))
00300                 ++s;
00301         return s;
00302     }

関数の呼び出しグラフ:

template<size_t N, class T = u64>
this_type& shttl::shttl_bitset< N, T >::flip ( size_type  p  )  [inline]

bitset.h186 行で定義されています。

00186                                      {
00187             if (p < 0 || size() <= p)
00188                 throw std::out_of_range("shttl_bitset<N, T>::flip");
00189             _v ^= mask(p);
00190             return *this;
00191         }

template<size_t N, class T = u64>
this_type& shttl::shttl_bitset< N, T >::flip (  )  [inline]

bitset.h181 行で定義されています。

参照元 shttl::shttl_bitset< N, T >::reference::flip().

00181                           {
00182             _v = ~_v & umax(size());
00183             return *this;
00184         }

Here is the caller graph for this function:

template<size_t N, class T = u64>
bool shttl::shttl_bitset< N, T >::none (  )  const [inline]

shttl::xbitset< N >で再定義されています。

bitset.h228 行で定義されています。

00228 { return _v == 0; }

template<size_t N, class T = u64>
this_type& shttl::shttl_bitset< N, T >::operator &= ( const this_type i  )  [inline]

bitset.h132 行で定義されています。

00132 { _v &= i._v;   return *this;  }

template<size_t N, class T = u64>
bool shttl::shttl_bitset< N, T >::operator!= ( const this_type i  )  const [inline]

bitset.h219 行で定義されています。

00219 { return _v != i._v; }

template<size_t N, class T = u64>
this_type shttl::shttl_bitset< N, T >::operator<< ( size_type  s  )  const [inline]

bitset.h230 行で定義されています。

00230                                                 { 
00231             return this_type((_v << s) & umax(size()));
00232         }

template<size_t N, class T = u64>
this_type& shttl::shttl_bitset< N, T >::operator<<= ( size_type  w  )  [inline]

bitset.h136 行で定義されています。

00136                                             { 
00137             _v <<= w;
00138             _v &= umax(size());  
00139             return *this; 
00140         }

template<size_t N, class T = u64>
bool shttl::shttl_bitset< N, T >::operator== ( const this_type i  )  const [inline]

bitset.h218 行で定義されています。

00218 { return _v == i._v; }

template<size_t N, class T = u64>
this_type shttl::shttl_bitset< N, T >::operator>> ( size_type  s  )  const [inline]

bitset.h233 行で定義されています。

00233                                                 {
00234             return this_type((_v >> s) & umax(size()));
00235         }

template<size_t N, class T = u64>
this_type& shttl::shttl_bitset< N, T >::operator>>= ( size_type  w  )  [inline]

bitset.h141 行で定義されています。

00141                                             { 
00142             _v >>= w;
00143             _v &= umax(size());  
00144             return *this;  
00145         }

template<size_t N, class T = u64>
reference shttl::shttl_bitset< N, T >::operator[] ( size_type  p  )  [inline]

bitset.h196 行で定義されています。

00196                                           { 
00197             SHTTL_ASSERT(0 <= p || p < size());
00198             return reference(*this, p); 
00199         }

template<size_t N, class T = u64>
this_type& shttl::shttl_bitset< N, T >::operator^= ( const this_type i  )  [inline]

bitset.h134 行で定義されています。

00134 { _v ^= i._v;   return *this;  }

template<size_t N, class T = u64>
this_type& shttl::shttl_bitset< N, T >::operator|= ( const this_type i  )  [inline]

bitset.h133 行で定義されています。

00133 { _v |= i._v;   return *this;  }

template<size_t N, class T = u64>
this_type shttl::shttl_bitset< N, T >::operator~ (  )  const [inline]

bitset.h177 行で定義されています。

00177                                     {
00178             return this_type(~_v & umax(size()));
00179         }

template<size_t N, class T = u64>
this_type& shttl::shttl_bitset< N, T >::reset ( size_type  p  )  [inline]

bitset.h170 行で定義されています。

00170                                       {
00171             if (p < 0 || size() <= p)
00172                 throw std::out_of_range("shttl_bitset<N, T>::reset");
00173             _v &= ~mask(p);
00174             return *this;
00175         }

template<size_t N, class T = u64>
this_type& shttl::shttl_bitset< N, T >::reset (  )  [inline]

shttl::xbitset< N >で再定義されています。

bitset.h165 行で定義されています。

00165                            {
00166             _v = 0;
00167             return *this;
00168         }

template<size_t N, class T = u64>
this_type& shttl::shttl_bitset< N, T >::set ( size_type  p,
int  v = 1 
) [inline]

bitset.h155 行で定義されています。

00155                                                {
00156             if (p < 0 || size() <= p)
00157                 throw std::out_of_range("shttl_bitset<N, T>::set");
00158             if (v) 
00159                 _v |=  mask(p);
00160             else
00161                 _v &= ~mask(p);
00162             return *this;
00163         }

template<size_t N, class T = u64>
this_type& shttl::shttl_bitset< N, T >::set (  )  [inline]

bitset.h150 行で定義されています。

参照元 shttl::shttl_bitset< N, T >::reference::operator=().

00150                          {
00151             _v = umax(size());
00152             return *this;
00153         }

Here is the caller graph for this function:

template<size_t N, class T = u64>
size_t shttl::shttl_bitset< N, T >::size (  )  const [inline]

bitset.h216 行で定義されています。

参照元 shttl::shttl_bitset< N >::at()shttl::shttl_bitset< N, T >::count()shttl::shttl_bitset< N >::flip()shttl::shttl_bitset< N >::operator<<()shttl::shttl_bitset< N >::operator<<=()shttl::shttl_bitset< N >::operator>>()shttl::shttl_bitset< N >::operator>>=()shttl::shttl_bitset< N >::operator[]()shttl::shttl_bitset< N >::operator~()shttl::shttl_bitset< N >::reset()shttl::shttl_bitset< N >::set()shttl::shttl_bitset< N >::shttl_bitset()shttl::shttl_bitset< N >::test()shttl::shttl_bitset< N, T >::to_string()shttl::shttl_bitset< N >::to_ulong().

00216 { return N; }

Here is the caller graph for this function:

template<size_t N, class T = u64>
bool shttl::shttl_bitset< N, T >::test ( size_type  p  )  const [inline]

bitset.h221 行で定義されています。

参照元 shttl::shttl_bitset< N, T >::count()shttl::xbitset< N >::const_reference::operator bool()shttl::shttl_bitset< N, T >::reference::operator bool()shttl::xbitset< N >::const_reference::operator~()shttl::shttl_bitset< N, T >::reference::operator~()shttl::shttl_bitset< N, T >::to_string().

00221                                      {
00222             if (p < 0 || size() <= p)
00223                 throw std::out_of_range("shttl_bitset::test");
00224             return shttl::test(_v, p);
00225         }

Here is the caller graph for this function:

template<size_t N, class T>
std::string shttl::shttl_bitset< N, T >::to_string (  )  const

bitset.h285 行で定義されています。

参照先 shttl::shttl_bitset< N, T >::size()shttl::shttl_bitset< N, T >::test().

参照元 shttl::operator<<().

00286     {
00287         std::string s;
00288         for (int p = (int)size() - 1; p >= 0; --p) 
00289             s += test(p) ? '1' : '0';
00290         return s;
00291     }

関数の呼び出しグラフ:

Here is the caller graph for this function:

template<size_t N, class T = u64>
u64 shttl::shttl_bitset< N, T >::to_ulong (  )  const [inline]

bitset.h208 行で定義されています。

参照元 shttl::operator &()shttl::operator^()shttl::operator|().

00208                              {
00209             SHTTL_ASSERT(_v <= umax(size()));
00210             return _v;
00211         }

Here is the caller graph for this function:


フレンドと関連する関数

template<size_t N, class T = u64>
friend class reference [friend]

bitset.h57 行で定義されています。

参照元 shttl::shttl_bitset< N >::at()shttl::shttl_bitset< N >::operator[]().


変数

template<size_t N, class T = u64>
value_type shttl::shttl_bitset< N, T >::_v [protected]

bitset.h69 行で定義されています。

参照元 shttl::shttl_bitset< N >::any()shttl::shttl_bitset< N >::flip()shttl::shttl_bitset< N >::none()shttl::shttl_bitset< N >::operator &=()shttl::shttl_bitset< N >::operator!=()shttl::shttl_bitset< N >::operator<<()shttl::shttl_bitset< N >::operator<<=()shttl::shttl_bitset< N >::operator==()shttl::shttl_bitset< N >::operator>>()shttl::shttl_bitset< N >::operator>>=()shttl::shttl_bitset< N >::operator^=()shttl::shttl_bitset< N >::operator|=()shttl::shttl_bitset< N >::operator~()shttl::shttl_bitset< N >::reset()shttl::shttl_bitset< N >::set()shttl::shttl_bitset< N >::shttl_bitset()shttl::shttl_bitset< N >::test()shttl::shttl_bitset< N >::to_ulong().


このクラスの説明は次のファイルから生成されました:
Onikiri2に対してTue Jun 18 15:36:04 2013に生成されました。  doxygen 1.4.7