1 //===-- Baton.h -------------------------------------------------*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
15 // Other libraries and framework includes
17 #include "lldb/lldb-public.h"
19 namespace lldb_private {
21 //----------------------------------------------------------------------
22 /// @class Baton Baton.h "lldb/Core/Baton.h"
23 /// @brief A class designed to wrap callback batons so they can cleanup
24 /// any acquired resources
26 /// This class is designed to be used by any objects that have a
27 /// callback function that takes a baton where the baton might need to
28 /// free/delete/close itself.
30 /// The default behavior is to not free anything. Subclasses can
31 /// free any needed resources in their destructors.
32 //----------------------------------------------------------------------
36 explicit Baton(void *p) :
44 // The default destructor for a baton does NOT attempt to clean up
45 // anything in m_baton
49 GetDescription (Stream *s, lldb::DescriptionLevel level) const;
51 void *m_data; // Leave baton public for easy access
54 //------------------------------------------------------------------
56 //------------------------------------------------------------------
57 DISALLOW_COPY_AND_ASSIGN (Baton);
60 } // namespace lldb_private
62 #endif // lldb_Baton_h_