1 //===-- InputReaderStack.h --------------------------------------*- C++ -*-===// 2 // 3 // The LLVM Compiler Infrastructure 4 // 5 // This file is distributed under the University of Illinois Open Source 6 // License. See LICENSE.TXT for details. 7 // 8 //===----------------------------------------------------------------------===// 9 10 #ifndef liblldb_InputReaderStack_h_ 11 #define liblldb_InputReaderStack_h_ 12 13 #include <stack> 14 15 #include "lldb/lldb-private.h" 16 #include "lldb/Host/Mutex.h" 17 18 namespace lldb_private { 19 20 class InputReaderStack 21 { 22 public: 23 24 InputReaderStack (); 25 26 ~InputReaderStack (); 27 28 size_t 29 GetSize () const; 30 31 void 32 Push (const lldb::InputReaderSP& reader_sp); 33 34 bool 35 IsEmpty () const; 36 37 lldb::InputReaderSP 38 Top (); 39 40 void 41 Pop (); 42 43 Mutex & 44 GetStackMutex (); 45 46 protected: 47 48 std::stack<lldb::InputReaderSP> m_input_readers; 49 mutable Mutex m_input_readers_mutex; 50 51 private: 52 53 DISALLOW_COPY_AND_ASSIGN (InputReaderStack); 54 }; 55 56 } // namespace lldb_private 57 58 #endif // liblldb_InputReaderStack_h_ 59