Vault
4.1
|
00001 /* 00002 Copyright c1997-2014 Trygve Isaacson. All rights reserved. 00003 This file is part of the Code Vault version 4.1 00004 http://www.bombaydigital.com/ 00005 License: MIT. See LICENSE.md in the Vault top level directory. 00006 */ 00007 00008 #include "vserver.h" 00009 00010 #include "vmutexlocker.h" 00011 00012 VServer::VServer() 00013 : mSessions() 00014 , mSessionsMutex("VServer::mSessionsMutex") 00015 { 00016 } 00017 00018 void VServer::addClientSession(VClientSessionPtr session) { 00019 VMutexLocker locker(&mSessionsMutex, "VServer::addClientSession()"); 00020 mSessions.push_back(session); 00021 } 00022 00023 void VServer::removeClientSession(VClientSessionPtr session) { 00024 VMutexLocker locker(&mSessionsMutex, "VServer::removeClientSession()"); 00025 for (VClientSessionList::iterator i = mSessions.begin(); i != mSessions.end(); i++) { 00026 if ((*i) == session) { 00027 (void) mSessions.erase(i); 00028 break; 00029 } 00030 } 00031 }