mirror of
https://github.com/rakshasa/rtorrent.git
synced 2026-10-07 14:49:21 +00:00
* 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:
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user