changes for 1.2.4

This commit is contained in:
Guenter Obiltschnig
2006-09-29 14:39:00 +00:00
parent 245e2f7e83
commit 76edf6f35c
52 changed files with 1290 additions and 1056 deletions

View File

@@ -1,7 +1,7 @@
//
// AutoPtr.h
//
// $Id: //poco/1.2/Foundation/include/Poco/AutoPtr.h#1 $
// $Id: //poco/1.2/Foundation/include/Poco/AutoPtr.h#2 $
//
// Library: Foundation
// Package: Core
@@ -151,18 +151,18 @@ public:
}
template <class Other>
AutoPtr < Other > cast()
AutoPtr<Other> cast()
/// Casts the AutoPtr via a dynamic cast to the given type.
/// Returns an AutoPtr containing NULL if the cast fails.
/// Example: (assume class Sub: public Super)
/// AutoPtr < Super > super(new Sub());
/// AutoPtr < Sub > sub = super.cast<Sub>();
/// AutoPtr<Super> super(new Sub());
/// AutoPtr<Sub> sub = super.cast<Sub>();
/// poco_assert (sub.get());
{
Other* pOther = dynamic_cast <Other*>(_ptr);
if (pOther)
pOther->duplicate();
return AutoPtr < Other > (pOther);
return AutoPtr<Other>(pOther);
}
C* operator -> ()
@@ -201,6 +201,11 @@ public:
{
return _ptr;
}
bool isNull() const
{
return _ptr == 0;
}
operator C* ()
{