From 13108c8c4a65877e41ff1fdedca1224027756983 Mon Sep 17 00:00:00 2001 From: matteo Date: Wed, 22 Nov 1995 13:55:07 +0000 Subject: [PATCH] Corretto errore sui record array e aggiunti TContainer git-svn-id: svn://10.65.10.50/trunk@2197 c028cbd2-c16b-5b4b-a496-9718f37d4682 --- include/relation.cpp | 4 ++-- include/relation.h | 12 ++++++++---- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/include/relation.cpp b/include/relation.cpp index 412dea521..d173eec5e 100755 --- a/include/relation.cpp +++ b/include/relation.cpp @@ -1,4 +1,4 @@ -// $Id: relation.cpp,v 1.69 1995-11-13 12:08:51 guy Exp $ +// $Id: relation.cpp,v 1.70 1995-11-22 13:55:00 matteo Exp $ // relation.cpp // fv 12/8/93 // relation class for isam files @@ -1757,7 +1757,7 @@ int TRecord_array::read(TRectype* filter) for (int e = err; e == NOERR && good(*rec); e = rec->next(f)) { add_row(rec); - rec = (TRectype*)filter->dup(); + rec = (TRectype*)(key().dup()); } delete rec; } diff --git a/include/relation.h b/include/relation.h index c3dc5211c..4d6b4681a 100755 --- a/include/relation.h +++ b/include/relation.h @@ -1,4 +1,4 @@ -/* $Id: relation.h,v 1.29 1995-11-13 12:08:55 guy Exp $ */ +/* $Id: relation.h,v 1.30 1995-11-22 13:55:07 matteo Exp $ */ // join.h // fv 12/8/93 // join class for isam files @@ -185,7 +185,7 @@ class TExpression; typedef bool (*FILTERFUNCTION)(const TRelation* r); -class TCursor : public TObject +class TCursor : public TContainer { TRelation* _if; int _nkey; @@ -222,8 +222,12 @@ public: TRecnotype operator =(const TRecnotype nr); // Va alla posizione nr TRecnotype operator +=(const TRecnotype nr); TRecnotype operator -=(const TRecnotype npos) { return operator +=(-npos); } - TRecnotype operator ++() { return operator +=(1); } - TRecnotype operator --() { return operator -=(1); } + TObject* first_item( ){ operator =( 0 ); return &curr( ); } + TObject* succ_item( ){ operator +=( 1 ); return &curr( ); } + TObject* pred_item( ){ operator -=( 1 ); return &curr( );} + TObject* last_item( ){ operator =( items( ) -1 ); return &curr( ); } + long objects( ) { return items( ); } + TRecnotype& pos() { return _pos; } TRecnotype items(); TRecnotype size() const { return file().eod(); }