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


#include <glibmm.h>

#include <libgdamm/numeric.h>
#include <libgdamm/private/numeric_p.h>


/* Copyright 2011 libgdamm Development Team
 *
 * 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 <libgdamm/batch.h>
#include <libgda/gda-batch.h>


namespace Gnome
{

namespace Gda
{

} /* namespace Gda */

} /* namespace Gnome */

namespace
{
} // anonymous namespace


namespace Glib
{

Gnome::Gda::Numeric wrap(GdaNumeric* object, bool take_copy)
{
  return Gnome::Gda::Numeric(object, take_copy);
}

} // namespace Glib


namespace Gnome
{

namespace Gda
{


// static
GType Numeric::get_type()
{
  return gda_numeric_get_type();
}

Numeric::Numeric()
:
  gobject_ (gda_numeric_new())
{}

Numeric::Numeric(const Numeric& other)
:
  gobject_ ((other.gobject_) ? gda_numeric_copy(other.gobject_) : 0)
{}

Numeric::Numeric(GdaNumeric* gobject, bool make_a_copy)
:
  // For BoxedType wrappers, make_a_copy is true by default.  The static
  // BoxedType wrappers must always take a copy, thus make_a_copy = true
  // ensures identical behaviour if the default argument is used.
  gobject_ ((make_a_copy && gobject) ? gda_numeric_copy(gobject) : gobject)
{}

Numeric& Numeric::operator=(const Numeric& other)
{
  Numeric temp (other);
  swap(temp);
  return *this;
}

Numeric::~Numeric()
{
  if(gobject_)
    gda_numeric_free(gobject_);
}

void Numeric::swap(Numeric& other)
{
  GdaNumeric *const temp = gobject_;
  gobject_ = other.gobject_;
  other.gobject_ = temp;
}

GdaNumeric* Numeric::gobj_copy() const
{
  return gda_numeric_copy(gobject_);
}


void Numeric::set_from_string(const Glib::ustring& str)
{
  gda_numeric_set_from_string(gobj(), str.c_str());
}

void Numeric::set_double(double number)
{
  gda_numeric_set_double(gobj(), number);
}

double Numeric::get_double() const
{
  return gda_numeric_get_double(const_cast<GdaNumeric*>(gobj()));
}

void Numeric::set_precision(long precision)
{
  gda_numeric_set_precision(gobj(), precision);
}

long Numeric::get_precision() const
{
  return gda_numeric_get_precision(const_cast<GdaNumeric*>(gobj()));
}

void Numeric::set_width(long width)
{
  gda_numeric_set_width(gobj(), width);
}

long Numeric::get_width()
{
  return gda_numeric_get_width(gobj());
}

Glib::ustring Numeric::get_string() const
{
  return Glib::convert_return_gchar_ptr_to_ustring(gda_numeric_get_string(const_cast<GdaNumeric*>(gobj())));
}


} // namespace Gda

} // namespace Gnome


