26 return long(it->
range().upper());
29 template<
class TYP>
static
36 TYP low = source->
range().lower();
37 TYP high = source->
range().upper();
39 long ndim = source->
ndim();
42 long dim[4], idxLen = 0;
43 long dim1 = 1, dim2 = 1;
45 for (
int i = 0;
i < ndim;
i++ )
46 dim[
i] = source->
dim(
i);
50 idxName = index->
name();
51 switch( index->
type() ) {
53 idxLen = upper<unsigned char>(index);
56 idxLen = upper<unsigned short>(index);
59 idxLen = upper<unsigned int>(index);
62 idxLen = upper<unsigned long>(index);
65 idxLen = upper<char>(index);
68 idxLen = upper<short>(index);
71 idxLen = upper<int>(index);
74 idxLen = upper<long>(index);
78 <<
" is not a valid index column!" <<
endmsg;
87 dim1 = (hasIdx) ? idxLen : dim[0];
98 dim1 = (hasIdx) ? idxLen : dim[0];
99 dim2 = (hasIdx) ? dim[0] : dim[1];
113 return tuple->
add(it);
191 if ( fun.length() > 0 ||
m_criteria.length() > 0 ) {
192 if (
m_criteria.length() > 0 && fun.length() == 0 ) fun =
"NTuple::Selector";
198 log <<
MSG::ERROR <<
"Failed to access service \""
226 for (i = items.
begin(); i != items.
end(); ++
i) {
227 long type = (*i)->type();
230 status =
createItem(log, tuple, *i, (
unsigned char)0);
233 status =
createItem(log, tuple, *i, (
unsigned short)0);
236 status =
createItem(log, tuple, *i, (
unsigned int)0);
239 status =
createItem(log, tuple, *i, (
unsigned long)0);
245 status =
createItem(log, tuple, *i,
short(0));
257 status =
createItem(log, tuple, *i,
float(0.0));
260 status =
createItem(log, tuple, *i,
double(0.0));
266 status =
createItem(log, tuple, *i, (
void*)0);
286 if ( 0 != clone && 0 != src ) {
293 for (i = clone_items.
begin(); i != clone_items.
end(); ++
i) {
298 log <<
"Tuple item " << nam <<
" not present in " << src_id <<
endmsg;
301 if ( itm->
type() != src_itm->
type() ) {
302 log <<
"Tuple item " << nam <<
" are of different types in "
303 << src_id <<
":" << src_itm->
typeName() <<
" <-> "
307 if ( itm->
ndim() != src_itm->
ndim() ) {
308 log <<
"Tuple item " << nam <<
" have different dimensions in "
309 << src_id <<
":" << src_itm->
ndim() <<
" <-> "
313 for (
int j=0; j<itm->
ndim(); ++j) {
314 if ( src_itm->
dim(j) != itm->
dim(j) ) {
315 log <<
"Tuple item " << nam <<
" have different dimensions in "
316 << src_id <<
"[" << j <<
"]:" << src_itm->
dim(j) <<
" <-> "
317 << clone_id <<
"[" << j <<
"]:" << itm->
dim(j) <<
endmsg;
322 log <<
"Tuple item " << nam <<
" has different index colums "
323 << src_id <<
":" << src_itm->
hasIndex() <<
" <-> "
329 log <<
"Tuple item " << nam <<
" has different index colums "
330 << src_id <<
":" << src_itm->
index() <<
" <-> "
350 size_t k = 0, nentry = 0;
353 for (k=0; k < source_items.
size(); ++k ) {
358 while ( status.isSuccess() ) {
360 if ( status.isSuccess() ) {
363 for (k=0,i = source_items.
begin(); i != source_items.
end(); ++
i,++k) {
367 switch((*i)->type()) {
369 size =
sizeof(
unsigned char);
372 size =
sizeof(
unsigned short);
375 size =
sizeof(
unsigned int);
378 size =
sizeof(
unsigned long);
384 size =
sizeof(short);
396 size =
sizeof(float);
399 size =
sizeof(double);
406 size = ::strlen((
const char*)src_itm->
buffer())+1;
410 *(
void**)out_itm->
buffer() = *(
void**)src_itm->
buffer();
432 if ( !status.isSuccess() ) {
433 log <<
MSG::ERROR <<
"Failed to write record " << nentry
438 log <<
MSG::INFO <<
"End of reading tuple " << input
439 <<
" after " << nentry <<
" entries." <<
endmsg;
471 nt->attachSelector(stmt);