25 fprintf(stderr,
"[Warning]: No dense tag %s value for %s %ld\n",
30 fprintf(stderr,
"[Warning]: No dense tag %s value for root set\n", name.c_str());
42 "[Warning]: Invalid entity handle setting tag %s: %s %ld\n",
53 :
TagInfo( name, size, type, default_value, size ), mySequenceArray(
index ), meshValue( 0 )
67 const void* default_value )
69 if( bytes < 1 )
return 0;
74 return new DenseTag(
index, name, bytes, type, default_value );
93 const unsigned char*
const& ptr,
99 return get_array_private( seqman, NULL, h,
const_cast< const unsigned char*&
>( ptr ), count );
105 const unsigned char*& ptr,
106 size_t& count )
const
127 ptr =
reinterpret_cast< const unsigned char*
>( mem );
176 if( !mem && allocate )
187 ptr =
reinterpret_cast< unsigned char*
>( mem );
200 unsigned char* ptr =
reinterpret_cast< unsigned char*
>( adata );
201 const EntityHandle*
const end = entities + num_entities;
204 const unsigned char* data = 0;
220 const Range& entities,
224 const unsigned char* array = NULL;
225 unsigned char* data =
reinterpret_cast< unsigned char*
>( values );
230 while( start <= p->second )
234 const size_t count = std::min< size_t >( p->second - start + 1, avail );
236 memcpy( data, array,
get_size() * count );
254 const void** pointers,
255 int* data_lengths )
const
258 const EntityHandle*
const end = entities + num_entities;
260 const unsigned char* ptr = NULL;
268 for(
const EntityHandle* i = entities; i != end; ++i, ++pointers )
270 result =
get_array( seqman, NULL, *i, ptr, junk );
286 const Range& entities,
287 const void** pointers,
288 int* data_lengths )
const
291 const unsigned char* array = NULL;
302 while( start <= p->second )
306 const size_t count = std::min< size_t >( p->second - start + 1, avail );
309 for(
EntityHandle end = start + count; start != end; ++start )
338 const unsigned char* ptr =
reinterpret_cast< const unsigned char*
>( data );
339 const EntityHandle*
const end = entities + num_entities;
340 unsigned char* array = NULL;
355 const char* data =
reinterpret_cast< const char*
>( values );
356 unsigned char* array = NULL;
362 while( start <= p->second )
366 const size_t count = std::min< size_t >( p->second - start + 1, avail );
367 memcpy( array, data,
get_size() * count );
380 void const*
const* pointers,
381 const int* data_lengths )
385 const EntityHandle*
const end = entities + num_entities;
386 unsigned char* array = NULL;
389 for(
const EntityHandle* i = entities; i != end; ++i, ++pointers )
393 memcpy( array, *pointers,
get_size() );
401 const Range& entities,
402 void const*
const* pointers,
405 unsigned char* array = NULL;
411 while( start <= p->second )
415 const EntityHandle end = std::min< EntityHandle >( p->second + 1, start + avail );
416 while( start != end )
418 memcpy( array, *pointers,
get_size() );
434 const void* value_ptr )
436 const EntityHandle*
const end = entities + num_entities;
437 unsigned char* array = NULL;
445 memcpy( array, value_ptr,
get_size() );
454 const Range& entities,
455 const void* value_ptr )
457 unsigned char* array = NULL;
463 while( start <= p->second )
467 const size_t count = std::min< size_t >( p->second - start + 1, avail );
481 const void* value_ptr,
486 return clear_data(
true, seqman, NULL, entities, num_entities, value_ptr );
491 const Range& entities,
492 const void* value_ptr,
497 return clear_data(
true, seqman, NULL, entities, value_ptr );
503 size_t num_entities )
505 std::vector< unsigned char > zeros;
513 return clear_data(
false, seqman, NULL, entities, num_entities, value );
518 std::vector< unsigned char > zeros;
526 return clear_data(
false, seqman, NULL, entities, value );
539 unsigned char* array = NULL;
544 size_t count = std::min< size_t >( avail, *( iter.
end_of_block() ) - *iter + 1 );
556 const Range* intersect_list )
const
559 Range* entities = intersect_list ? &tmp : &entities_in;
561 std::pair< EntityType, EntityType > range =
type_range( type );
563 for( EntityType t = range.first; t != range.second; ++t )
566 for( i = map.
begin(); i != map.
end(); ++i )
568 hint = entities->
insert( hint, ( *i )->start_handle(), ( *i )->end_handle() );
571 if( intersect_list ) entities_in =
intersect( *entities, *intersect_list );
577 size_t& output_count,
583 output_count += tmp.
size();
590 Range& output_entities,
594 const Range* intersect_entities )
const
596 if( value_bytes && value_bytes !=
get_size() )
599 "Cannot compare data of size " << value_bytes <<
" with tag of size " <<
get_size() );
602 if( !intersect_entities )
604 std::pair< EntityType, EntityType > range =
type_range( type );
606 for( EntityType t = range.first; t != range.second; ++t )
609 for( i = map.
begin(); i != map.
end(); ++i )
616 start += ( *i )->start_handle() - ( *i )->
data()->start_handle();
624 const unsigned char* array = NULL;
638 while( start <= p->second )
642 if( p->second - start < count - 1 ) count = p->second - start + 1;
660 const unsigned char* ptr = NULL;
666 unsigned long& total,
667 unsigned long& per_entity )
const
679 prev_data = ( *i )->data();
680 total +=
get_size() * ( *i )->data()->size();