11 #ifndef INCLUDED_core_graph_ArrayPool_hh
12 #define INCLUDED_core_graph_ArrayPool_hh
15 #include <platform/types.hh>
18 #include <utility/pointer/ReferenceCount.hh>
19 #include <utility/exit.hh>
20 #include <utility/string_util.hh>
25 #include <utility/vector1.hh>
103 return index <
size_;
108 return index < (int) size_ && index >= 0;
181 array_( neg_ptr->array(), size ),
263 utility_exit_with_message(
"Error in ArrayPool destructor: cannot free a non-empty ArrayPool" );
299 utility_exit_with_message(
"ERROR: ArrayPool array size cannot be changed unless the ArrayPool is empty" );
309 utility_exit_with_message(
"ERROR: ArrayPool block size cannot be changed unless the ArrayPool is empty" );
350 assert( first != 0 );
369 assert( neg_element != 0 );
397 if ( neg_block == 0 ) {
398 utility_exit_with_message(
"ERROR: new failed in ArrayPool when requesting neg space block of size " +
406 if ( t_block == 0 ) {
407 utility_exit_with_message(
"ERROR: new failed in ArrayPool when requesting Array block of size " +
414 T * t_iter = t_block;
421 neg_iter = neg_block;
438 if ( neg_block == 0 ) {
439 utility_exit_with_message(
"ERROR: new failed in ArrayPool when requesting neg space block of size " +
445 T *
const t_block = 0;
452 neg_iter = neg_block;
476 iter != end_iter; ++iter ) {
481 for (
typename std::list< T * >::const_iterator
484 iter != end_iter; ++iter ) {
506 iter != end_iter; ++iter ) {
507 if ( neg_element >= (*iter ) && neg_element < (*iter) +
block_size_ ) {