Ejemplo n.º 1
0
 /**
 * @brief Just finds a session. Doesn't care about expiry time.
 *
 * @param lock A reference to a scoped lock. You must have one to call this func
 * @param cookie The cookie for the session we're looking for
 *
 * @return a pointer to the session if found, or 0
 */
 Session* findSession(ReadOnlyLock& /* prove you have a lock */, const string& cookie) {
     PSession pSession = sessions.find(cookie);
     if (pSession != sessions.end()) {
         return &((*pSession).second);
     }
     return 0;
 }
Ejemplo n.º 2
0
CKSessionClass* CKManager::FindSession(CK_SESSION_HANDLE hSession)
{
	SessionMap::iterator i = m_sessionMap.find(hSession);
	if (i == m_sessionMap.end())
		return NULL;

	return &i->second;
}
Ejemplo n.º 3
0
Session*
LaunchDaemon::FindSession(uid_t user) const
{
	SessionMap::const_iterator found = fSessions.find(user);
	if (found != fSessions.end())
		return found->second;

	return NULL;
}
Ejemplo n.º 4
0
	/*! Remove a T* from the manager; destroys the object
	  \param name session name
	  \return true if successful */
	bool remove(const f8String& name)
	{
		f8_scoped_lock guard(_mutex);
		auto itr(_sessionmap.find(name));
		if (itr == _sessionmap.end())
			return false;
		delete itr->second;
		_sessionmap.erase(itr);
		return true;
	}
Ejemplo n.º 5
0
	/*! Find a session by session name
	  \param name session name
	  \return T* or nullptr if not found */
	T *find(const f8String& name) const
	{
		f8_scoped_lock guard(_mutex);
		const auto itr(_sessionmap.find(name));
		return itr == _sessionmap.cend() ? nullptr : itr->second;
	}