summaryrefslogtreecommitdiff
path: root/libopie2/opiepim/core/opimtemplatebase.h
authoreilers <eilers>2004-04-28 09:22:02 (UTC)
committer eilers <eilers>2004-04-28 09:22:02 (UTC)
commit134b7accd6bdc8fbc160a42f7c52c585e73f4add (patch) (side-by-side diff)
tree5e221e990d0c94e38d816e147762f205733b0e72 /libopie2/opiepim/core/opimtemplatebase.h
parent8ce67859c54234dabd88e17a0bc72369ea8301a3 (diff)
downloadopie-134b7accd6bdc8fbc160a42f7c52c585e73f4add.zip
opie-134b7accd6bdc8fbc160a42f7c52c585e73f4add.tar.gz
opie-134b7accd6bdc8fbc160a42f7c52c585e73f4add.tar.bz2
Some modifications to alow use of generic OPimRecords without need to
cast them manually to the right type
Diffstat (limited to 'libopie2/opiepim/core/opimtemplatebase.h') (more/less context) (ignore whitespace changes)
-rw-r--r--libopie2/opiepim/core/opimtemplatebase.h16
1 files changed, 4 insertions, 12 deletions
diff --git a/libopie2/opiepim/core/opimtemplatebase.h b/libopie2/opiepim/core/opimtemplatebase.h
index 58cbfeb..b48dfed 100644
--- a/libopie2/opiepim/core/opimtemplatebase.h
+++ b/libopie2/opiepim/core/opimtemplatebase.h
@@ -1,6 +1,6 @@
/*
This file is part of the Opie Project
- Copyright (C) The Main Author <main-author@whereever.org>
+ Copyright (C) Holger Freyther <zecke@handhelds.org>
=. Copyright (C) The Opie Team <opie-devel@handhelds.org>
.=l.
.>+-=
@@ -49,10 +49,11 @@ struct OPimBase {
/**
* return the rtti
*/
- virtual int rtti()= 0;
+ virtual int rtti() const = 0;
virtual OPimRecord* record()const = 0;
virtual OPimRecord* record(int uid)const = 0;
virtual bool add( const OPimRecord& ) = 0;
+ virtual bool add( const OPimRecord* ) = 0;
virtual bool remove( int uid ) = 0;
virtual bool remove( const OPimRecord& ) = 0;
virtual void clear() = 0;
@@ -90,8 +91,6 @@ public:
virtual void cache( const T& )const = 0;
virtual void setSaneCacheSize( int ) = 0;
- /* reimplement of OPimBase */
- int rtti();
OPimRecord* record()const;
OPimRecord* record(int uid )const;
static T* rec();
@@ -100,14 +99,7 @@ private:
OTemplateBasePrivate *d;
};
-/*
- * implementation
- */
-template <class T>
-int
-OTemplateBase<T>::rtti() {
- return T::rtti();
-}
+
template <class T>
OPimRecord* OTemplateBase<T>::record()const {
T* t = new T;