Patch level : 10.0
Files correlati : authoriz Ricompilazione Demo : [ ] Commento : Migliorato conteggio utenti git-svn-id: svn://10.65.10.50/branches/R_10_00@22431 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
fe4305e41c
commit
195956147e
@ -40,7 +40,7 @@ public:
|
||||
bool Kill(TUserInfo* ui);
|
||||
void KillSession(wxSocketBase& sock, int session);
|
||||
|
||||
size_t GetCount() const { return size(); }
|
||||
size_t GetCount() const;
|
||||
size_t GetLicenses() const;
|
||||
|
||||
TUserTable();
|
||||
@ -48,13 +48,24 @@ public:
|
||||
|
||||
WX_DECLARE_HASH_SET( wxString, wxStringHash, wxStringEqual, THostSet );
|
||||
|
||||
size_t TUserTable::GetCount() const
|
||||
{
|
||||
size_t n = 0;
|
||||
for (TUsersHashMap::const_iterator it = begin(); it != end(); ++it)
|
||||
{
|
||||
const TUserInfo* ui = it->second;
|
||||
n += (ui && ui->m_nPrograms > 0) ? 1 : 0;
|
||||
}
|
||||
return n;
|
||||
}
|
||||
|
||||
size_t TUserTable::GetLicenses() const
|
||||
{
|
||||
THostSet hsHosts;
|
||||
for( TUsersHashMap::const_iterator it = begin(); it != end(); ++it )
|
||||
for (TUsersHashMap::const_iterator it = begin(); it != end(); ++it)
|
||||
{
|
||||
TUserInfo* ui = it->second;
|
||||
if (ui != NULL)
|
||||
if (ui && ui->m_nPrograms > 0)
|
||||
hsHosts.insert(ui->m_strHost);
|
||||
}
|
||||
return hsHosts.size();
|
||||
|
Loading…
x
Reference in New Issue
Block a user