// -*- C++ -*- //

/* dataaccesswrapper.h
 *
 * Copyright 2006 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.
 */

_DEFS(libgdamm,libgda)
_PINCLUDE(glibmm/private/object_p.h)

#include <libgdamm/datamodel.h>

namespace Gnome
{

namespace Gda
{

/** Offers random access on top of a cursor-only access data model.
 *
 * The Gda::DataAccessWrapper object simply wraps around another Gda::DataModel data model 
 * object and allows data to be accessed in a random way while remaining memory efficient as much as possible.
 *
 * @ingroup DataModels
 */
class DataAccessWrapper
 : public Glib::Object,
   public DataModel
{
  _CLASS_GOBJECT(DataAccessWrapper, GdaDataAccessWrapper, GDA_DATA_ACCESS_WRAPPER, Glib::Object, GObject)
  _IMPLEMENTS_INTERFACE(DataModel)
protected:
  _WRAP_CTOR(DataAccessWrapper(const Glib::RefPtr<DataModel>& model), gda_data_access_wrapper_new)

public:
  _WRAP_CREATE(const Glib::RefPtr<DataModel>& model)
  
  _WRAP_PROPERTY("model", Glib::RefPtr<DataModel>)
};

} // namespace Gda
} // namespace Gnome

