/* */ #ifndef D_RPC_METHOD_H #define D_RPC_METHOD_H #include "common.h" #include #include "SharedHandle.h" #include "ValueBase.h" namespace aria2 { class DownloadEngine; class OptionParser; class Option; class Exception; namespace rpc { struct RpcRequest; struct RpcResponse; // This class offers abstract implementation of processing RPC // request. You have to inherit this class and implement process() // method to add new RPC API. // // There is RpcMethodFactory class which instantiates RpcMethod // subclass. If you add new RpcMethod subclass, don't forget to add it // to RpcMethodFactory. class RpcMethod { private: SharedHandle optionParser_; bool jsonRpc_; protected: // Subclass must implement this function to fulfil RpcRequest req. // The return value of this method is used as a return value of RPC // request. virtual SharedHandle process (const RpcRequest& req, DownloadEngine* e) = 0; void gatherRequestOption (const SharedHandle