~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/user_locks/key.h

  • Committer: Andrew Hutchings
  • Date: 2010-12-06 19:36:53 UTC
  • mfrom: (1976 staging)
  • mto: This revision was merged to the branch mainline in revision 1991.
  • Revision ID: andrew@linuxjedi.co.uk-20101206193653-l85vryv18jb0yxx8
Merge with trunk

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>
24
25
#include <boost/unordered/unordered_set.hpp>
25
26
 
26
27
#include <string>
35
36
namespace user_locks {
36
37
 
37
38
class Key {
38
 
  drizzled::identifier::User context;
 
39
  drizzled::SecurityContext context;
39
40
  std::string lock_name;
40
41
  size_t hash_value;
41
42
 
42
43
public:
43
 
  Key(const drizzled::identifier::User &context_arg, const std::string &lock_name_arg) :
 
44
  Key(const drizzled::SecurityContext &context_arg, const std::string &lock_name_arg) :
44
45
    context(context_arg),
45
46
    lock_name(lock_name_arg)
46
47
  {
47
48
    drizzled::util::insensitive_hash hasher;
48
 
    hash_value= hasher(context.username() + lock_name_arg);
 
49
    hash_value= hasher(context.getUser() + lock_name_arg);
49
50
  }
50
51
 
51
52
  size_t getHashValue() const
60
61
 
61
62
  const std::string &getUser() const
62
63
  {
63
 
    return context.username();
 
64
    return context.getUser();
64
65
  }
 
66
 
65
67
};
66
68
 
67
69
bool operator==(Key const& left, Key const& right);