~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/user_locks/lock_storage.h

  • Committer: Brian Aker
  • Date: 2010-10-13 02:49:48 UTC
  • mto: This revision was merged to the branch mainline in revision 1853.
  • Revision ID: brian@tangent.org-20101013024948-xwel5qe6z7j21w73
Cleans up namespace for locks (now per user).

Show diffs side-by-side

added added

removed removed

Lines of Context:
32
32
*/
33
33
 
34
34
class Storable : public drizzled::util::Storable {
35
 
  typedef boost::unordered_set<std::string> LockList;
36
 
  LockList list_of_locks;
 
35
  Keys list_of_locks;
37
36
  drizzled::session_id_t id;
38
37
 
39
38
public:
48
47
    erase_all();
49
48
  }
50
49
 
51
 
  void insert(const std::string &arg)
 
50
  void insert(const Key &arg)
52
51
  {
53
52
    list_of_locks.insert(arg);
54
53
  }
55
54
 
56
 
  bool erase(const std::string &arg)
 
55
  bool erase(const Key &arg)
57
56
  {
58
57
    return boost::lexical_cast<bool>(list_of_locks.erase(arg));
59
58
  }
64
63
  {
65
64
    int64_t count= list_of_locks.size();
66
65
 
67
 
    for (LockList::iterator iter= list_of_locks.begin();
 
66
    for (Keys::iterator iter= list_of_locks.begin();
68
67
         iter != list_of_locks.end(); iter++)
69
68
    {
70
69
      (void)user_locks::Locks::getInstance().release(*iter, id);