defuze.me  Client
locker.hpp
00001 /**************************************************************************
00002 ** defuze.me Epitech Innovative Project
00003 **
00004 ** Copyright 2010-2011
00005 **   Athena Calmettes - Jocelyn De La Rosa - Francois Gaillard
00006 **   Adrien Jarthon - Alexandre Moore - Luc Peres - Arnaud Sellier
00007 **
00008 ** All rights reserved.
00009 **************************************************************************/
00010 
00011 #ifndef LOCKER_HPP
00012 #define LOCKER_HPP
00013 
00014 #include <QString>
00015 #include <QHash>
00016 
00017 class Locker
00018 {
00019 public:
00020     Locker();
00021     ~Locker();
00022     void setLock(const QString &flag);
00023     void unLock(const QString &flag);
00024     bool isLocked(const QString &flag) const;
00025     void assertNotLocked(const QString &flag) const;
00026 
00027 private:
00028     QHash<const QString, unsigned short> flags;
00029 };
00030 
00031 #endif // LOCKER_HPP