summaryrefslogtreecommitdiff
path: root/libopie/pim/opimaccesstemplate.h
Unidiff
Diffstat (limited to 'libopie/pim/opimaccesstemplate.h') (more/less context) (ignore whitespace changes)
-rw-r--r--libopie/pim/opimaccesstemplate.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/libopie/pim/opimaccesstemplate.h b/libopie/pim/opimaccesstemplate.h
index 6de68b1..8cf81c8 100644
--- a/libopie/pim/opimaccesstemplate.h
+++ b/libopie/pim/opimaccesstemplate.h
@@ -93,6 +93,7 @@ public:
93 * @return <i>true</i> if added successfully. 93 * @return <i>true</i> if added successfully.
94 */ 94 */
95 virtual bool add( const T& t ) ; 95 virtual bool add( const T& t ) ;
96 bool add( const OPimRecord& );
96 97
97 /* only the uid matters */ 98 /* only the uid matters */
98 /** 99 /**
@@ -212,6 +213,15 @@ bool OPimAccessTemplate<T>::add( const T& t ) {
212 return m_backEnd->add( t ); 213 return m_backEnd->add( t );
213} 214}
214template <class T> 215template <class T>
216bool OPimAccessTemplate<T>::add( const OPimRecord& rec) {
217 /* same type */
218 if ( rec.rtti() == T::rtti() ) {
219 const T &t = static_cast<const T&>(rec);
220 return add(t);
221 }
222 return false;
223}
224template <class T>
215bool OPimAccessTemplate<T>::remove( const T& t ) { 225bool OPimAccessTemplate<T>::remove( const T& t ) {
216 return remove( t.uid() ); 226 return remove( t.uid() );
217} 227}