16 #ifndef INCLUDED_core_fragment_FragCache_HH
17 #define INCLUDED_core_fragment_FragCache_HH
33 #include <utility/vector1.fwd.hh>
34 #include <utility/pointer/ReferenceCount.hh>
35 #include <utility/excn/Exceptions.hh>
40 #include <utility/vector1.hh>
50 typedef std::map< core::Size, T >
TMap;
59 store( new_id, value );
64 typename TMap::const_iterator iter(
map_.find( frag_id ) );
65 if ( iter ==
map_.end() ) {
75 map_[ frag_id ] = value;
95 store( new_id, value );
100 value =
list_[ frag_id ];
105 return list_[ frag_id ];
109 if ( frag_id >
list_.size() ) {
110 list_.resize( frag_id );
112 list_[ frag_id ] = value;
116 if ( frag_id >
list_.size() ) {
117 list_.resize( frag_id );
124 template<
class T,
class XCacheUnit >
144 return cache( frame ).retrieve( frame.
frag_id( frag_num ), score );
156 throw utility::excn::EXCN_RangeError(
"no "+
tag_+
"entry found for fragment: ");
165 throw utility::excn::EXCN_RangeError(
"no "+
tag_+
"entry found for fragment: ");
171 if (
retrieve( frame, frag_num, val ) ) {
174 throw utility::excn::EXCN_RangeError(
"no "+
tag_+
"entry found for fragment");
180 cache( frame ).store( frame.
frag_id( frag_num ), score );
191 frag_ids.push_back(
ScoredFrag( *it, score ) );
193 frag_ids.push_back(
ScoredFrag( *it, *empty ) );
218 return cache( frame );