/* 
 * © 2008 MySQL AB, 2008-2009 Sun Microsystems, Inc.
 *
 * 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 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., 59 Temple Place - Suite 330,
 * Boston, MA 02111-1307, USA.
 */
#ifndef __CHANGE_FACTORY_H
#define __CHANGE_FACTORY_H

#include <string>
#include "grtpp.h"

namespace grt
{
class DiffChange;
class ValueRef;
class DictRef;
class BaseListRef;
//class ObjectRef;
struct ChangeSet;


struct ChangeFactory 
{
static DiffChange *create_value_added_change(DiffChange *parent, const ValueRef &source, const ValueRef &target);
static DiffChange *create_value_removed_change(DiffChange *parent, const ValueRef &source, const ValueRef &target);

static DiffChange *create_object_attr_modified_change(DiffChange *parent, const ObjectRef &source, const ObjectRef &target, const std::string &attr, DiffChange *change);
static DiffChange *create_object_modified_change(DiffChange *parent, const ObjectRef &source, const ObjectRef &target, ChangeSet &changes);

static DiffChange *create_dict_change(DiffChange *parent, const DictRef &source, const DictRef &target, ChangeSet &changes);

static DiffChange *create_dict_item_added_change(DiffChange *parent, const DictRef &source, const DictRef &target, const std::string &key, ValueRef v);
static DiffChange *create_dict_item_modified_change(DiffChange *parent, const DictRef &source, const DictRef &target, const std::string &key, DiffChange *change);
static DiffChange *create_dict_item_removed_change(DiffChange *parent, const DictRef &source, const DictRef &target, const std::string &key);

static DiffChange *create_simple_value_change(DiffChange *parent, const ValueRef &source, const ValueRef &target);
};


}

#endif
