/***************************************************************************
                Process Dummy Class
                -----------------------------------------
    begin      : 2015/05/28
	copyright  : (C) 2005 Solbox Inc.
    author     : Dev 1 Team
    email      : storage.sd@solbox.com
    version    : 3.5.0

    CopyRight(C) 2005 Solbox Inc. All Rights reserved.
    Redistribution and use in source and binary forms, with or with out
    modification, are not permitted in outside of Solbox Inc.
*****************************************************************************/

#ifndef __CACHE_REQUEST_LIST_H__
#define __CACHE_REQUEST_LIST_H__

#include <queue>
#include <string.h>
#include <pthread.h>
#include "Logger.h"
#include "FimngdData.h"
#include "TransferStatData.h"

struct replication_info 
{
	std::string szFileName_hash;
	uint32_t nServiceID;
	int szFDCount;
};

class  CCacheRequestList
{
public:
	CCacheRequestList();
	virtual ~CCacheRequestList();

	///@brief replication_info 큐에 데이터를 삽입하는 함수.
	///@param logData [in] replication_info 레퍼런스.
	///@return none
	void Push( std::string szFileName_hash, uint32_t nServiceID, int szFDCount);

	///@brief replication_info 큐에서 데이터를 얻는 함수.
	///       반환된 데이터는 큐에서 삭제된다. 
	///@param none.
	///@return replication_info 객체
	struct replication_info Pop();

	///@brief replication_info 큐의 크기를 얻는 함수.
	///@param none.
	///@return replication_info 큐의 크기를 반환.
	unsigned int GetSize();

	///@brief 큐의 모든 데이터를 삭제하는 함수.
	///@param none.
	///@param none.
	void Clear();
private:
	std::queue<struct replication_info> m_ReplicationInfoQueue;

	pthread_mutex_t m_mutex;
};
 
#endif //__CACHE_REQUEST_LIST_H__
