* Added 'argument.?' commands that passing of arguments to commands

created with 'system.method.insert'.


git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@1077 e378c898-3ddf-0310-93e7-cc216c733640
This commit is contained in:
rakshasa
2008-11-09 12:56:10 +00:00
parent ca9d0b1773
commit 5166253190
9 changed files with 123 additions and 0 deletions
+8
View File
@@ -43,12 +43,14 @@
namespace rpc {
class CommandVariable;
class CommandObjectPtr;
}
// By using a static array we avoid allocating the variables on the
// heap. This should reduce memory use and improve cache locality.
#define COMMAND_SLOTS_SIZE 200
#define COMMAND_VARIABLES_SIZE 100
#define COMMAND_OBJECT_PTR_SIZE 20
#define COMMAND_DOWNLOAD_SLOTS_SIZE 150
#define COMMAND_FILE_SLOTS_SIZE 30
#define COMMAND_FILE_ITR_SLOTS_SIZE 10
@@ -62,6 +64,8 @@ extern rpc::CommandSlot<void> commandSlots[COMMAND_SLOTS_SIZE];
extern rpc::CommandSlot<void>* commandSlotsItr;
extern rpc::CommandVariable commandVariables[COMMAND_VARIABLES_SIZE];
extern rpc::CommandVariable* commandVariablesItr;
extern rpc::CommandObjectPtr commandObjectPtrs[COMMAND_OBJECT_PTR_SIZE];
extern rpc::CommandObjectPtr* commandObjectPtrsItr;
extern rpc::CommandSlot<core::Download*> commandDownloadSlots[COMMAND_DOWNLOAD_SLOTS_SIZE];
extern rpc::CommandSlot<core::Download*>* commandDownloadSlotsItr;
extern rpc::CommandSlot<torrent::File*> commandFileSlots[COMMAND_FILE_SLOTS_SIZE];
@@ -220,4 +224,8 @@ add_variable(key, NULL, NULL, &rpc::CommandVariable::get_string, NULL, std::stri
#define CMD_FUNC_SINGLE(key, command) \
rpc::commands.insert_type(key, new rpc::CommandFunction(command), &rpc::CommandFunction::call, rpc::CommandMap::flag_public_xmlrpc, NULL, NULL);
#define CMD_OBJ_P(key, function, target) \
commandObjectPtrsItr->set_object(target); \
rpc::commands.insert_type(key, commandObjectPtrsItr++, &rpc::CommandObjectPtr::function, rpc::CommandMap::flag_dont_delete | rpc::CommandMap::flag_public_xmlrpc, NULL, NULL);
#endif