27 fprintf(stderr,
"[Warning]: No variable-length dense tag %s value for %s %lu\n",
32 fprintf(stderr,
"[Warning]: No variable-length dense tag %s value for root set\n", name.c_str());
41 const void* default_value,
42 int default_value_size )
51 const void* default_value,
52 int default_value_size )
57 return new VarLenDenseTag( index, name, type, default_value, default_value_size );
109 ptr =
reinterpret_cast< const VarLenTag*
>( mem );
142 if( !mem && allocate )
153 ptr =
reinterpret_cast< VarLenTag*
>( mem );
178 const void** pointers,
195 if( ptr && ptr->
size() )
197 *pointers = ptr->
data();
198 *lengths = ptr->
size();
219 const void** pointers,
234 while( start <= p->second )
238 const size_t count = std::min< size_t >( p->second - start + 1, avail );
251 const VarLenTag* end_data = array + count;
252 while( array != end_data )
256 *pointers = array->
data();
257 *lengths = array->
size();
296 void const*
const* pointers,
304 const size_t step = one_value ? 0 : 1;
310 array->
set( *pointers, *lengths );
322 void const*
const* pointers,
329 const size_t step = one_value ? 0 : 1;
334 while( start <= p->second )
338 const EntityHandle end = std::min< EntityHandle >( p->second + 1, start + avail );
339 while( start != end )
341 array->
set( *pointers, *lengths );
357 void const*
const* pointers,
360 return set_data( seqman, NULL,
entities, num_entities,
false, pointers, lengths );
366 void const*
const* pointers,
376 const void* value_ptr,
379 if( !value_ptr || !value_len )
382 return set_data( seqman, NULL,
entities, num_entities,
true, &value_ptr, &value_len );
388 const void* value_ptr,
391 if( !value_ptr || !value_len )
400 size_t num_entities )
411 if( array ) array->
clear();
426 while( start <= p->second )
430 const EntityHandle end = std::min< EntityHandle >( p->second + 1, start + avail );
433 while( start != end )
460 template <
class Container >
466 typename Container::iterator hint =
entities.begin();
467 std::pair< EntityType, EntityType > range =
type_range( type );
470 for( EntityType t = range.first; t != range.second; ++t )
473 for( i = map.
begin(); i != map.
end(); ++i )
475 data =
reinterpret_cast< const VarLenTag*
>( ( *i )->data()->get_tag_data( mySequenceArray ) );
476 if( !data )
continue;
477 end = data + ( *i )->end_handle() - ( *i )->
data()->start_handle() + 1;
478 iter = data + ( *i )->start_handle() - ( *i )->
data()->start_handle();
480 for( ; iter != end; ++iter, ++handle )
481 if( iter->
size() ) hint =
entities.insert( hint, handle );
488 template <
class Container >
495 typename Container::iterator hint =
entities.begin();
502 if( !data )
continue;
506 for(
size_t i = 0; i < count; ++i )
511 if( MB_FAILURE != rval )
517 template <
class Container >
525 return get_tagged< Container >( seqman, mySequenceArray, type,
entities );
530 std::pair< Range::iterator, Range::iterator > r =
intersect->equal_range( type );
531 return get_tagged< Container >( seqman, mySequenceArray, r.first, r.second,
entities );
544 size_t& output_count,
550 output_count = counter.
end();
556 Range& output_entities,
560 const Range* intersect_entities )
const
562 if( !intersect_entities )
564 std::pair< EntityType, EntityType > range =
type_range( type );
566 for( EntityType t = range.first; t != range.second; ++t )
569 for( i = map.
begin(); i != map.
end(); ++i )
576 start += ( *i )->start_handle() - ( *i )->
data()->start_handle();
599 while( start <= p->second )
603 if( p->second - start < count - 1 ) count = p->second - start + 1;
627 unsigned long& total,
628 unsigned long& per_entity )
const
643 if( ( *i )->data() != prev_data )
645 total += ( *i )->data()->size();
646 prev_data = ( *i )->data();
649 count += ( *i )->
size();
651 for(
int j = 0; j < ( *i )->size(); ++j )
652 per_entity += array[j].mem();
658 if( count ) per_entity /= count;