// Generated by gmmproc 2.54.1 -- DO NOT MODIFY!


#include <glibmm.h>

#include <giomm/inetaddress.h>
#include <giomm/private/inetaddress_p.h>


/* Copyright (C) 2008 Jonathon Jongsma
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library.  If not, see <http://www.gnu.org/licenses/>.
 */

#include <gio/gio.h>

namespace Gio
{

Glib::RefPtr<InetAddress>
InetAddress::create(const Glib::ustring& string)
{
  return Glib::wrap(g_inet_address_new_from_string(string.c_str()));
}

Glib::RefPtr<InetAddress>
InetAddress::create_any(SocketFamily family)
{
  return Glib::wrap(g_inet_address_new_any((GSocketFamily)family));
}

Glib::RefPtr<InetAddress>
InetAddress::create_loopback(SocketFamily family)
{
  return Glib::wrap(g_inet_address_new_loopback((GSocketFamily)family));
}

} // namespace Gio

namespace
{
} // anonymous namespace


namespace Glib
{

Glib::RefPtr<Gio::InetAddress> wrap(GInetAddress* object, bool take_copy)
{
  return Glib::RefPtr<Gio::InetAddress>( dynamic_cast<Gio::InetAddress*> (Glib::wrap_auto ((GObject*)(object), take_copy)) );
  //We use dynamic_cast<> in case of multiple inheritance.
}

} /* namespace Glib */


