25 return long(it->
range().upper());
28 template<
class TYP>
static
35 TYP low = source->
range().lower();
36 TYP high = source->
range().upper();
38 long ndim = source->
ndim();
41 long dim[4], idxLen = 0;
42 long dim1 = 1, dim2 = 1;
44 for (
int i = 0;
i < ndim;
i++ )
45 dim[
i] = source->
dim(
i);
49 idxName = index->
name();
50 switch( index->
type() ) {
52 idxLen = upper<unsigned char>(index);
55 idxLen = upper<unsigned short>(index);
58 idxLen = upper<unsigned int>(index);
61 idxLen = upper<unsigned long>(index);
64 idxLen = upper<char>(index);
67 idxLen = upper<short>(index);
70 idxLen = upper<int>(index);
73 idxLen = upper<long>(index);
77 <<
" is not a valid index column!" <<
endmsg;
86 dim1 = (hasIdx) ? idxLen : dim[0];
97 dim1 = (hasIdx) ? idxLen : dim[0];
98 dim2 = (hasIdx) ? dim[0] : dim[1];
112 return tuple->
add(it);
190 if ( fun.length() > 0 ||
m_criteria.length() > 0 ) {
191 if (
m_criteria.length() > 0 && fun.length() == 0 ) fun =
"NTuple::Selector";
197 log <<
MSG::ERROR <<
"Failed to access service \""
225 for (i = items.
begin(); i != items.
end(); ++
i) {
226 long type = (*i)->type();
229 status =
createItem(log, tuple, *i, (
unsigned char)0);
232 status =
createItem(log, tuple, *i, (
unsigned short)0);
235 status =
createItem(log, tuple, *i, (
unsigned int)0);
238 status =
createItem(log, tuple, *i, (
unsigned long)0);
244 status =
createItem(log, tuple, *i,
short(0));
256 status =
createItem(log, tuple, *i,
float(0.0));
259 status =
createItem(log, tuple, *i,
double(0.0));
265 status =
createItem(log, tuple, *i, (
void*)0);
285 if ( 0 != clone && 0 != src ) {
292 for (i = clone_items.
begin(); i != clone_items.
end(); ++
i) {
297 log <<
"Tuple item " << nam <<
" not present in " << src_id <<
endmsg;
300 if ( itm->
type() != src_itm->
type() ) {
301 log <<
"Tuple item " << nam <<
" are of different types in "
302 << src_id <<
":" << src_itm->
typeName() <<
" <-> "
306 if ( itm->
ndim() != src_itm->
ndim() ) {
307 log <<
"Tuple item " << nam <<
" have different dimensions in "
308 << src_id <<
":" << src_itm->
ndim() <<
" <-> "
312 for (
int j=0; j<itm->
ndim(); ++j) {
313 if ( src_itm->
dim(j) != itm->
dim(j) ) {
314 log <<
"Tuple item " << nam <<
" have different dimensions in "
315 << src_id <<
"[" << j <<
"]:" << src_itm->
dim(j) <<
" <-> "
316 << clone_id <<
"[" << j <<
"]:" << itm->
dim(j) <<
endmsg;
321 log <<
"Tuple item " << nam <<
" has different index colums "
322 << src_id <<
":" << src_itm->
hasIndex() <<
" <-> "
328 log <<
"Tuple item " << nam <<
" has different index colums "
329 << src_id <<
":" << src_itm->
index() <<
" <-> "
349 size_t k = 0, nentry = 0;
352 for (k=0; k < source_items.
size(); ++k ) {
357 while ( status.isSuccess() ) {
359 if ( status.isSuccess() ) {
362 for (k=0,i = source_items.
begin(); i != source_items.
end(); ++
i,++k) {
366 switch((*i)->type()) {
368 size =
sizeof(
unsigned char);
371 size =
sizeof(
unsigned short);
374 size =
sizeof(
unsigned int);
377 size =
sizeof(
unsigned long);
383 size =
sizeof(short);
395 size =
sizeof(float);
398 size =
sizeof(double);
405 size = ::strlen((
const char*)src_itm->
buffer())+1;
409 *(
void**)out_itm->
buffer() = *(
void**)src_itm->
buffer();
431 if ( !status.isSuccess() ) {
432 log <<
MSG::ERROR <<
"Failed to write record " << nentry
437 log <<
MSG::INFO <<
"End of reading tuple " << input
438 <<
" after " << nentry <<
" entries." <<
endmsg;
470 nt->attachSelector(stmt);