я по ссылке. Соответственно, исправлены все плагины хранилищ.
double freeMb,
const std::string & reason) const = 0;
- virtual int WriteDetailedStat(const map<IP_DIR_PAIR, STAT_NODE> * statTree,
+ virtual int WriteDetailedStat(const map<IP_DIR_PAIR, STAT_NODE> & statTree,
time_t lastStat,
const string & login) const = 0;
return 0;
}
//-----------------------------------------------------------------------------
-int FILES_STORE::WriteDetailedStat(const map<IP_DIR_PAIR, STAT_NODE> * statTree,
+int FILES_STORE::WriteDetailedStat(const map<IP_DIR_PAIR, STAT_NODE> & statTree,
time_t lastStat,
const string & login) const
{
}
map<IP_DIR_PAIR, STAT_NODE>::const_iterator stIter;
-stIter = statTree->begin();
+stIter = statTree.begin();
-while (stIter != statTree->end())
+while (stIter != statTree.end())
{
string u, d;
x2str(stIter->second.up, u);
double freeMb,
const std::string & reason) const;
- virtual int WriteDetailedStat(const map<IP_DIR_PAIR, STAT_NODE> * statTree,
+ virtual int WriteDetailedStat(const map<IP_DIR_PAIR, STAT_NODE> & statTree,
time_t lastStat,
const string & login) const;
double cash,
double freeMb,
const std::string & reason) const;
- int WriteDetailedStat(const std::map<IP_DIR_PAIR, STAT_NODE> * statTree,
+ int WriteDetailedStat(const std::map<IP_DIR_PAIR, STAT_NODE> & statTree,
time_t lastStat,
const std::string & login) const;
return 0;
}
//-----------------------------------------------------------------------------
-int FIREBIRD_STORE::WriteDetailedStat(const map<IP_DIR_PAIR, STAT_NODE> * statTree,
+int FIREBIRD_STORE::WriteDetailedStat(const map<IP_DIR_PAIR, STAT_NODE> & statTree,
time_t lastStat,
const string & login) const
{
{
tr->Start();
map<IP_DIR_PAIR, STAT_NODE>::const_iterator it;
- it = statTree->begin();
+ it = statTree.begin();
st->Prepare("insert into tb_detail_stats \
(till_time, from_time, fk_user, dir_num, \
ip, download, upload, cost) \
values (?, ?, (select pk_user from tb_users \
where name = ?), \
?, ?, ?, ?, ?)");
- while (it != statTree->end())
+ while (it != statTree.end())
{
st->Set(1, now);
st->Set(2, statTime);
return 0;
}
//-----------------------------------------------------------------------------
-int MYSQL_STORE::WriteDetailedStat(const map<IP_DIR_PAIR, STAT_NODE> * statTree,
+int MYSQL_STORE::WriteDetailedStat(const map<IP_DIR_PAIR, STAT_NODE> & statTree,
time_t lastStat,
const string & login) const
{
int retRes;
map<IP_DIR_PAIR, STAT_NODE>::const_iterator stIter;
-stIter = statTree->begin();
+stIter = statTree.begin();
-while (stIter != statTree->end())
+while (stIter != statTree.end())
{
strprintf(&tempStr,"IP='%s', dir=%d, down=%lld, up=%lld, cash=%f",
inet_ntostring(stIter->first.ip).c_str(),
double freeMb,
const std::string & reason) const;
- virtual int WriteDetailedStat(const map<IP_DIR_PAIR, STAT_NODE> * statTree,
+ virtual int WriteDetailedStat(const map<IP_DIR_PAIR, STAT_NODE> & statTree,
time_t lastStat,
const string & login) const;
double cash,
double freeMb,
const std::string & reason) const;
- int WriteDetailedStat(const std::map<IP_DIR_PAIR, STAT_NODE> * statTree,
+ int WriteDetailedStat(const std::map<IP_DIR_PAIR, STAT_NODE> & statTree,
time_t lastStat,
const std::string & login) const;
}
//-----------------------------------------------------------------------------
-int POSTGRESQL_STORE::WriteDetailedStat(const map<IP_DIR_PAIR, STAT_NODE> * statTree,
+int POSTGRESQL_STORE::WriteDetailedStat(const map<IP_DIR_PAIR, STAT_NODE> & statTree,
time_t lastStat,
const string & login) const
{
map<IP_DIR_PAIR, STAT_NODE>::const_iterator it;
time_t currTime = time(NULL);
-for (it = statTree->begin(); it != statTree->end(); ++it)
+for (it = statTree.begin(); it != statTree.end(); ++it)
{
std::stringstream query;
query << "INSERT INTO tb_detail_stats "