AndroMeta  2.0.0
AndroMeta/include/AndroMeta/MVSemaphore.h
Go to the documentation of this file.
00001 /*
00002  * Copyright 2009-2012 AndroMeta LLC. All rights reserved.
00003  *
00004  * AndroMeta LLC retains all intellectual property and proprietary 
00005  * rights to this software and related documentation and any modifications 
00006  * thereto.  Any use, reproduction, disclosure, or distribution of this 
00007  * software and related documentation without an express license agreement 
00008  * from AndroMeta LLC is strictly prohibited.
00009  * 
00010  */
00011 
00018 #ifndef ANDROMETA_M_V_SEMAPHORE_H
00019 #define ANDROMETA_M_V_SEMAPHORE_H
00020 
00021 #include <cstddef>
00022 
00023 #include <AndroMeta/MTime.h>
00024 
00025 namespace Meta{
00026   
00035   class MVSemaphore{
00036   public:
00037     
00043     MVSemaphore(int count=1);
00044     
00053     MVSemaphore(int count, int maxCount);
00054     
00058     ~MVSemaphore();
00059     
00064     void acquire();
00065     
00072     bool acquire(const mtime& time);
00073     
00080     bool tryAcquire();
00081     
00087     void release();
00088     
00089   private:  
00090     MVSemaphore& operator=(const MVSemaphore&);
00091     MVSemaphore(const MVSemaphore&);
00092     
00093     class MVSemaphore_* x_;
00094   };
00095   
00096 } // end namespace Meta
00097 
00098 #endif // ANDROMETA_M_V_SEMAPHORE_H