Merge pull request #752 from jpnurmi/findclients

Replace CIRCNetwork::FindClient() with FindClients()
This commit is contained in:
Alexey Sokolov
2014-11-19 21:42:53 +00:00
2 changed files with 5 additions and 4 deletions

View File

@@ -76,7 +76,7 @@ public:
const CString& GetName() const;
bool IsNetworkAttached() const { return !m_vClients.empty(); }
const std::vector<CClient*>& GetClients() const { return m_vClients; }
CClient* FindClient(const CString& sIdentifier) const;
std::vector<CClient*> FindClients(const CString& sIdentifier) const;
void SetUser(CUser *pUser);
bool SetName(const CString& sName);

View File

@@ -669,14 +669,15 @@ const CString& CIRCNetwork::GetName() const {
return m_sName;
}
CClient* CIRCNetwork::FindClient(const CString& sIdentifier) const {
std::vector<CClient*> CIRCNetwork::FindClients(const CString& sIdentifier) const {
std::vector<CClient*> vClients;
for (CClient* pClient : m_vClients) {
if (pClient->GetIdentifier().Equals(sIdentifier)) {
return pClient;
vClients.push_back(pClient);
}
}
return NULL;
return vClients;
}
void CIRCNetwork::SetUser(CUser *pUser) {