1 .. Copyright (C) 2014-2016 Free Software Foundation, Inc.
2 Originally contributed by David Malcolm <dmalcolm@redhat.com>
4 This is free software: you can redistribute it and/or modify it
5 under the terms of the GNU General Public License as published by
6 the Free Software Foundation, either version 3 of the License, or
7 (at your option) any later version.
9 This program is distributed in the hope that it will be useful, but
10 WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 General Public License for more details.
14 You should have received a copy of the GNU General Public License
15 along with this program. If not, see
16 <http://www.gnu.org/licenses/>.
18 .. default-domain:: cpp
23 .. class:: gccjit::object
25 Almost every entity in the API (with the exception of
26 :class:`gccjit::context` and :c:type:`gcc_jit_result *`) is a
27 "contextual" object, a :class:`gccjit::object`.
31 * is associated with a :class:`gccjit::context`.
33 * is automatically cleaned up for you when its context is released so
34 you don't need to manually track and cleanup all objects, just the
37 The C++ class hierarchy within the ``gccjit`` namespace looks like this::
51 The :class:`gccjit::object` base class has the following operations:
53 .. function:: gccjit::context gccjit::object::get_context () const
55 Which context is the obj within?
57 .. function:: std::string gccjit::object::get_debug_string () const
59 Generate a human-readable description for the given object.
65 printf ("obj: %s\n", obj.get_debug_string ().c_str ());
67 might give this text on stdout: