1 | //===-- ScriptObject.h ------------------------------------ -*- C++ -*-===// |
2 | // |
3 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. |
4 | // See https://llvm.org/LICENSE.txt for license information. |
5 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception |
6 | // |
7 | //===----------------------------------------------------------------------===// |
8 | |
9 | #ifndef LLDB_INTERPRETER_SCRIPTOBJECT_H |
10 | #define LLDB_INTERPRETER_SCRIPTOBJECT_H |
11 | |
12 | #include "lldb/lldb-types.h" |
13 | |
14 | namespace lldb_private { |
15 | class ScriptObject { |
16 | public: |
17 | ScriptObject(lldb::ScriptObjectPtr ptr, lldb::ScriptLanguage lang) |
18 | : m_ptr(ptr), m_language(lang) {} |
19 | |
20 | operator bool() const { return m_ptr != nullptr; } |
21 | |
22 | const void *GetPointer() const { return m_ptr; } |
23 | |
24 | lldb::ScriptLanguage GetLanguage() const { return m_language; } |
25 | |
26 | private: |
27 | const void *m_ptr; |
28 | lldb::ScriptLanguage m_language; |
29 | }; |
30 | } // namespace lldb_private |
31 | |
32 | #endif // LLDB_INTERPRETER_SCRIPTOBJECT_H |
33 | |