Revision: 637
http://svn.sourceforge.net/pygccxml/?rev=637&view=rev
Author: roman_yakovenko
Date: 2006-10-10 06:15:25 -0700 (Tue, 10 Oct 2006)
Log Message:
-----------
changing tabs to spaces
Modified Paths:
--------------
pyplusplus_dev/unittests/smart_ptrs/bindings.cpp
pyplusplus_dev/unittests/smart_ptrs/classes.hpp
pyplusplus_dev/unittests/smart_ptrs/smart_ptr.h
Modified: pyplusplus_dev/unittests/smart_ptrs/bindings.cpp
===================================================================
--- pyplusplus_dev/unittests/smart_ptrs/bindings.cpp 2006-10-10 07:42:21 UTC (rev 636)
+++ pyplusplus_dev/unittests/smart_ptrs/bindings.cpp 2006-10-10 13:15:25 UTC (rev 637)
@@ -1,5 +1,3 @@
-// This file has been generated by Py++.
-
// Copyright 2004 Roman Yakovenko.
// Distributed under the Boost Software License, Version 1.0. (See
// accompanying file LICENSE_1_0.txt or copy at
Modified: pyplusplus_dev/unittests/smart_ptrs/classes.hpp
===================================================================
--- pyplusplus_dev/unittests/smart_ptrs/classes.hpp 2006-10-10 07:42:21 UTC (rev 636)
+++ pyplusplus_dev/unittests/smart_ptrs/classes.hpp 2006-10-10 13:15:25 UTC (rev 637)
@@ -31,7 +31,7 @@
derived_ptr_t( const smart_ptr_t< base_i >& r)
: smart_ptr_t<derived_t>()
- {
+ {
pRep = static_cast<derived_t*>(r.getPointer());
pUseCount = r.useCountPointer();
if (pUseCount)
@@ -41,18 +41,18 @@
}
derived_ptr_t& operator=(const smart_ptr_t< base_i >& r)
- {
- if (pRep == static_cast<derived_t*>(r.getPointer()))
- return *this;
+ {
+ if (pRep == static_cast<derived_t*>(r.getPointer()))
+ return *this;
release();
- pRep = static_cast<derived_t*>(r.getPointer());
- pUseCount = r.useCountPointer();
- if (pUseCount)
- {
- ++(*pUseCount);
+ pRep = static_cast<derived_t*>(r.getPointer());
+ pUseCount = r.useCountPointer();
+ if (pUseCount)
+ {
+ ++(*pUseCount);
}
- return *this;
+ return *this;
}
};
Modified: pyplusplus_dev/unittests/smart_ptrs/smart_ptr.h
===================================================================
--- pyplusplus_dev/unittests/smart_ptrs/smart_ptr.h 2006-10-10 07:42:21 UTC (rev 636)
+++ pyplusplus_dev/unittests/smart_ptrs/smart_ptr.h 2006-10-10 13:15:25 UTC (rev 637)
@@ -5,109 +5,109 @@
template<class T> class smart_ptr_t {
protected:
- T* pRep;
- unsigned int* pUseCount;
+ T* pRep;
+ unsigned int* pUseCount;
public:
- smart_ptr_t()
+ smart_ptr_t()
: pRep(0), pUseCount(0)
{}
//What will happen if rep is NULL? -> bug
- explicit smart_ptr_t(T* rep)
+ explicit smart_ptr_t(T* rep)
: pRep(rep), pUseCount( new unsigned int(1) )
- {}
+ {}
- smart_ptr_t(const smart_ptr_t& r)
+ smart_ptr_t(const smart_ptr_t& r)
: pRep(0), pUseCount(0)
{
- pRep = r.get();
- pUseCount = r.useCountPointer();
- if(pUseCount){
- ++(*pUseCount);
- }
+ pRep = r.get();
+ pUseCount = r.useCountPointer();
+ if(pUseCount){
+ ++(*pUseCount);
+ }
}
- smart_ptr_t& operator=(const smart_ptr_t& r){
- if( pRep == r.pRep ){
- return *this;
- }
+ smart_ptr_t& operator=(const smart_ptr_t& r){
+ if( pRep == r.pRep ){
+ return *this;
+ }
- release();
+ release();
- pRep = r.get();
- pUseCount = r.useCountPointer();
- if(pUseCount){
- ++(*pUseCount);
- }
- return *this;
- }
+ pRep = r.get();
+ pUseCount = r.useCountPointer();
+ if(pUseCount){
+ ++(*pUseCount);
+ }
+ return *this;
+ }
template<class Y>
- smart_ptr_t(const smart_ptr_t<Y>& r)
+ smart_ptr_t(const smart_ptr_t<Y>& r)
: pRep(0), pUseCount(0)
{
- pRep = r.get();
- pUseCount = r.useCountPointer();
- if(pUseCount){
- ++(*pUseCount);
- }
+ pRep = r.get();
+ pUseCount = r.useCountPointer();
+ if(pUseCount){
+ ++(*pUseCount);
+ }
}
template< class Y>
- smart_ptr_t& operator=(const smart_ptr_t<Y>& r){
- if( pRep == r.pRep ){
- return *this;
- }
+ smart_ptr_t& operator=(const smart_ptr_t<Y>& r){
+ if( pRep == r.pRep ){
+ return *this;
+ }
- release();
+ release();
- pRep = r.get();
- pUseCount = r.useCountPointer();
- if(pUseCount){
- ++(*pUseCount);
- }
- return *this;
- }
+ pRep = r.get();
+ pUseCount = r.useCountPointer();
+ if(pUseCount){
+ ++(*pUseCount);
+ }
+ return *this;
+ }
- virtual ~smart_ptr_t() {
+ virtual ~smart_ptr_t() {
release();
- }
+ }
- inline T& operator*() const {
- assert(pRep); return *pRep;
- }
+ inline T& operator*() const {
+ assert(pRep); return *pRep;
+ }
- inline T* operator->() const {
- assert(pRep); return pRep;
- }
+ inline T* operator->() const {
+ assert(pRep); return pRep;
+ }
- inline T* get() const {
- return pRep;
- }
+ inline T* get() const {
+ return pRep;
+ }
- inline unsigned int* useCountPointer() const {
- return pUseCount;
- }
+ inline unsigned int* useCountPointer() const {
+ return pUseCount;
+ }
- inline T* getPointer() const {
- return pRep;
- }
+ inline T* getPointer() const {
+ return pRep;
+ }
protected:
inline void release(void){
- bool destroyThis = false;
+ bool destroyThis = false;
- if( pUseCount ){
- if( --(*pUseCount) == 0){
- destroyThis = true;
- }
- }
- if (destroyThis){
- destroy();
- }
+ if( pUseCount ){
+ if( --(*pUseCount) == 0){
+ destroyThis = true;
+ }
+ }
+ if (destroyThis){
+ destroy();
+ }
}
virtual void destroy(void){
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|