~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/generator/session.h

Namespace the parser just a bit, and update our call for the type of parser
we want.

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