------------------------------------------------------------ revno: 3153 committer: poy <p...@123gen.com> branch nick: trunk timestamp: Thu 2012-12-13 18:50:01 +0100 message: remove various explicit copy constructors to allow implicit move modified: dcpp/Bundle.h dcpp/DirectoryListing.cpp dcpp/DirectoryListing.h dcpp/File.h dcpp/Flags.h dcpp/HashManager.h dcpp/SSLSocket.h dcpp/SearchResult.h dcpp/Semaphore.h dcpp/ShareManager.h dcpp/SimpleXML.h dcpp/Singleton.h dcpp/Streams.h dcpp/Util.h dwt/include/dwt/Message.h dwt/include/dwt/Point.h win32/QueueFrame.h
-- lp:dcplusplus https://code.launchpad.net/~dcplusplus-team/dcplusplus/trunk Your team Dcplusplus-team is subscribed to branch lp:dcplusplus. To unsubscribe from this branch go to https://code.launchpad.net/~dcplusplus-team/dcplusplus/trunk/+edit-subscription
=== modified file 'dcpp/Bundle.h' --- dcpp/Bundle.h 2012-01-13 20:55:20 +0000 +++ dcpp/Bundle.h 2012-12-13 17:50:01 +0000 @@ -42,7 +42,6 @@ public: struct Entry { Entry() { } - Entry(const string& name, int64_t size, TTHValue tth, bool include) : name(name), size(size), tth(tth), include(include) { } string name; int64_t size; TTHValue tth; === modified file 'dcpp/DirectoryListing.cpp' --- dcpp/DirectoryListing.cpp 2012-09-14 18:24:29 +0000 +++ dcpp/DirectoryListing.cpp 2012-12-13 17:50:01 +0000 @@ -464,8 +464,6 @@ bool operator()(const DirectoryListing::File::Ptr i) const { return tl.count((i->getTTH())) && (DeleteFunction()(i), true); } -private: - HashContained& operator=(HashContained&); }; struct DirectoryEmpty { === modified file 'dcpp/DirectoryListing.h' --- dcpp/DirectoryListing.h 2012-07-26 17:35:45 +0000 +++ dcpp/DirectoryListing.h 2012-12-13 17:50:01 +0000 @@ -52,13 +52,6 @@ { } - File& operator=(const File& rhs) { - name = rhs.name; size = rhs.size; parent = rhs.parent; tthRoot = rhs.tthRoot; - return *this; - } - - ~File() { } - void save(OutputStream& stream, string& indent, string& tmp) const; struct Sort { bool operator()(const Ptr& a, const Ptr& b) const; }; === modified file 'dcpp/File.h' --- dcpp/File.h 2012-09-13 21:15:43 +0000 +++ dcpp/File.h 2012-12-13 17:50:01 +0000 @@ -108,9 +108,6 @@ #else int h; #endif -private: - File(const File&); - File& operator=(const File&); }; class FileFindIter { === modified file 'dcpp/Flags.h' --- dcpp/Flags.h 2012-01-13 20:55:20 +0000 +++ dcpp/Flags.h 2012-12-13 17:50:01 +0000 @@ -26,15 +26,12 @@ typedef int MaskType; Flags() : flags(0) { } - Flags(const Flags& rhs) : flags(rhs.flags) { } Flags(MaskType f) : flags(f) { } bool isSet(MaskType aFlag) const { return (flags & aFlag) == aFlag; } bool isAnySet(MaskType aFlag) const { return (flags & aFlag) != 0; } void setFlag(MaskType aFlag) { flags |= aFlag; } void unsetFlag(MaskType aFlag) { flags &= ~aFlag; } - Flags& operator=(const Flags& rhs) { flags = rhs.flags; return *this; } -protected: - ~Flags() { } + private: MaskType flags; }; === modified file 'dcpp/HashManager.h' --- dcpp/HashManager.h 2012-12-13 17:04:31 +0000 +++ dcpp/HashManager.h 2012-12-13 17:50:01 +0000 @@ -167,8 +167,6 @@ struct TreeInfo { TreeInfo() : size(0), index(0), blockSize(0) { } TreeInfo(int64_t aSize, int64_t aIndex, int64_t aBlockSize) : size(aSize), index(aIndex), blockSize(aBlockSize) { } - TreeInfo(const TreeInfo& rhs) : size(rhs.size), index(rhs.index), blockSize(rhs.blockSize) { } - TreeInfo& operator=(const TreeInfo& rhs) { size = rhs.size; index = rhs.index; blockSize = rhs.blockSize; return *this; } GETSET(int64_t, size, Size); GETSET(int64_t, index, Index); === modified file 'dcpp/SSLSocket.h' --- dcpp/SSLSocket.h 2012-09-13 21:15:43 +0000 +++ dcpp/SSLSocket.h 2012-12-13 17:50:01 +0000 @@ -63,8 +63,6 @@ friend class CryptoManager; SSLSocket(SSL_CTX* context); - SSLSocket(const SSLSocket&); - SSLSocket& operator=(const SSLSocket&); SSL_CTX* ctx; ssl::SSL ssl; === modified file 'dcpp/SearchResult.h' --- dcpp/SearchResult.h 2012-01-13 20:55:20 +0000 +++ dcpp/SearchResult.h 2012-12-13 17:50:01 +0000 @@ -26,11 +26,13 @@ #include "Pointer.h" #include "Util.h" +#include <boost/noncopyable.hpp> + namespace dcpp { class SearchManager; -class SearchResult : public FastAlloc<SearchResult>, public intrusive_ptr_base<SearchResult> { +class SearchResult : public FastAlloc<SearchResult>, public intrusive_ptr_base<SearchResult>, boost::noncopyable { public: enum Types { TYPE_FILE, @@ -66,8 +68,6 @@ SearchResult(); - SearchResult(const SearchResult& rhs); - string file; string hubName; string hubURL; === modified file 'dcpp/Semaphore.h' --- dcpp/Semaphore.h 2012-01-13 20:55:20 +0000 +++ dcpp/Semaphore.h 2012-12-13 17:50:01 +0000 @@ -19,6 +19,8 @@ #ifndef DCPLUSPLUS_DCPP_SEMAPHORE_H #define DCPLUSPLUS_DCPP_SEMAPHORE_H +#include <boost/noncopyable.hpp> + #ifdef _WIN32 #include "w.h" #else @@ -31,7 +33,7 @@ namespace dcpp { -class Semaphore +class Semaphore : boost::noncopyable { #ifdef _WIN32 public: @@ -97,9 +99,6 @@ private: sem_t semaphore; #endif - Semaphore(const Semaphore&); - Semaphore& operator=(const Semaphore&); - }; } // namespace dcpp === modified file 'dcpp/ShareManager.h' --- dcpp/ShareManager.h 2012-12-13 17:04:31 +0000 +++ dcpp/ShareManager.h 2012-12-13 17:50:01 +0000 @@ -138,8 +138,6 @@ StringComp(const string& s) : a(s) { } bool operator()(const File& b) const { return Util::stricmp(a, b.getName()) == 0; } const string& a; - private: - StringComp& operator=(const StringComp&); }; struct FileLess { bool operator()(const File& a, const File& b) const { return (Util::stricmp(a.getName(), b.getName()) < 0); } === modified file 'dcpp/SimpleXML.h' --- dcpp/SimpleXML.h 2012-07-01 18:41:13 +0000 +++ dcpp/SimpleXML.h 2012-12-13 17:50:01 +0000 @@ -19,6 +19,8 @@ #ifndef DCPLUSPLUS_DCPP_SIMPLE_XML_H #define DCPLUSPLUS_DCPP_SIMPLE_XML_H +#include <boost/noncopyable.hpp> + #include "forward.h" #include "noexcept.h" #include "Exception.h" @@ -157,7 +159,7 @@ } static const string utf8Header; private: - class Tag { + class Tag : boost::noncopyable { public: typedef Tag* Ptr; typedef vector<Ptr> List; @@ -203,10 +205,6 @@ delete i; } } - - private: - Tag(const Tag&); - Tag& operator=(Tag&); }; class TagReader : public SimpleXMLReader::CallBack { === modified file 'dcpp/Singleton.h' --- dcpp/Singleton.h 2012-01-13 20:55:20 +0000 +++ dcpp/Singleton.h 2012-12-13 17:50:01 +0000 @@ -19,12 +19,14 @@ #ifndef DCPLUSPLUS_DCPP_SINGLETON_H #define DCPLUSPLUS_DCPP_SINGLETON_H +#include <boost/noncopyable.hpp> + #include "debug.h" namespace dcpp { template<typename T> -class Singleton { +class Singleton : boost::noncopyable { public: Singleton() { } virtual ~Singleton() { } @@ -48,10 +50,6 @@ } protected: static T* instance; -private: - Singleton(const Singleton&); - Singleton& operator=(const Singleton&); - }; template<class T> T* Singleton<T>::instance = NULL; === modified file 'dcpp/Streams.h' --- dcpp/Streams.h 2012-01-13 20:55:20 +0000 +++ dcpp/Streams.h 2012-12-13 17:50:01 +0000 @@ -21,6 +21,8 @@ #include <algorithm> +#include <boost/noncopyable.hpp> + #include "typedefs.h" #include "format.h" @@ -36,7 +38,7 @@ /** * A simple output stream. Intended to be used for nesting streams one inside the other. */ -class OutputStream { +class OutputStream : boost::noncopyable { public: OutputStream() { } virtual ~OutputStream() { } @@ -61,12 +63,9 @@ virtual bool eof() { return false; } size_t write(const string& str) { return write(str.c_str(), str.size()); } -private: - OutputStream(const OutputStream&); - OutputStream& operator=(const OutputStream&); }; -class InputStream { +class InputStream : boost::noncopyable { public: InputStream() { } virtual ~InputStream() { } @@ -76,9 +75,6 @@ * actually read from the stream source in this call. */ virtual size_t read(void* buf, size_t& len) = 0; -private: - InputStream(const InputStream&); - InputStream& operator=(const InputStream&); }; class MemoryInputStream : public InputStream { === modified file 'dcpp/Util.h' --- dcpp/Util.h 2012-11-23 19:35:18 +0000 +++ dcpp/Util.h 2012-12-13 17:50:01 +0000 @@ -60,7 +60,6 @@ CompareFirst(const T1& compareTo) : a(compareTo) { } bool operator()(const pair<T1, T2>& p) { return op()(p.first, a); } private: - CompareFirst& operator=(const CompareFirst&); const T1& a; }; @@ -71,7 +70,6 @@ CompareSecond(const T2& compareTo) : a(compareTo) { } bool operator()(const pair<T1, T2>& p) { return op()(p.second, a); } private: - CompareSecond& operator=(const CompareSecond&); const T2& a; }; === modified file 'dwt/include/dwt/Message.h' --- dwt/include/dwt/Message.h 2012-03-03 15:04:23 +0000 +++ dwt/include/dwt/Message.h 2012-12-13 17:50:01 +0000 @@ -76,8 +76,6 @@ // forceValues will if false "manipulate" the values for easy comparison Message( const MSG& msg ); - ~Message() { } - bool operator<(const Message& rhs) const; bool operator==(const Message& rhs) const; private: === modified file 'dwt/include/dwt/Point.h' --- dwt/include/dwt/Point.h 2012-01-13 20:55:20 +0000 +++ dwt/include/dwt/Point.h 2012-12-13 17:50:01 +0000 @@ -85,9 +85,7 @@ class ScreenCoordinate { public: ScreenCoordinate() { } - ScreenCoordinate(const ScreenCoordinate& sc) : point(sc.point) { } - - explicit ScreenCoordinate(const Point& pt) : point(pt) { } + ScreenCoordinate(const Point& pt) : point(pt) { } const Point& getPoint() const { return point; } Point& getPoint() { return point; } @@ -95,7 +93,6 @@ long x() const { return getPoint().x; } long y() const { return getPoint().y; } - ScreenCoordinate& operator=(const ScreenCoordinate& rhs) { point = rhs.point; return *this; } private: Point point; }; === modified file 'win32/QueueFrame.h' --- win32/QueueFrame.h 2012-10-11 16:17:05 +0000 +++ win32/QueueFrame.h 2012-12-13 17:50:01 +0000 @@ -22,6 +22,8 @@ #include <memory> #include <unordered_map> +#include <boost/noncopyable.hpp> + #include <dcpp/FastAlloc.h> #include <dcpp/QueueManagerListener.h> #include <dcpp/QueueItem.h> @@ -87,7 +89,7 @@ class QueueItemInfo; friend class QueueItemInfo; - class QueueItemInfo : public Flags, public FastAlloc<QueueItemInfo> { + class QueueItemInfo : public Flags, public FastAlloc<QueueItemInfo>, boost::noncopyable { public: struct Display : public FastAlloc<Display> { @@ -181,11 +183,7 @@ uint32_t updateMask; private: - unique_ptr<Display> display; - - QueueItemInfo(const QueueItemInfo&); - QueueItemInfo& operator=(const QueueItemInfo&); }; typedef unique_ptr<QueueItemInfo> QueueItemPtr;
_______________________________________________ Mailing list: https://launchpad.net/~linuxdcpp-team Post to : linuxdcpp-team@lists.launchpad.net Unsubscribe : https://launchpad.net/~linuxdcpp-team More help : https://help.launchpad.net/ListHelp