alternative to assert
[gtkD.git] / src / glib / TrashStack.d
blob9fa20ff6d92349a7eb2f982f86a1a4afa83e9410
1 /*
2 * This file is part of duit.
4 * duit is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License as published by
6 * the Free Software Foundation; either version 2.1 of the License, or
7 * (at your option) any later version.
9 * duit is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public License
15 * along with duit; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 // generated automatically - do not change
20 // find conversion definition on APILookup.txt
21 // implement new conversion functionalities on the wrap.utils pakage
24 * Conversion parameters:
25 * inFile = glib-Trash-Stacks.html
26 * outPack = glib
27 * outFile = TrashStack
28 * strct = GTrashStack
29 * realStrct=
30 * ctorStrct=
31 * clss = TrashStack
32 * interf =
33 * class Code: No
34 * interface Code: No
35 * template for:
36 * extend =
37 * implements:
38 * prefixes:
39 * - g_trash_stack_
40 * omit structs:
41 * omit prefixes:
42 * omit code:
43 * imports:
44 * structWrap:
45 * local aliases:
48 module glib.TrashStack;
50 private import glib.glibtypes;
52 private import lib.glib;
55 /**
56 * Description
57 * A GTrashStack is an efficient way to keep a stack of unused allocated
58 * memory chunks. Each memory chunk is required to be large enough to hold
59 * a gpointer. This allows the stack to be maintained without any space
60 * overhead, since the stack pointers can be stored inside the memory chunks.
61 * There is no function to create a GTrashStack. A NULL GTrashStack*
62 * is a perfectly valid empty stack.
64 public class TrashStack
67 /** the main Gtk struct */
68 protected GTrashStack* gTrashStack;
71 public GTrashStack* getTrashStackStruct()
73 return gTrashStack;
77 /** the main Gtk struct as a void* */
78 protected void* getStruct()
80 return cast(void*)gTrashStack;
83 /**
84 * Sets our main struct and passes it to the parent class
86 public this (GTrashStack* gTrashStack)
88 this.gTrashStack = gTrashStack;
91 /**
95 /**
96 * Pushes a piece of memory onto a GTrashStack.
97 * stack_p:
98 * a pointer to a GTrashStack.
99 * data_p:
100 * the piece of memory to push on the stack.
102 public static void push(GTrashStack** stackP, void* dataP)
104 // void g_trash_stack_push (GTrashStack **stack_p, gpointer data_p);
105 g_trash_stack_push(stackP, dataP);
109 * Pops a piece of memory off a GTrashStack.
110 * stack_p:
111 * a pointer to a GTrashStack.
112 * Returns:
113 * the element at the top of the stack.
115 public static void* pop(GTrashStack** stackP)
117 // gpointer g_trash_stack_pop (GTrashStack **stack_p);
118 return g_trash_stack_pop(stackP);
122 * Returns the element at the top of a GTrashStack which may be NULL.
123 * stack_p:
124 * a pointer to a GTrashStack.
125 * Returns:
126 * the element at the top of the stack.
128 public static void* peek(GTrashStack** stackP)
130 // gpointer g_trash_stack_peek (GTrashStack **stack_p);
131 return g_trash_stack_peek(stackP);
135 * Returns the height of a GTrashStack.
136 * Note that execution of this function is of O(N) complexity
137 * where N denotes the number of items on the stack.
138 * stack_p:
139 * a pointer to a GTrashStack.
140 * Returns:
141 * the height of the stack.
143 public static uint height(GTrashStack** stackP)
145 // guint g_trash_stack_height (GTrashStack **stack_p);
146 return g_trash_stack_height(stackP);