namespace Gio
{


/* The *_Class implementation: */

const Glib::Class& InetAddress_Class::init()
{
  if(!gtype_) // create the GType if necessary
  {
    // Glib::Class has to know the class init function to clone custom types.
    class_init_func_ = &InetAddress_Class::class_init_function;

    // This is actually just optimized away, apparently with no harm.
    // Make sure that the parent type has been created.
    //CppClassParent::CppObjectType::get_type();

    // Create the wrapper type, with the same class/instance size as the base type.
    register_derived_type(g_inet_address_get_type());

    // Add derived versions of interfaces, if the C type implements any interfaces:

  }

  return *this;
}


void InetAddress_Class::class_init_function(void* g_class, void* class_data)
{
  const auto klass = static_cast<BaseClassType*>(g_class);
  CppClassParent::class_init_function(klass, class_data);


}


Glib::ObjectBase* InetAddress_Class::wrap_new(GObject* object)
{
  return new InetAddress((GInetAddress*)object);
}


/* The implementation: */

GInetAddress* InetAddress::gobj_copy()
{
  reference();
  return gobj();
}

InetAddress::InetAddress(const Glib::ConstructParams& construct_params)
:
  Glib::Object(construct_params)
{

}

InetAddress::InetAddress(GInetAddress* castitem)
:
  Glib::Object((GObject*)(castitem))
{}


InetAddress::InetAddress(InetAddress&& src) noexcept
: Glib::Object(std::move(src))
{}

InetAddress& InetAddress::operator=(InetAddress&& src) noexcept
{
  Glib::Object::operator=(std::move(src));
  return *this;
}


InetAddress::~InetAddress() noexcept
{}


InetAddress::CppClassType InetAddress::inetaddress_class_; // initialize static member

GType InetAddress::get_type()
{
  return inetaddress_class_.init().get_type();
}


GType InetAddress::get_base_type()
{
  return g_inet_address_get_type();
}


InetAddress::InetAddress(const guint8 * bytes, SocketFamily family)
:
  // Mark this class as non-derived to allow C++ vfuncs to be skipped.
  Glib::ObjectBase(nullptr),
  Glib::Object(Glib::ConstructParams(inetaddress_class_.init(), "bytes", bytes, "family", ((GSocketFamily)(family)), nullptr))
{
  

}

Glib::RefPtr<InetAddress> InetAddress::create(const guint8 * bytes, SocketFamily family)
{
  return Glib::RefPtr<InetAddress>( new InetAddress(bytes, family) );
}

bool InetAddress::address_equal(const Glib::RefPtr<const InetAddress>& other_address) const
{
  return g_inet_address_equal(const_cast<GInetAddress*>(gobj()), const_cast<GInetAddress*>(Glib::unwrap(other_address)));
}

const guint8* InetAddress::to_bytes() const
{
  return g_inet_address_to_bytes(const_cast<GInetAddress*>(gobj()));
}

Glib::ustring InetAddress::to_string() const
{
  return Glib::convert_return_gchar_ptr_to_ustring(g_inet_address_to_string(const_cast<GInetAddress*>(gobj())));
}

SocketFamily InetAddress::get_family() const
{
  return ((SocketFamily)(g_inet_address_get_family(const_cast<GInetAddress*>(gobj()))));
}

bool InetAddress::get_is_any() const
{
  return g_inet_address_get_is_any(const_cast<GInetAddress*>(gobj()));
}

bool InetAddress::get_is_link_local() const
{
  return g_inet_address_get_is_link_local(const_cast<GInetAddress*>(gobj()));
}

bool InetAddress::get_is_loopback() const
{
  return g_inet_address_get_is_loopback(const_cast<GInetAddress*>(gobj()));
}

bool InetAddress::get_is_mc_global() const
{
  return g_inet_address_get_is_mc_global(const_cast<GInetAddress*>(gobj()));
}

bool InetAddress::get_is_mc_link_local() const
{
  return g_inet_address_get_is_mc_link_local(const_cast<GInetAddress*>(gobj()));
}

bool InetAddress::get_is_mc_node_local() const
{
  return g_inet_address_get_is_mc_node_local(const_cast<GInetAddress*>(gobj()));
}

bool InetAddress::get_is_mc_org_local() const
{
  return g_inet_address_get_is_mc_org_local(const_cast<GInetAddress*>(gobj()));
}

bool InetAddress::get_is_mc_site_local() const
{
  return g_inet_address_get_is_mc_site_local(const_cast<GInetAddress*>(gobj()));
}

bool InetAddress::get_is_multicast() const
{
  return g_inet_address_get_is_multicast(const_cast<GInetAddress*>(gobj()));
}

bool InetAddress::get_is_site_local() const
{
  return g_inet_address_get_is_site_local(const_cast<GInetAddress*>(gobj()));
}

gsize InetAddress::get_native_size() const
{
  return g_inet_address_get_native_size(const_cast<GInetAddress*>(gobj()));
}


Glib::PropertyProxy_ReadOnly< void* > InetAddress::property_bytes() const
{
  return Glib::PropertyProxy_ReadOnly< void* >(this, "bytes");
}

Glib::PropertyProxy_ReadOnly< SocketFamily > InetAddress::property_family() const
{
  return Glib::PropertyProxy_ReadOnly< SocketFamily >(this, "family");
}

Glib::PropertyProxy_ReadOnly< bool > InetAddress::property_is_any() const
{
  return Glib::PropertyProxy_ReadOnly< bool >(this, "is-any");
}

Glib::PropertyProxy_ReadOnly< bool > InetAddress::property_is_link_local() const
{
  return Glib::PropertyProxy_ReadOnly< bool >(this, "is-link-local");
}

Glib::PropertyProxy_ReadOnly< bool > InetAddress::property_is_loopback() const
{
  return Glib::PropertyProxy_ReadOnly< bool >(this, "is-loopback");
}

Glib::PropertyProxy_ReadOnly< bool > InetAddress::property_is_mc_global() const
{
  return Glib::PropertyProxy_ReadOnly< bool >(this, "is-mc-global");
}

Glib::PropertyProxy_ReadOnly< bool > InetAddress::property_is_mc_link_local() const
{
  return Glib::PropertyProxy_ReadOnly< bool >(this, "is-mc-link-local");
}

Glib::PropertyProxy_ReadOnly< bool > InetAddress::property_is_mc_node_local() const
{
  return Glib::PropertyProxy_ReadOnly< bool >(this, "is-mc-node-local");
}

Glib::PropertyProxy_ReadOnly< bool > InetAddress::property_is_mc_org_local() const
{
  return Glib::PropertyProxy_ReadOnly< bool >(this, "is-mc-org-local");
}

Glib::PropertyProxy_ReadOnly< bool > InetAddress::property_is_mc_site_local() const
{
  return Glib::PropertyProxy_ReadOnly< bool >(this, "is-mc-site-local");
}

Glib::PropertyProxy_ReadOnly< bool > InetAddress::property_is_multicast() const
{
  return Glib::PropertyProxy_ReadOnly< bool >(this, "is-multicast");
}

Glib::PropertyProxy_ReadOnly< bool > InetAddress::property_is_site_local() const
{
  return Glib::PropertyProxy_ReadOnly< bool >(this, "is-site-local");
}


} // namespace Gio


