21
21
#ifndef DRIZZLED_GENERATOR_SESSION_H
22
22
#define DRIZZLED_GENERATOR_SESSION_H
24
#include <boost/thread/mutex.hpp>
25
#include "drizzled/session/cache.h"
26
#include "drizzled/identifier/user.h"
24
#include "drizzled/pthread_globals.h"
25
#include "drizzled/session_list.h"
28
27
namespace drizzled {
29
28
namespace generator {
33
session::Cache::list local_list;
34
session::Cache::list::const_iterator iter;
35
identifier::User::const_reference user;
32
SessionList local_list;
33
SessionList::const_iterator iter;
39
Session(identifier::User::const_reference arg) :
42
boost::mutex::scoped_lock scopedLock(session::Cache::singleton().mutex());
43
local_list= session::Cache::singleton().getCache();
39
LOCK_thread_count.lock();
40
local_list= getSessionList();
44
41
iter= local_list.begin();
46
LOCK_thread_count.unlock();
51
operator drizzled::Session::pointer()
49
operator drizzled::SessionPtr()
53
51
while (iter != local_list.end())
55
drizzled::Session::pointer ret= (*iter).get();
58
if (not ret->isViewable(user))
53
if (not (*iter)->isViewable())
59
drizzled::SessionPtr ret= *iter;
66
return drizzled::Session::pointer();