You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by ta...@apache.org on 2009/03/03 21:51:38 UTC
svn commit: r749746 - in /activemq/activemq-cpp/trunk/src/main/decaf:
internal/AprPool.h util/AbstractCollection.h util/concurrent/Mutex.h
Author: tabish
Date: Tue Mar 3 20:51:37 2009
New Revision: 749746
URL: http://svn.apache.org/viewvc?rev=749746&view=rev
Log:
https://issues.apache.org/activemq/browse/AMQCPP-227
Make mutex and apr pool class non copyable.
Modified:
activemq/activemq-cpp/trunk/src/main/decaf/internal/AprPool.h
activemq/activemq-cpp/trunk/src/main/decaf/util/AbstractCollection.h
activemq/activemq-cpp/trunk/src/main/decaf/util/concurrent/Mutex.h
Modified: activemq/activemq-cpp/trunk/src/main/decaf/internal/AprPool.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/decaf/internal/AprPool.h?rev=749746&r1=749745&r2=749746&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/decaf/internal/AprPool.h (original)
+++ activemq/activemq-cpp/trunk/src/main/decaf/internal/AprPool.h Tue Mar 3 20:51:37 2009
@@ -38,6 +38,11 @@
*/
mutable apr_pool_t* aprPool;
+ private:
+
+ AprPool( const AprPool& pool );
+ AprPool& operator= ( const AprPool& pool );
+
public:
AprPool();
Modified: activemq/activemq-cpp/trunk/src/main/decaf/util/AbstractCollection.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/decaf/util/AbstractCollection.h?rev=749746&r1=749745&r2=749746&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/decaf/util/AbstractCollection.h (original)
+++ activemq/activemq-cpp/trunk/src/main/decaf/util/AbstractCollection.h Tue Mar 3 20:51:37 2009
@@ -65,6 +65,24 @@
virtual ~AbstractCollection() {}
/**
+ * Assignment Operator, copy element from the source collection to this
+ * collection after clearing any element stored in this collection.
+ *
+ * @param collection - the collection to copy
+ * @return a reference to this collection
+ */
+ AbstractCollection<E>& operator= ( const AbstractCollection<E>& collection ) {
+ this->clear();
+
+ std::auto_ptr< Iterator<E> > iter( collection.iterator() );
+ while( iter->hasNext() ) {
+ this->add( iter->next() );
+ }
+
+ return *this;
+ }
+
+ /**
* Ensures that this collection contains the specified element (optional operation).
* Returns true if this collection changed as a result of the call. (Returns false if
* this collection does not permit duplicates and already contains the specified element.)
Modified: activemq/activemq-cpp/trunk/src/main/decaf/util/concurrent/Mutex.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/decaf/util/concurrent/Mutex.h?rev=749746&r1=749745&r2=749746&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/decaf/util/concurrent/Mutex.h (original)
+++ activemq/activemq-cpp/trunk/src/main/decaf/util/concurrent/Mutex.h Tue Mar 3 20:51:37 2009
@@ -56,6 +56,11 @@
volatile unsigned long lock_owner;
volatile unsigned long lock_count;
+ private:
+
+ Mutex( const Mutex& src );
+ Mutex& operator= ( const Mutex& src );
+
public:
/**