Patch level : 10.0 no patch

Files correlati     :
Ricompilazione Demo : [ ]
Commento            :

Aggiunto costruttore di copia ai TGeneric_distrib
MIgliorato il supporto delle tabelle di modulo per le file caches


git-svn-id: svn://10.65.10.50/trunk@19751 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
alex 2009-12-10 23:31:48 +00:00
parent ab0ef19bd3
commit 423a463502
4 changed files with 26 additions and 8 deletions

View File

@ -1728,6 +1728,17 @@ void TGeneric_distrib::init (
}
}
void TGeneric_distrib::copy(const TGeneric_distrib & d)
{
_tot = d._tot;
_totslices = d._totslices;
_ready = d._ready;
_slices = d._slices;
_current = d._current;
_decs = d._decs;
}
///////////////////////////////////////////////////////////
// Importo
///////////////////////////////////////////////////////////

View File

@ -429,11 +429,15 @@ public:
{ _decs = decs;}
// @cmember Inizializza l'oggetto
void init(const real& r, bool zap = FALSE);
void init(const real& r, bool zap = false);
// @cmember Copia di un TGeneric_distrib
void copy(const TGeneric_distrib & d);
// @cmember Assegnamento di un TGeneric_distrib
TGeneric_distrib & operator = (const TGeneric_distrib & d) { copy(d); return *this; }
// @cmember Assegnamento di un importo
void operator =(const real& r)
{ init(r); }
void operator =(const real& r) { init(r); }
// @cmember Ritorna l'ultima percentuale aggiunta
const real& last_slice() const
{
@ -442,7 +446,9 @@ public:
}
// @cmember Costruttore
TGeneric_distrib(const real& r,int round=0) : _tot(r), _totslices(0.0), _ready(FALSE), _slices(4), _current(0),_decs(round)
TGeneric_distrib(const TGeneric_distrib & d) { copy(d); }
// @cmember Costruttore
TGeneric_distrib(const real& r = ZERO, int round = 0) : _tot(r), _totslices(0.0), _ready(FALSE), _slices(4), _current(0),_decs(round)
{}
// @cmember Distruttore
virtual ~TGeneric_distrib()

View File

@ -537,7 +537,7 @@ void TFile_cache::init_file(TLocalisamfile* f)
int logicnum = atoi(_filecode);
if (logicnum == 0)
{
if (_filecode == '&')
if (_filecode[0] == '&' || _filecode.len() >= 5)
_file = new TModule_table(_filecode);
else
_file = new TTable(_filecode);
@ -623,7 +623,8 @@ const TObject& TFile_cache::query(const char* code)
test_firm();
TObject* obj = _cache.objptr(_code);
if (obj == NULL)
if (obj == NULL)
{
TLocalisamfile& f = file();
TRectype& curr = f.curr();
@ -641,7 +642,7 @@ const TObject& TFile_cache::query(const char* code)
else
curr.zero(rf.Name);
}
f.setkey(_key);
f.setkey(_key);
_error = f.read();
} else
_error = _iskeyerr;

View File

@ -153,7 +153,7 @@ class TFile_cache : public TObject
static unsigned long _hits, _misses;
TToken_string _code;
TString4 _filecode; // Codice tabella es: %STA, &AUT
TString8 _filecode; // Codice tabella es: %STA, &AUT, LVCAU
TLocalisamfile* _file;
int _key;
long _last_firm, _limit;