more (trivial) cleanup and renaming

This commit is contained in:
Fischlurch 2010-12-03 03:13:57 +01:00
parent d1c64dd1c0
commit 145ad6c3a5
8 changed files with 18 additions and 12 deletions

View file

@ -54,7 +54,7 @@
#include "lib/error.hpp" #include "lib/error.hpp"
#include "lib/sync-classlock.hpp" #include "lib/sync-classlock.hpp"
#include "lib/scoped-holder.hpp" #include "lib/scoped-holder.hpp"
#include "lib/scopedholdertransfer.hpp" #include "lib/scoped-holder-transfer.hpp"

View file

@ -1,5 +1,5 @@
/* /*
SCOPEDHOLDERVECTOR.hpp - using ScopedHolder within a STL vector SCOPED-HOLDER-TRANSFER.hpp - using ScopedHolder within a STL vector
Copyright (C) Lumiera.org Copyright (C) Lumiera.org
2008, Hermann Vosseler <Ichthyostega@web.de> 2008, Hermann Vosseler <Ichthyostega@web.de>
@ -22,8 +22,8 @@
#ifndef LIB_SCOPEDHOLDERVECTOR_H #ifndef LIB_SCOPEDHOLDER_TRANSFER_H
#define LIB_SCOPEDHOLDERVECTOR_H #define LIB_SCOPEDHOLDER_TRANSFER_H
#include "lib/error.hpp" #include "lib/error.hpp"
#include <memory> #include <memory>

View file

@ -47,7 +47,7 @@
** friend function. ** friend function.
** **
** @see scoped-holder-test.cpp ** @see scoped-holder-test.cpp
** @see scopedholdertransfer.hpp use in std::vector ** @see scoped-holder-transfer.hpp use in std::vector
** @see AllocationCluster usage example ** @see AllocationCluster usage example
** @see scoped-ptrvect.hpp simple pointer-holding collection ** @see scoped-ptrvect.hpp simple pointer-holding collection
*/ */

View file

@ -171,7 +171,7 @@ namespace lib {
private: private:
/** @internal element access, including null check */ /** @internal element access, including range and null check */
T* T*
get (size_type i) get (size_type i)
{ {

View file

@ -84,7 +84,7 @@ test_lib_SOURCES = \
$(testlib_srcdir)/sanitised-identifier-test.cpp \ $(testlib_srcdir)/sanitised-identifier-test.cpp \
$(testlib_srcdir)/scoped-holder-test.cpp \ $(testlib_srcdir)/scoped-holder-test.cpp \
$(testlib_srcdir)/scoped-ptrvect-test.cpp \ $(testlib_srcdir)/scoped-ptrvect-test.cpp \
$(testlib_srcdir)/scopedholdertransfertest.cpp \ $(testlib_srcdir)/scoped-holder-transfer-test.cpp \
$(testlib_srcdir)/singleton-subclass-test.cpp \ $(testlib_srcdir)/singleton-subclass-test.cpp \
$(testlib_srcdir)/singleton-test.cpp \ $(testlib_srcdir)/singleton-test.cpp \
$(testlib_srcdir)/singletontestmocktest.cpp \ $(testlib_srcdir)/singletontestmocktest.cpp \
@ -106,7 +106,7 @@ test_lib_SOURCES = \
$(testlib_srcdir)/typed-allocation-manager-test.cpp \ $(testlib_srcdir)/typed-allocation-manager-test.cpp \
$(testlib_srcdir)/typed-counter-test.cpp \ $(testlib_srcdir)/typed-counter-test.cpp \
$(testlib_srcdir)/util-foreach-test.cpp \ $(testlib_srcdir)/util-foreach-test.cpp \
$(testlib_srcdir)/vectortransfertest.cpp \ $(testlib_srcdir)/vector-transfer-test.cpp \
$(testlib_srcdir)/visitingtoolconcept.cpp \ $(testlib_srcdir)/visitingtoolconcept.cpp \
$(testlib_srcdir)/visitingtoolextendedtest.cpp \ $(testlib_srcdir)/visitingtoolextendedtest.cpp \
$(testlib_srcdir)/visitingtooltest.cpp $(testlib_srcdir)/visitingtooltest.cpp

View file

@ -26,7 +26,7 @@
#include "lib/util.hpp" #include "lib/util.hpp"
#include "lib/scoped-holder.hpp" #include "lib/scoped-holder.hpp"
#include "lib/scopedholdertransfer.hpp" #include "lib/scoped-holder-transfer.hpp"
#include "testdummy.hpp" #include "testdummy.hpp"
#include <iostream> #include <iostream>
@ -68,8 +68,7 @@ namespace lib {
if (throw_in_transfer) if (throw_in_transfer)
throw to.getVal(); throw to.getVal();
to.setVal (from.getVal()); swap (from,to);
from.setVal(0);
} }
}; };

View file

@ -23,6 +23,7 @@
#include <boost/noncopyable.hpp> #include <boost/noncopyable.hpp>
#include <algorithm>
namespace lib { namespace lib {
@ -63,6 +64,12 @@ namespace test{
val_ = newVal; val_ = newVal;
} }
friend void
swap (Dummy& dum1, Dummy& dum2) ///< checksum neutral
{
std::swap(dum1.val_, dum2.val_);
}
private: private:
void void
init() init()

View file

@ -24,7 +24,7 @@
#include "lib/test/run.hpp" #include "lib/test/run.hpp"
#include "lib/scopedholdertransfer.hpp" #include "lib/scoped-holder-transfer.hpp"
#include "testdummy.hpp" #include "testdummy.hpp"
#include <iostream> #include <iostream>