MAK RTIspy API Documentation for HLA Evolved
vlThreadSafeQueue.h
Go to the documentation of this file.
00001 /*******************************************************************************
00002 ** Copyright (c) 2005 MaK Technologies, Inc.
00003 ** All rights reserved.
00004 *******************************************************************************/
00005 /*******************************************************************************
00006 ** $RCSfile: vlThreadSafeQueue.h,v $ $Revision: 1.3 $ $State: Exp $
00007 *******************************************************************************/
00008 
00011 
00012 #ifndef DtThreadSafeQueue_H_
00013 #define DtThreadSafeQueue_H_
00014 
00015 #include <vlutil/vlMutex.h>
00016 #include <deque>
00017 
00018 
00027 template < class T >
00028 class DtThreadSafeQueue
00029 {
00030 public:
00031 
00033    DtThreadSafeQueue();
00034 
00036    virtual ~DtThreadSafeQueue();
00037 
00039    virtual inline void push_back( std::auto_ptr<T> elem );
00040 
00042    virtual inline void push_front( std::auto_ptr<T> elem );
00043 
00046    virtual inline std::auto_ptr<T> pop();
00047 
00048    virtual inline size_t size() const;
00049 
00050 protected:
00051 
00053 
00054    std::deque< T* > myQueue;
00055    
00057    mutable MAKRti::DtMutex myLock;
00058    
00059 };
00060 
00062 #define DtThreadSafeQueue_Inl_
00063 #include "vlThreadSafeQueue.inl"
00064 #undef DtThreadSafeQueue_Inl_
00065    
00066 #endif //! MAKRti::DtThreadSafeQueue_H_

Document ID: Generated on Thu Jun 14 14:15:04 EDT 2012 from SVN revision 116116
Copyright © 2005-2012 VT MÄK Inc. All Rights Reserved (www.mak.com)