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