campo-sirio/ef/ef0101.h
paola 4a5b550d9b modificato l'oggetto effetto per l'utilizzo nell'oggetto distinta
git-svn-id: svn://10.65.10.50/trunk@3898 c028cbd2-c16b-5b4b-a496-9718f37d4682
1996-11-14 17:36:49 +00:00

75 lines
2.6 KiB
C++
Executable File

#ifndef __RELATION_H
#include <relation.h>
#endif
class TEffetto:public TRectype
{
TRecord_array _righe,_cess;
protected:
// ritorna la prossima chiave
long get_next_key(const long codcf) const;
int read(TLocalisamfile& f, const TRectype& rec);
public:
// rinumera le chiavi
long renum(long numeff = 0);
// ritorna la testata dell'effetto
const TRectype& head() const
{ return *this; }
// ritorna la testata dell'effetto
TRectype& head()
{ return *this; }
TRecord_array& righe() {return _righe;}
TRecord_array& cess() {return _cess;}
// ritorna la riga i_esima dei cessionari
TRectype& row_c(int i, bool create=FALSE)
{ return _cess.row(i,create); }
// ritorna la riga i delle righe
TRectype& row_r(int i, bool create=FALSE)
{ return _righe.row(i,create); }
// ritorna il numero delle righe presenti nelle righe effetto
int rows_r() const
{ return _righe.rows(); }
// ritorna il numero delle righe presenti nei cessionari
int rows_c() const
{ return _cess.rows(); }
// elimina l'elemento riga nella posizione n nelle righe effetto
bool destroy_row_r(int n, bool pack = FALSE)
{ return _righe.destroy_row(n, pack); }
// elimina tutti gli elementi riga nelle righe effetto
void destroy_rows_r()
{ _righe.destroy_rows(); }
// elimina l'elemento riga nella posizione n nei cessionari
bool destroy_row_c(int n, bool pack = FALSE)
{ return _cess.destroy_row(n, pack); }
// elimina tutti gli elementi riga nei cessionari
void destroy_rows_c()
{ _cess.destroy_rows(); }
int read(const TRectype& rec);
int read(char tipodist, long ndist, long nrigadist);
int write(bool force=FALSE);
int rewrite()
{ return write(TRUE); }
int remove()const;
long numero() const
{ return get_long("NPROGTR"); }
long codicec() const
{ return get_long("CODCF"); }
TDate datasc() const
{ return get_date("DATASCAD"); }
char tipodist() const
{ return get_char("TIPODIST"); }
long ndist() const
{ return get_long("NDIST"); }
long nrgdist() const
{ return get_long("NRIGADIST"); }
//setta i campi per la quarta chiave del file
void put_key(TRectype& rec,char tipodist, long ndist, long nrigadist = 0);
//setta i campi per la prima chiave del file
void put_key(TRectype& rec,long numeff) const;
TEffetto();
TEffetto(TRectype& rec);
virtual ~TEffetto() {}
};