// Generated by gtkmmproc -- DO NOT MODIFY!


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

// -*- Mode: C++; indent-tabs-mode: nil; c-basic-offset: 2 -*-

/* 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, write to the Free
 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 */

#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)
{
  BaseClassType *const 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::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(0),
  Glib::Object(Glib::ConstructParams(inetaddress_class_.init(), "bytes", bytes, "family", ((GSocketFamily)(family)), static_cast<char*>(0)))
{
  

}

Glib::RefPtr<InetAddress> InetAddress::create(const guint8 * bytes, SocketFamily family)
{
  return Glib::RefPtr<InetAddress>( new InetAddress(bytes, family) );
}
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()));
}


} // namespace Gio


