~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/user_locks/key.h

  • Committer: Brian Aker
  • Date: 2011-02-22 06:12:02 UTC
  • mfrom: (2190.1.6 drizzle-build)
  • Revision ID: brian@tangent.org-20110222061202-k03czxykqy4x9hjs
List update, header fixes, multiple symbols, and David deletes some code.

Show diffs side-by-side

added added

removed removed

Lines of Context:
21
21
#include <boost/thread/mutex.hpp>
22
22
#include <boost/thread/condition_variable.hpp>
23
23
#include <boost/unordered_map.hpp>
24
 
#include <boost/logic/tribool.hpp>
25
24
#include <boost/unordered/unordered_set.hpp>
26
25
 
27
26
#include <string>
28
27
 
29
 
#include "drizzled/session.h"
30
 
#include "drizzled/util/string.h"
 
28
#include <drizzled/session.h>
 
29
#include <drizzled/util/string.h>
31
30
 
32
31
 
33
32
#ifndef PLUGIN_USER_LOCKS_KEY_H
36
35
namespace user_locks {
37
36
 
38
37
class Key {
39
 
  drizzled::SecurityContext context;
 
38
  drizzled::identifier::User context;
40
39
  std::string lock_name;
41
40
  size_t hash_value;
42
41
 
43
42
public:
44
 
  Key(const drizzled::SecurityContext &context_arg, const std::string &lock_name_arg) :
 
43
  Key(const drizzled::identifier::User &context_arg, const std::string &lock_name_arg) :
45
44
    context(context_arg),
46
45
    lock_name(lock_name_arg)
47
46
  {
48
47
    drizzled::util::insensitive_hash hasher;
49
 
    hash_value= hasher(context.getUser() + lock_name_arg);
 
48
    hash_value= hasher(context.username() + lock_name_arg);
50
49
  }
51
50
 
52
51
  size_t getHashValue() const
61
60
 
62
61
  const std::string &getUser() const
63
62
  {
64
 
    return context.getUser();
 
63
    return context.username();
65
64
  }
66
 
 
67
65
};
68
66
 
69
67
bool operator==(Key const& left, Key const& right);