Logo Search packages:      
Sourcecode: dc-qt version File versions  Download package

template<class T>
T rpc::ProtectedBuffer< T >::dequeue (  )  throw () [inline]

Remove the first item in the buffer and return it to the caller.

The first item in the buffer.

Definition at line 44 of file protectedbuffer.h.

Referenced by rpc::CommandDispatcher::waitForCommand().

            // Lock mutex
            boost::mutex::scoped_lock lock( m_mutex );
            // Check that the list is not empty
            if( m_queue.empty() ) {
                  // Throw an exception
                  throw std::out_of_range( "Queue is empty" );
            // Get the first item
            T item = m_queue.front();
            // Remove the first item
            return item;

Generated by  Doxygen 1.6.0   Back to index