Removed Pointer<T> nonsense

This commit is contained in:
Yevgen Muntyan 2010-09-10 00:43:04 -07:00
parent 1d2ebc3eb5
commit a9ef1dacab
3 changed files with 2 additions and 18 deletions

View File

@ -321,8 +321,6 @@ class String
{
public:
String() {}
String(const Pointer<char> &p) { init(p); }
String(const char *str) { init(str); }
String(const char *str, gsize len) { if (len != 0) s().assign(validateUtf8(str, len), len); }

View File

@ -64,19 +64,8 @@ inline void DeleteObject<char>::operator() (char *p) { g_free(p); }
} // namespace impl
template<class T>
class Pointer
{
public:
virtual ~Pointer() {}
virtual T *get() const = 0;
operator T* () const { return get(); }
};
template<class T, class TDeleter = impl::DeleteObject<T> >
class OwningPtr : public Pointer<T>
class OwningPtr
{
public:
OwningPtr(T *p = 0) : m_p(p) {}
@ -156,7 +145,7 @@ public:
}
template<class T, class TRefUnref = impl::RefUnrefObject<T> >
class SharedPtr : public Pointer<T>
class SharedPtr
{
private:
inline static void ref(T *p) { if (p) TRefUnref::ref(p); }

View File

@ -21,13 +21,10 @@
namespace moo {
#define MOO_IMPLEMENT_POINTER(Class, get_ptr_expr) \
operator Class*() const { return get_ptr_expr; } \
Class *operator->() const { return get_ptr_expr; } \
Class &operator*() const { return *mooCheckPtr(get_ptr_expr); }
#define MOO_IMPLEMENT_POINTER_TO_MEM(Class, get_ptr_expr) \
operator Class*() { return get_ptr_expr; } \
operator const Class*() const { return get_ptr_expr; } \
Class *operator->() { return get_ptr_expr; } \
const Class *operator->() const { return get_ptr_expr; } \
Class &operator*() { return *mooCheckPtr(get_ptr_expr); } \