~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/generator/session.h

  • Committer: Monty Taylor
  • Date: 2010-12-24 02:13:05 UTC
  • mto: This revision was merged to the branch mainline in revision 2038.
  • Revision ID: mordred@inaugust.com-20101224021305-e3slv1cyjczqorij
Changed the bzrignore file.

Show diffs side-by-side

added added

removed removed

Lines of Context:
22
22
#define DRIZZLED_GENERATOR_SESSION_H
23
23
 
24
24
#include <boost/thread/mutex.hpp>
25
 
 
26
 
#include <drizzled/identifier/user.h>
27
 
#include <drizzled/session/cache.h>
 
25
#include "drizzled/session/cache.h"
28
26
 
29
27
namespace drizzled {
30
28
namespace generator {
33
31
{
34
32
  session::Cache::list local_list;
35
33
  session::Cache::list::const_iterator iter;
36
 
  identifier::User::const_reference user;
37
34
 
38
35
public:
39
36
 
40
 
  Session(identifier::User::const_reference arg) :
41
 
    user(arg)
 
37
  Session()
42
38
  {
43
39
    boost::mutex::scoped_lock scopedLock(session::Cache::singleton().mutex());
44
40
    local_list= session::Cache::singleton().getCache();
49
45
  {
50
46
  }
51
47
 
52
 
  operator drizzled::Session::pointer()
 
48
  operator drizzled::Session::shared_ptr()
53
49
  {
54
50
    while (iter != local_list.end())
55
51
    {
56
 
      drizzled::Session::pointer ret= (*iter).get();
57
 
      iter++;
58
 
 
59
 
      if (not ret->isViewable(user))
 
52
      if (not (*iter)->isViewable())
60
53
      {
 
54
        iter++;
61
55
        continue;
62
56
      }
63
57
 
 
58
      drizzled::Session::shared_ptr ret(*iter);
 
59
      iter++;
64
60
      return ret;
65
61
    }
66
62
 
67
 
    return drizzled::Session::pointer();
 
63
    return drizzled::Session::shared_ptr();
68
64
  }
69
65
};
70
66