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


#include <glibmm.h>

#include <gstreamermm/mapinfo.h>
#include <gstreamermm/private/mapinfo_p.h>


/*
 * mapinfo.ccg
 *
 *  Created on: Jul 31, 2013
 *      Author: m.kolny
 */
#include <gstreamermm/handle_error.h>


namespace Gst
{
MapInfo::MapInfo()
: m_spec(g_try_new(GstMapInfo, 1)),
  take_ownership(true)
{
  if(!m_spec)
  {
    gstreamermm_handle_error(
      "Failed to allocate a new Gst::MapInfo.");
    return;
  }
}

MapInfo::MapInfo(GstMapInfo& castitem, bool take_ownership)
: m_spec(&castitem),
  take_ownership(take_ownership)
{
}

MapInfo::MapInfo(const MapInfo& other)
: sigc::trackable(),
  Glib::ObjectBase(),
  Glib::Object(),
  m_spec(g_try_new(GstMapInfo, 1)),
  take_ownership(true)
{
  // Handle possible memory allocation failure.
  if(!m_spec)
  {
    gstreamermm_handle_error("Failed to allocate a new Gst::MapInfo.");
    return;
  }

  m_spec->memory = other.m_spec->memory;
  m_spec->data = other.m_spec->data;
  m_spec->flags = other.m_spec->flags;
  m_spec->maxsize = other.m_spec->maxsize;
  m_spec->size = other.m_spec->size;

}


MapInfo::~MapInfo()
{
  if(take_ownership)
    g_free(m_spec);
}
}


namespace
{
} // anonymous namespace

// static
GType Glib::Value<Gst::MapFlags>::value_type()
{
  return gst_map_flags_get_type();
}


namespace Gst
{


 MapFlags MapInfo::get_flags() const
{
  return ((MapFlags)(gobj()->flags));
}
 
 guint8* MapInfo::get_data() const
{
  return gobj()->data;
}
 
 gsize MapInfo::get_maxsize() const
{
  return gobj()->maxsize;
}
 
 gsize MapInfo::get_size() const
{
  return gobj()->size;
}
 

} // namespace Gst


