/* libzzinet
 *
 * This program is distributed under the GNU General Public License, version 2.
 * A copy of this license is included with this source.
 *
 * Copyright 2004-2006, Toni Thomsson <toni@tonjac.org> 
*/

/**
    Base for all data services

    Toni Thomsson, toni@tonjac.org
*/

#ifndef zz_data_service_h
#define zz_data_service_h

#include <zz_string.h>
#include <zz_parameter_map.h>
#include <zz_log.h>
#include <map>
#include <vector>
#include "zz_data_service_reply.h"

class ZZ_API CzzDataService
{
public:

    virtual ~CzzDataService();
    virtual CzzDataServiceReply* execute( void* session, CzzParameterMap* req ) = 0;

    /**
        Should return the size in bytes of the type. Used by Mini's dynamic C++ classloader.
        Implement as:
        return sizeof(CYourServiceClass);
    */
    virtual int size() = 0;

protected:
    
    CzzDataService( const CzzString& name );

    CzzString urlEncode( const CzzString& url );
    CzzLog m_Log;
    CzzString m_Name;
};

#endif // zz_data_service_h