#include <lru.h>
shttl::lru_order< key_type, order_type >に対する継承グラフ
Public 型 | |
typedef order_array_type::iterator | iterator |
typedef std::vector< order_type > | order_array_type |
typedef replacer< key_type >::size_type | size_type |
Public メソッド | |
void | construct (const size_type set_num, const size_type way_num) |
lru_order () | |
size_type | size () |
size_type | target (const size_type index) |
void | touch (const size_type index, const size_type way, const key_type key) |
Protected メソッド | |
iterator | get_set (const size_type index) |
void | reset_set (size_type index) |
Protected 変数 | |
order_array_type | m_order |
size_t | m_set_num |
size_t | m_way_num |
typedef order_array_type::iterator shttl::lru_order< key_type, order_type >::iterator |
typedef std::vector<order_type> shttl::lru_order< key_type, order_type >::order_array_type |
shttl::lru_order< key_type, order_type >::lru_order | ( | ) | [inline] |
void shttl::lru_order< key_type, order_type >::construct | ( | const size_type | set_num, | |
const size_type | way_num | |||
) | [inline] |
参照先 shttl::lru_order< key_type, order_type >::m_order・shttl::lru_order< key_type, order_type >::m_set_num・shttl::lru_order< key_type, order_type >::m_way_num・shttl::lru_order< key_type, order_type >::reset_set()・shttl::lru_order< key_type, order_type >::size().
00224 { 00225 m_way_num = way_num; 00226 m_set_num = set_num; 00227 00228 size_t size = set_num * way_num; 00229 00230 if( std::numeric_limits<order_type>().max() <= way_num ){ 00231 throw std::invalid_argument( 00232 "shttl::lru_order() \n THe specified way number is too large." 00233 ); 00234 } 00235 00236 m_order.resize( size ); 00237 00238 for( size_t i = 0; i < set_num; i++ ){ 00239 reset_set( i ); 00240 } 00241 00242 }
関数の呼び出しグラフ:
iterator shttl::lru_order< key_type, order_type >::get_set | ( | const size_type | index | ) | [inline, protected] |
参照先 shttl::lru_order< key_type, order_type >::m_order・shttl::lru_order< key_type, order_type >::m_way_num.
参照元 shttl::lru_order< key_type, order_type >::reset_set()・shttl::lru_order< key_type, order_type >::target()・shttl::lru_order< key_type, order_type >::touch().
Here is the caller graph for this function:
void shttl::lru_order< key_type, order_type >::reset_set | ( | size_type | index | ) | [inline, protected] |
参照先 shttl::lru_order< key_type, order_type >::get_set()・shttl::lru_order< key_type, order_type >::m_way_num.
参照元 shttl::lru_order< key_type, order_type >::construct().
00289 { 00290 iterator set = get_set( index ); 00291 for( size_t i = 0; i < m_way_num; i++ ){ 00292 set[i] = (order_type)i; // compatible original lru 00293 } 00294 }
関数の呼び出しグラフ:
Here is the caller graph for this function:
size_type shttl::lru_order< key_type, order_type >::size | ( | ) | [inline] |
参照先 shttl::lru_order< key_type, order_type >::m_set_num.
参照元 shttl::lru_order< key_type, order_type >::construct().
00245 { 00246 return m_set_num; 00247 }
Here is the caller graph for this function:
size_type shttl::lru_order< key_type, order_type >::target | ( | const size_type | index | ) | [inline] |
参照先 shttl::lru_order< key_type, order_type >::get_set().
00250 { 00251 return get_set( index )[0]; 00252 }
関数の呼び出しグラフ:
void shttl::lru_order< key_type, order_type >::touch | ( | const size_type | index, | |
const size_type | way, | |||
const key_type | key | |||
) | [inline] |
参照先 shttl::lru_order< key_type, order_type >::get_set()・shttl::lru_order< key_type, order_type >::m_way_num.
00255 { 00256 iterator set = get_set( index ); 00257 // LRU MRU 00258 // initial : 0 1 2 3 4 5 6 7 00259 // touch 0 : 1 2 3 4 5 6 7 0 00260 // touch 3 : 0 1 2 4 5 6 7 3 00261 bool sride = false; 00262 for( size_t w = 0; w < m_way_num; w++ ){ 00263 if( sride ){ 00264 set[ w-1 ] = set[ w ]; 00265 } 00266 else{ 00267 if( set[ w ] == way ){ 00268 sride = true; 00269 } 00270 } 00271 } 00272 set[ m_way_num - 1 ] = (order_type)way; 00273 00274 }
関数の呼び出しグラフ:
order_array_type shttl::lru_order< key_type, order_type >::m_order [protected] |
size_t shttl::lru_order< key_type, order_type >::m_set_num [protected] |
size_t shttl::lru_order< key_type, order_type >::m_way_num [protected] |