* More cleanup of commands, including some optimization by avoiding

some heap allocations.


git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@893 e378c898-3ddf-0310-93e7-cc216c733640
This commit is contained in:
rakshasa
2007-04-18 15:15:06 +00:00
parent d0ae367dca
commit 7077aba019
9 changed files with 216 additions and 74 deletions
+10 -2
View File
@@ -47,6 +47,10 @@
namespace utils {
// The CommandSlot class uses union instead of creating multiple
// derived classes so that it is possible to create an array
// containing different slot types.
class CommandSlot : public Variable {
public:
// For now, only return void.
@@ -57,10 +61,14 @@ public:
// m_slotSet.set(slotSet);
// }
CommandSlot(slot_type::base_type* slotSet) {
m_slot.set(slotSet);
CommandSlot() {}
CommandSlot(slot_type::base_type* s) {
m_slot.set(s);
}
void set_slot(slot_type::base_type* s) { m_slot.set(s); }
static const torrent::Object& call_list(Variable* rawVariable, const torrent::Object& args);
// static const torrent::Object& get_list(Variable* rawVariable, const torrent::Object& args);
+3
View File
@@ -50,6 +50,9 @@ class CommandVariable : public Variable {
public:
CommandVariable(const torrent::Object& v = torrent::Object()) : m_variable(v) {}
const torrent::Object& variable() const { return m_variable; }
void set_variable(const torrent::Object& var) { m_variable = var; }
static const torrent::Object& set_bool(Variable* rawVariable, const torrent::Object& args);
static const torrent::Object& get_bool(Variable* rawVariable, const torrent::Object& args);