source: appstream-generator/build/girepo/gio/DatagramBasedT.d @ 4841

Last change on this file since 4841 was 4841, checked in by Juanma, 2 years ago

Initial release

File size: 2.9 KB
Line 
1/*
2 * Licensed under the GNU Lesser General Public License Version 3
3 *
4 * This library 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 3 of the license, or
7 * (at your option) any later version.
8 *
9 * This software 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.
13 *
14 * You should have received a copy of the GNU Lesser General Public License
15 * along with this library.  If not, see <http://www.gnu.org/licenses/>.
16 */
17
18// generated automatically - do not change
19
20
21module gio.DatagramBasedT;
22
23public  import gi.gio;
24public  import gi.giotypes;
25public  import gio.Cancellable;
26public  import glib.ErrorG;
27public  import glib.GException;
28public  import glib.Source;
29
30
31/**
32 * Interface for socket-like objects with datagram semantics.
33 *
34 * Since: 2.48
35 */
36public template DatagramBasedT(TStruct)
37{
38        /** Get the main Gtk struct */
39        public GDatagramBased* getDatagramBasedStruct()
40        {
41                return cast(GDatagramBased*)getStruct();
42        }
43
44
45        /** */
46        public GIOCondition conditionCheck(GIOCondition condition)
47        {
48                return g_datagram_based_condition_check(getDatagramBasedStruct(), condition);
49        }
50
51        /** */
52        public bool conditionWait(GIOCondition condition, long timeout, Cancellable cancellable)
53        {
54                GError* err = null;
55               
56                auto p = g_datagram_based_condition_wait(getDatagramBasedStruct(), condition, timeout, (cancellable is null) ? null : cancellable.getCancellableStruct(), &err) != 0;
57               
58                if (err !is null)
59                {
60                        throw new GException( new ErrorG(err) );
61                }
62               
63                return p;
64        }
65
66        /** */
67        public Source createSource(GIOCondition condition, Cancellable cancellable)
68        {
69                auto p = g_datagram_based_create_source(getDatagramBasedStruct(), condition, (cancellable is null) ? null : cancellable.getCancellableStruct());
70               
71                if(p is null)
72                {
73                        return null;
74                }
75               
76                return new Source(cast(GSource*) p, true);
77        }
78
79        /** */
80        public int receiveMessages(GInputMessage* messages, uint numMessages, int flags, long timeout, Cancellable cancellable)
81        {
82                GError* err = null;
83               
84                auto p = g_datagram_based_receive_messages(getDatagramBasedStruct(), messages, numMessages, flags, timeout, (cancellable is null) ? null : cancellable.getCancellableStruct(), &err);
85               
86                if (err !is null)
87                {
88                        throw new GException( new ErrorG(err) );
89                }
90               
91                return p;
92        }
93
94        /** */
95        public int sendMessages(GOutputMessage* messages, uint numMessages, int flags, long timeout, Cancellable cancellable)
96        {
97                GError* err = null;
98               
99                auto p = g_datagram_based_send_messages(getDatagramBasedStruct(), messages, numMessages, flags, timeout, (cancellable is null) ? null : cancellable.getCancellableStruct(), &err);
100               
101                if (err !is null)
102                {
103                        throw new GException( new ErrorG(err) );
104                }
105               
106                return p;
107        }
108}
Note: See TracBrowser for help on using the repository browser.