1 // Generated by gmmproc 2.64.2 -- DO NOT MODIFY!
2
3
4 #include <glibmm.h>
5
6 #include <giomm/inetaddress.h>
7 #include <giomm/private/inetaddress_p.h>
8
9
10 /* Copyright (C) 2008 Jonathon Jongsma
11 *
12 * This library is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU Lesser General Public
14 * License as published by the Free Software Foundation; either
15 * version 2.1 of the License, or (at your option) any later version.
16 *
17 * This library is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20 * Lesser General Public License for more details.
21 *
22 * You should have received a copy of the GNU Lesser General Public
23 * License along with this library. If not, see <http://www.gnu.org/licenses/>.
24 */
25
26 #include <gio/gio.h>
27
28 namespace Gio
29 {
30
31 Glib::RefPtr<InetAddress>
create(const Glib::ustring & string)32 InetAddress::create(const Glib::ustring& string)
33 {
34 return Glib::wrap(g_inet_address_new_from_string(string.c_str()));
35 }
36
37 Glib::RefPtr<InetAddress>
create_any(SocketFamily family)38 InetAddress::create_any(SocketFamily family)
39 {
40 return Glib::wrap(g_inet_address_new_any((GSocketFamily)family));
41 }
42
43 Glib::RefPtr<InetAddress>
create_loopback(SocketFamily family)44 InetAddress::create_loopback(SocketFamily family)
45 {
46 return Glib::wrap(g_inet_address_new_loopback((GSocketFamily)family));
47 }
48
49 } // namespace Gio
50
51 namespace
52 {
53 } // anonymous namespace
54
55
56 namespace Glib
57 {
58
wrap(GInetAddress * object,bool take_copy)59 Glib::RefPtr<Gio::InetAddress> wrap(GInetAddress* object, bool take_copy)
60 {
61 return Glib::RefPtr<Gio::InetAddress>( dynamic_cast<Gio::InetAddress*> (Glib::wrap_auto ((GObject*)(object), take_copy)) );
62 //We use dynamic_cast<> in case of multiple inheritance.
63 }
64
65 } /* namespace Glib */
66
67
68 namespace Gio
69 {
70
71
72 /* The *_Class implementation: */
73
init()74 const Glib::Class& InetAddress_Class::init()
75 {
76 if(!gtype_) // create the GType if necessary
77 {
78 // Glib::Class has to know the class init function to clone custom types.
79 class_init_func_ = &InetAddress_Class::class_init_function;
80
81 // This is actually just optimized away, apparently with no harm.
82 // Make sure that the parent type has been created.
83 //CppClassParent::CppObjectType::get_type();
84
85 // Create the wrapper type, with the same class/instance size as the base type.
86 register_derived_type(g_inet_address_get_type());
87
88 // Add derived versions of interfaces, if the C type implements any interfaces:
89
90 }
91
92 return *this;
93 }
94
95
class_init_function(void * g_class,void * class_data)96 void InetAddress_Class::class_init_function(void* g_class, void* class_data)
97 {
98 const auto klass = static_cast<BaseClassType*>(g_class);
99 CppClassParent::class_init_function(klass, class_data);
100
101
102 }
103
104
wrap_new(GObject * object)105 Glib::ObjectBase* InetAddress_Class::wrap_new(GObject* object)
106 {
107 return new InetAddress((GInetAddress*)object);
108 }
109
110
111 /* The implementation: */
112
gobj_copy()113 GInetAddress* InetAddress::gobj_copy()
114 {
115 reference();
116 return gobj();
117 }
118
InetAddress(const Glib::ConstructParams & construct_params)119 InetAddress::InetAddress(const Glib::ConstructParams& construct_params)
120 :
121 Glib::Object(construct_params)
122 {
123
124 }
125
InetAddress(GInetAddress * castitem)126 InetAddress::InetAddress(GInetAddress* castitem)
127 :
128 Glib::Object((GObject*)(castitem))
129 {}
130
131
InetAddress(InetAddress && src)132 InetAddress::InetAddress(InetAddress&& src) noexcept
133 : Glib::Object(std::move(src))
134 {}
135
operator =(InetAddress && src)136 InetAddress& InetAddress::operator=(InetAddress&& src) noexcept
137 {
138 Glib::Object::operator=(std::move(src));
139 return *this;
140 }
141
142
~InetAddress()143 InetAddress::~InetAddress() noexcept
144 {}
145
146
147 InetAddress::CppClassType InetAddress::inetaddress_class_; // initialize static member
148
get_type()149 GType InetAddress::get_type()
150 {
151 return inetaddress_class_.init().get_type();
152 }
153
154
get_base_type()155 GType InetAddress::get_base_type()
156 {
157 return g_inet_address_get_type();
158 }
159
160
InetAddress(const guint8 * bytes,SocketFamily family)161 InetAddress::InetAddress(const guint8 * bytes, SocketFamily family)
162 :
163 // Mark this class as non-derived to allow C++ vfuncs to be skipped.
164 Glib::ObjectBase(nullptr),
165 Glib::Object(Glib::ConstructParams(inetaddress_class_.init(), "bytes", bytes, "family", ((GSocketFamily)(family)), nullptr))
166 {
167
168
169 }
170
create(const guint8 * bytes,SocketFamily family)171 Glib::RefPtr<InetAddress> InetAddress::create(const guint8 * bytes, SocketFamily family)
172 {
173 return Glib::RefPtr<InetAddress>( new InetAddress(bytes, family) );
174 }
175
address_equal(const Glib::RefPtr<const InetAddress> & other_address) const176 bool InetAddress::address_equal(const Glib::RefPtr<const InetAddress>& other_address) const
177 {
178 return g_inet_address_equal(const_cast<GInetAddress*>(gobj()), const_cast<GInetAddress*>(Glib::unwrap(other_address)));
179 }
180
to_bytes() const181 const guint8* InetAddress::to_bytes() const
182 {
183 return g_inet_address_to_bytes(const_cast<GInetAddress*>(gobj()));
184 }
185
to_string() const186 Glib::ustring InetAddress::to_string() const
187 {
188 return Glib::convert_return_gchar_ptr_to_ustring(g_inet_address_to_string(const_cast<GInetAddress*>(gobj())));
189 }
190
get_family() const191 SocketFamily InetAddress::get_family() const
192 {
193 return ((SocketFamily)(g_inet_address_get_family(const_cast<GInetAddress*>(gobj()))));
194 }
195
get_is_any() const196 bool InetAddress::get_is_any() const
197 {
198 return g_inet_address_get_is_any(const_cast<GInetAddress*>(gobj()));
199 }
200
get_is_link_local() const201 bool InetAddress::get_is_link_local() const
202 {
203 return g_inet_address_get_is_link_local(const_cast<GInetAddress*>(gobj()));
204 }
205
get_is_loopback() const206 bool InetAddress::get_is_loopback() const
207 {
208 return g_inet_address_get_is_loopback(const_cast<GInetAddress*>(gobj()));
209 }
210
get_is_mc_global() const211 bool InetAddress::get_is_mc_global() const
212 {
213 return g_inet_address_get_is_mc_global(const_cast<GInetAddress*>(gobj()));
214 }
215
get_is_mc_link_local() const216 bool InetAddress::get_is_mc_link_local() const
217 {
218 return g_inet_address_get_is_mc_link_local(const_cast<GInetAddress*>(gobj()));
219 }
220
get_is_mc_node_local() const221 bool InetAddress::get_is_mc_node_local() const
222 {
223 return g_inet_address_get_is_mc_node_local(const_cast<GInetAddress*>(gobj()));
224 }
225
get_is_mc_org_local() const226 bool InetAddress::get_is_mc_org_local() const
227 {
228 return g_inet_address_get_is_mc_org_local(const_cast<GInetAddress*>(gobj()));
229 }
230
get_is_mc_site_local() const231 bool InetAddress::get_is_mc_site_local() const
232 {
233 return g_inet_address_get_is_mc_site_local(const_cast<GInetAddress*>(gobj()));
234 }
235
get_is_multicast() const236 bool InetAddress::get_is_multicast() const
237 {
238 return g_inet_address_get_is_multicast(const_cast<GInetAddress*>(gobj()));
239 }
240
get_is_site_local() const241 bool InetAddress::get_is_site_local() const
242 {
243 return g_inet_address_get_is_site_local(const_cast<GInetAddress*>(gobj()));
244 }
245
get_native_size() const246 gsize InetAddress::get_native_size() const
247 {
248 return g_inet_address_get_native_size(const_cast<GInetAddress*>(gobj()));
249 }
250
251
property_bytes() const252 Glib::PropertyProxy_ReadOnly< void* > InetAddress::property_bytes() const
253 {
254 return Glib::PropertyProxy_ReadOnly< void* >(this, "bytes");
255 }
256
property_family() const257 Glib::PropertyProxy_ReadOnly< SocketFamily > InetAddress::property_family() const
258 {
259 return Glib::PropertyProxy_ReadOnly< SocketFamily >(this, "family");
260 }
261
property_is_any() const262 Glib::PropertyProxy_ReadOnly< bool > InetAddress::property_is_any() const
263 {
264 return Glib::PropertyProxy_ReadOnly< bool >(this, "is-any");
265 }
266
property_is_link_local() const267 Glib::PropertyProxy_ReadOnly< bool > InetAddress::property_is_link_local() const
268 {
269 return Glib::PropertyProxy_ReadOnly< bool >(this, "is-link-local");
270 }
271
property_is_loopback() const272 Glib::PropertyProxy_ReadOnly< bool > InetAddress::property_is_loopback() const
273 {
274 return Glib::PropertyProxy_ReadOnly< bool >(this, "is-loopback");
275 }
276
property_is_mc_global() const277 Glib::PropertyProxy_ReadOnly< bool > InetAddress::property_is_mc_global() const
278 {
279 return Glib::PropertyProxy_ReadOnly< bool >(this, "is-mc-global");
280 }
281
property_is_mc_link_local() const282 Glib::PropertyProxy_ReadOnly< bool > InetAddress::property_is_mc_link_local() const
283 {
284 return Glib::PropertyProxy_ReadOnly< bool >(this, "is-mc-link-local");
285 }
286
property_is_mc_node_local() const287 Glib::PropertyProxy_ReadOnly< bool > InetAddress::property_is_mc_node_local() const
288 {
289 return Glib::PropertyProxy_ReadOnly< bool >(this, "is-mc-node-local");
290 }
291
property_is_mc_org_local() const292 Glib::PropertyProxy_ReadOnly< bool > InetAddress::property_is_mc_org_local() const
293 {
294 return Glib::PropertyProxy_ReadOnly< bool >(this, "is-mc-org-local");
295 }
296
property_is_mc_site_local() const297 Glib::PropertyProxy_ReadOnly< bool > InetAddress::property_is_mc_site_local() const
298 {
299 return Glib::PropertyProxy_ReadOnly< bool >(this, "is-mc-site-local");
300 }
301
property_is_multicast() const302 Glib::PropertyProxy_ReadOnly< bool > InetAddress::property_is_multicast() const
303 {
304 return Glib::PropertyProxy_ReadOnly< bool >(this, "is-multicast");
305 }
306
property_is_site_local() const307 Glib::PropertyProxy_ReadOnly< bool > InetAddress::property_is_site_local() const
308 {
309 return Glib::PropertyProxy_ReadOnly< bool >(this, "is-site-local");
310 }
311
312
313 } // namespace Gio
314
315
316