/** 
 * @file llsdrpcserver.h
 * @author Phoenix
 * @date 2005-10-11
 * @brief Declaration of the structured data remote procedure call server.
 *
 * $LicenseInfo:firstyear=2005&license=viewergpl$
 * 
 * Copyright (c) 2005-2009, Linden Research, Inc.
 * 
 * Second Life Viewer Source Code
 * The source code in this file ("Source Code") is provided by Linden Lab
 * to you under the terms of the GNU General Public License, version 2.0
 * ("GPL"), unless you have obtained a separate licensing agreement
 * ("Other License"), formally executed by you and Linden Lab.  Terms of
 * the GPL can be found in doc/GPL-license.txt in this distribution, or
 * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
 * 
 * There are special exceptions to the terms and conditions of the GPL as
 * it is applied to this Source Code. View the full text of the exception
 * in the file doc/FLOSS-exception.txt in this software distribution, or
 * online at
 * http://secondlifegrid.net/programs/open_source/licensing/flossexception
 * 
 * By copying, modifying or distributing this software, you acknowledge
 * that you have read and understood your obligations described above,
 * and agree to abide by those obligations.
 * 
 * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
 * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
 * COMPLETENESS OR PERFORMANCE.
 * $/LicenseInfo$
 */
#ifndef LL_LLSDRPCSERVER_H
#define LL_LLSDRPCSERVER_H
/** 
 * I've set this up to be pretty easy to use when you want to make a
 * structured data rpc server which responds to methods by
 * name. Derive a class from the LLSDRPCServer, and during
 * construction (or initialization if you have the luxury) map method
 * names to pointers to member functions. This will look a lot like:
 *
 * 
 *  class LLMessageAgents : public LLSDRPCServer {
 *  public:
 *    typedef LLSDRPCServer mem_fn_t;
 *    LLMessageAgents() {
 *      mMethods["message"] = new mem_fn_t(this, &LLMessageAgents::rpc_IM);
 *      mMethods["alert"] = new mem_fn_t(this, &LLMessageAgents::rpc_Alrt);
 *    }
 *  protected:
 *    rpc_IM(const LLSD& params,
 *		const LLChannelDescriptors& channels,
 *		LLBufferArray* data)
 *		{...}
 *    rpc_Alert(const LLSD& params,
 *		const LLChannelDescriptors& channels,
 *		LLBufferArray* data)
 *		{...}
 *  };
 * 
 *
 * The params are an array where each element in the array is a single
 * parameter in the call.
 *
 * It is up to you to pack a valid serialized llsd response into the
 * data object passed into the method, but you can use the helper
 * methods below to help.
 */
#include