/**
* @file llsdrpcserver.h
* @author Phoenix
* @date 2005-10-11
* @brief Declaration of the structured data remote procedure call server.
*
* Copyright (c) 2005-$CurrentYear$, Linden Research, Inc.
* $License$
*/
#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