/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil -*- */
/*
 * Copyright (c) 2012 University of California, Los Angeles
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 as
 * published by the Free Software Foundation;
 *
 * This program 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 General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 *
 * Author: Zhenkai Zhu <zhenkai@cs.ucla.edu>
 *         卞超轶 Chaoyi Bian <bcy@pku.edu.cn>
 *	   Alexander Afanasyev <alexander.afanasyev@ucla.edu>
 */

#ifndef SYNC_APP_WRAPPER_H
#define SYNC_APP_WRAPPER_H
#include <boost/shared_ptr.hpp>
#include <boost/function.hpp>
#include "sync-ccnx-wrapper.h"
#include "sync-interest-table.h"
#include "sync-diff-state.h"
#include "sync-full-state.h"
#include "sync-app.h"

namespace Sync {

/**
 * \ingroup sync
 * @brief A wrapper for SyncApp, which handles ccnx related things (process
 * interests and data)
 */
class SyncAppWrapper
{
public:
	/**
	 * @brief constructor for this class;
	 * @param syncPrefix the name prefix to use for the Sync Interest
	 * @param fetch the fetch function, which will be called to actually fetch
	 * the app data when new remote names are learned
	 */
	SyncAppWrapper(std::string syncPrefix, boost::function<void (std::string,
	uint32_t, uint32_t)> fetch, boost::shared_ptr<CcnxWrapper> ccnxHandle);

	~SyncAppWrapper();
	/**
	 * a wrapper for the same func in SyncApp
	 */
	void addLocalNames(std::string prefix, uint32_t seq);

	/**
	 * @brief respond to the Sync Interest; a lot of logic needs to go in here
	 * @param interest the Sync Interest in string format
	 */
	void respondSyncInterest(std::string interest);

	/**
	 * @brief process the fetched sync data
	 * @param dataBuffer the sync data
	 */
	void processSyncData(std::string dataBuffer);

private:
	void sendSyncInterest();

private:
	boost::shared_ptr<CcnxWrapper> m_ccnxHandle;
	//boost::shared_ptr<SyncApp> m_syncApp;
	boost::function<void (std::string, uint32_t, uint32_t)> m_fetch;
	SyncInterestTable m_syncInterestTable;
	std::string m_syncPrefix;
};


} // Sync

#endif // SYNC_APP_WRAPPER_H
