Move 'round()' / 'trunc()' etc so that they won't conflict with any versions already...
[ardour.git] / libs / pbd / pbd / command.h
index f913dec5b7b448f822b3ce456e68fb7d575c01ea..a9b313f4fa5ed7dee4414d0c82212f70dc80e7b4 100644 (file)
@@ -1,4 +1,5 @@
-/* 
+
+/*
     Copyright (C) 2006 Paul Davis
     Author: Hans Fugal
 
 #ifndef __lib_pbd_command_h__
 #define __lib_pbd_command_h__
 
+#include <string>
+
+#include "pbd/libpbd_visibility.h"
+#include "pbd/signals.h"
 #include "pbd/statefuldestructible.h"
-#include <boost/utility.hpp>
 
-class Command : public PBD::StatefulDestructible, public boost::noncopyable
+/** Base class for Undo/Redo commands and changesets */
+class LIBPBD_API Command : public PBD::StatefulDestructible, public PBD::ScopedConnectionList
 {
 public:
        virtual ~Command() { /* NOTE: derived classes must call drop_references() */ }
 
        virtual void operator() () = 0;
-       
+
        void set_name (const std::string& str) { _name = str; }
        const std::string& name() const { return _name; }
-       
+
        virtual void undo() = 0;
        virtual void redo() { (*this)(); }
-       
+
        virtual XMLNode &get_state();
-       virtual int set_state(const XMLNode&, int version = 3000) { /* noop */ return 0; }
+       virtual int set_state(const XMLNode&, int /*version*/) { /* noop */ return 0; }
+
+       virtual bool empty () const {
+               return false;
+       }
 
 protected:
        Command() {}