1 // Generated by gmmproc 2.64.2 -- DO NOT MODIFY!
2 
3 
4 #include <glibmm.h>
5 
6 #include <giomm/socketaddress.h>
7 #include <giomm/private/socketaddress_p.h>
8 
9 
10 /* Copyright (C) 2007 The giomm Development Team
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 #include <glibmm/error.h>
28 #include <giomm/asyncresult.h>
29 #include "slot_async.h"
30 
31 namespace Gio
32 {
33 } // namespace Gio
34 
35 namespace
36 {
37 } // anonymous namespace
38 
39 
40 namespace Glib
41 {
42 
wrap(GSocketAddress * object,bool take_copy)43 Glib::RefPtr<Gio::SocketAddress> wrap(GSocketAddress* object, bool take_copy)
44 {
45   return Glib::RefPtr<Gio::SocketAddress>( dynamic_cast<Gio::SocketAddress*> (Glib::wrap_auto ((GObject*)(object), take_copy)) );
46   //We use dynamic_cast<> in case of multiple inheritance.
47 }
48 
49 } /* namespace Glib */
50 
51 
52 namespace Gio
53 {
54 
55 
56 /* The *_Class implementation: */
57 
init()58 const Glib::Class& SocketAddress_Class::init()
59 {
60   if(!gtype_) // create the GType if necessary
61   {
62     // Glib::Class has to know the class init function to clone custom types.
63     class_init_func_ = &SocketAddress_Class::class_init_function;
64 
65     // This is actually just optimized away, apparently with no harm.
66     // Make sure that the parent type has been created.
67     //CppClassParent::CppObjectType::get_type();
68 
69     // Create the wrapper type, with the same class/instance size as the base type.
70     register_derived_type(g_socket_address_get_type());
71 
72     // Add derived versions of interfaces, if the C type implements any interfaces:
73   SocketConnectable::add_interface(get_type());
74 
75   }
76 
77   return *this;
78 }
79 
80 
class_init_function(void * g_class,void * class_data)81 void SocketAddress_Class::class_init_function(void* g_class, void* class_data)
82 {
83   const auto klass = static_cast<BaseClassType*>(g_class);
84   CppClassParent::class_init_function(klass, class_data);
85 
86 
87 }
88 
89 
wrap_new(GObject * object)90 Glib::ObjectBase* SocketAddress_Class::wrap_new(GObject* object)
91 {
92   return new SocketAddress((GSocketAddress*)object);
93 }
94 
95 
96 /* The implementation: */
97 
gobj_copy()98 GSocketAddress* SocketAddress::gobj_copy()
99 {
100   reference();
101   return gobj();
102 }
103 
SocketAddress(const Glib::ConstructParams & construct_params)104 SocketAddress::SocketAddress(const Glib::ConstructParams& construct_params)
105 :
106   Glib::Object(construct_params)
107 {
108 
109 }
110 
SocketAddress(GSocketAddress * castitem)111 SocketAddress::SocketAddress(GSocketAddress* castitem)
112 :
113   Glib::Object((GObject*)(castitem))
114 {}
115 
116 
SocketAddress(SocketAddress && src)117 SocketAddress::SocketAddress(SocketAddress&& src) noexcept
118 : Glib::Object(std::move(src))
119   , SocketConnectable(std::move(src))
120 {}
121 
operator =(SocketAddress && src)122 SocketAddress& SocketAddress::operator=(SocketAddress&& src) noexcept
123 {
124   Glib::Object::operator=(std::move(src));
125   SocketConnectable::operator=(std::move(src));
126   return *this;
127 }
128 
129 
~SocketAddress()130 SocketAddress::~SocketAddress() noexcept
131 {}
132 
133 
134 SocketAddress::CppClassType SocketAddress::socketaddress_class_; // initialize static member
135 
get_type()136 GType SocketAddress::get_type()
137 {
138   return socketaddress_class_.init().get_type();
139 }
140 
141 
get_base_type()142 GType SocketAddress::get_base_type()
143 {
144   return g_socket_address_get_type();
145 }
146 
147 
create(gpointer native,gsize len)148 Glib::RefPtr<SocketAddress> SocketAddress::create(gpointer native, gsize len)
149 {
150   return Glib::wrap(g_socket_address_new_from_native(native, len));
151 }
152 
get_family() const153 SocketFamily SocketAddress::get_family() const
154 {
155   return ((SocketFamily)(g_socket_address_get_family(const_cast<GSocketAddress*>(gobj()))));
156 }
157 
to_native(gpointer dest,gsize destlen)158 bool SocketAddress::to_native(gpointer dest, gsize destlen)
159 {
160   GError* gerror = nullptr;
161   bool retvalue = g_socket_address_to_native(gobj(), dest, destlen, &(gerror));
162   if(gerror)
163     ::Glib::Error::throw_exception(gerror);
164   return retvalue;
165 }
166 
get_native_size() const167 gssize SocketAddress::get_native_size() const
168 {
169   return g_socket_address_get_native_size(const_cast<GSocketAddress*>(gobj()));
170 }
171 
172 
property_family() const173 Glib::PropertyProxy_ReadOnly< Glib::RefPtr<SocketFamily> > SocketAddress::property_family() const
174 {
175   return Glib::PropertyProxy_ReadOnly< Glib::RefPtr<SocketFamily> >(this, "family");
176 }
177 
178 
179 } // namespace Gio
180 
181 
182