libopie PIM API Documentation

OPimAccessBackend< T > Class Template Reference

OPimAccessBackend is the base class for all private backends it operates on OPimRecord as the base class and it's responsible for fast manipulating the resource the implementation takes care of. More...

#include <opimaccessbackend.h>

Inheritance diagram for OPimAccessBackend< T >:

Inheritance graph
[legend]
Collaboration diagram for OPimAccessBackend< T >:

Collaboration graph
[legend]
List of all members.

Public Types

typedef OTemplateBase< T > Frontend

Public Member Functions

 OPimAccessBackend (int access=0)
 The access hint from the frontend.

virtual ~OPimAccessBackend ()
virtual bool load ()=0
 load the resource

virtual bool reload ()=0
 reload the resource

virtual bool save ()=0
 save the resource and all it's changes

virtual QArray< intallRecords () const=0
 return an array of all available uids

virtual QArray< intmatchRegexp (const QRegExp &r) const=0
 return a List of records that match the regex

virtual QArray< intqueryByExample (const T &t, int settings, const QDateTime &d=QDateTime())=0
 queryByExample for T with the given Settings

virtual T find (int uid) const=0
 find the OPimRecord with uid

virtual T find (int uid, const QArray< int > &items, uint current, typename Frontend::CacheDirection) const
virtual void clear ()=0
 clear the back end

virtual bool add (const T &t)=0
 add T

virtual bool remove (int uid)=0
 remove

virtual bool replace (const T &t)=0
 replace a record with T.uid()

void setFrontend (Frontend *front)
void setReadAhead (uint count)
 set the read ahead count


Protected Member Functions

int access () const
void cache (const T &t) const
void setSaneCacheSize (int)
 use a prime number here!

uint readAhead () const

Detailed Description

template<class T = OPimRecord>
class OPimAccessBackend< T >

OPimAccessBackend is the base class for all private backends it operates on OPimRecord as the base class and it's responsible for fast manipulating the resource the implementation takes care of.

Definition at line 21 of file opimaccessbackend.h.


Member Typedef Documentation

template<class T = OPimRecord>
typedef OTemplateBase<T> OPimAccessBackend< T >::Frontend
 

Definition at line 23 of file opimaccessbackend.h.

Referenced by OPimAccessBackend< T >::setFrontend().


Constructor & Destructor Documentation

template<class T>
OPimAccessBackend< T >::OPimAccessBackend int  access = 0  ) 
 

The access hint from the frontend.

Definition at line 120 of file opimaccessbackend.h.

template<class T>
OPimAccessBackend< T >::~OPimAccessBackend  )  [virtual]
 

Definition at line 126 of file opimaccessbackend.h.


Member Function Documentation

template<class T = OPimRecord>
virtual bool OPimAccessBackend< T >::load  )  [pure virtual]
 

load the resource

Implemented in OContactAccessBackend_SQL, OContactAccessBackend_VCard, OContactAccessBackend_XML, ODateBookAccessBackend_SQL, ODateBookAccessBackend_XML, OTodoAccessBackendSQL, OTodoAccessVCal, and OTodoAccessXML.

Referenced by OPimAccessTemplate< T >::load().

template<class T = OPimRecord>
virtual bool OPimAccessBackend< T >::reload  )  [pure virtual]
 

reload the resource

Implemented in OContactAccessBackend_SQL, OContactAccessBackend_VCard, OContactAccessBackend_XML, ODateBookAccessBackend_SQL, ODateBookAccessBackend_XML, OTodoAccessBackendSQL, OTodoAccessVCal, and OTodoAccessXML.

Referenced by OPimAccessTemplate< T >::reload().

template<class T = OPimRecord>
virtual bool OPimAccessBackend< T >::save  )  [pure virtual]
 

save the resource and all it's changes

Implemented in OContactAccessBackend_SQL, OContactAccessBackend_VCard, OContactAccessBackend_XML, ODateBookAccessBackend_SQL, ODateBookAccessBackend_XML, OTodoAccessBackendSQL, OTodoAccessVCal, and OTodoAccessXML.

Referenced by OPimAccessTemplate< T >::save().

template<class T = OPimRecord>
virtual QArray<int> OPimAccessBackend< T >::allRecords  )  const [pure virtual]
 

return an array of all available uids

Implemented in OContactAccessBackend_SQL, OContactAccessBackend_VCard, OContactAccessBackend_XML, ODateBookAccessBackend_SQL, ODateBookAccessBackend_XML, OTodoAccessBackendSQL, OTodoAccessVCal, and OTodoAccessXML.

template<class T = OPimRecord>
virtual QArray<int> OPimAccessBackend< T >::matchRegexp const QRegExp r  )  const [pure virtual]
 

return a List of records that match the regex

Implemented in OContactAccessBackend, OContactAccessBackend_SQL, OContactAccessBackend_VCard, OContactAccessBackend_XML, ODateBookAccessBackend_SQL, ODateBookAccessBackend_XML, OTodoAccessBackendSQL, OTodoAccessVCal, and OTodoAccessXML.

template<class T = OPimRecord>
virtual QArray<int> OPimAccessBackend< T >::queryByExample const T &  t,
int  settings,
const QDateTime d = QDateTime()
[pure virtual]
 

queryByExample for T with the given Settings

Implemented in OContactAccessBackend_SQL, OContactAccessBackend_VCard, OContactAccessBackend_XML, ODateBookAccessBackend_SQL, ODateBookAccessBackend_XML, OTodoAccessBackendSQL, OTodoAccessVCal, and OTodoAccessXML.

Referenced by OPimAccessTemplate< T >::queryByExample().

template<class T = OPimRecord>
virtual T OPimAccessBackend< T >::find int  uid  )  const [pure virtual]
 

find the OPimRecord with uid

Parameters:
uid returns T and T.isEmpty() if nothing was found

Implemented in OContactAccessBackend_SQL, OContactAccessBackend_VCard, OContactAccessBackend_XML, ODateBookAccessBackend_SQL, ODateBookAccessBackend_XML, OTodoAccessBackendSQL, OTodoAccessVCal, and OTodoAccessXML.

Referenced by OPimAccessTemplate< T >::find().

template<class T>
T OPimAccessBackend< T >::find int  uid,
const QArray< int > &  items,
uint  current,
typename Frontend::CacheDirection 
const [virtual]
 

Reimplemented in OTodoAccessBackendSQL.

Definition at line 144 of file opimaccessbackend.h.

template<class T = OPimRecord>
virtual void OPimAccessBackend< T >::clear  )  [pure virtual]
 

clear the back end

Implemented in OContactAccessBackend_SQL, OContactAccessBackend_VCard, OContactAccessBackend_XML, ODateBookAccessBackend_SQL, ODateBookAccessBackend_XML, OTodoAccessBackendSQL, OTodoAccessVCal, and OTodoAccessXML.

Referenced by OPimAccessTemplate< T >::clear().

template<class T = OPimRecord>
virtual bool OPimAccessBackend< T >::add const T &  t  )  [pure virtual]
 

add T

Implemented in OContactAccessBackend_SQL, OContactAccessBackend_VCard, OContactAccessBackend_XML, ODateBookAccessBackend_SQL, ODateBookAccessBackend_XML, OTodoAccessBackendSQL, OTodoAccessVCal, and OTodoAccessXML.

Referenced by OPimAccessTemplate< T >::add().

template<class T = OPimRecord>
virtual bool OPimAccessBackend< T >::remove int  uid  )  [pure virtual]
 

remove

Implemented in OContactAccessBackend_SQL, OContactAccessBackend_VCard, OContactAccessBackend_XML, ODateBookAccessBackend_SQL, ODateBookAccessBackend_XML, OTodoAccessBackendSQL, OTodoAccessVCal, and OTodoAccessXML.

Referenced by OPimAccessTemplate< T >::remove().

template<class T = OPimRecord>
virtual bool OPimAccessBackend< T >::replace const T &  t  )  [pure virtual]
 

replace a record with T.uid()

Implemented in OContactAccessBackend_SQL, OContactAccessBackend_VCard, OContactAccessBackend_XML, ODateBookAccessBackend_SQL, ODateBookAccessBackend_XML, OTodoAccessBackendSQL, OTodoAccessVCal, and OTodoAccessXML.

Referenced by OPimAccessTemplate< T >::replace().

template<class T>
void OPimAccessBackend< T >::setFrontend Frontend front  ) 
 

Definition at line 130 of file opimaccessbackend.h.

References OPimAccessBackend< T >::Frontend.

Referenced by OPimAccessTemplate< T >::setBackEnd().

template<class T>
void OPimAccessBackend< T >::setReadAhead uint  count  ) 
 

set the read ahead count

Definition at line 149 of file opimaccessbackend.h.

Referenced by OPimAccessTemplate< T >::setReadAhead().

template<class T>
int OPimAccessBackend< T >::access  )  const [protected]
 

Definition at line 157 of file opimaccessbackend.h.

template<class T>
void OPimAccessBackend< T >::cache const T &  t  )  const [protected]
 

Definition at line 134 of file opimaccessbackend.h.

template<class T>
void OPimAccessBackend< T >::setSaneCacheSize int   )  [protected]
 

use a prime number here!

Definition at line 139 of file opimaccessbackend.h.

References OTemplateBase< T >::setSaneCacheSize().

template<class T>
uint OPimAccessBackend< T >::readAhead  )  const [protected]
 

Definition at line 153 of file opimaccessbackend.h.


The documentation for this class was generated from the following file:
KDE Logo
This file is part of the documentation for OPIE Version 1.1.
Documentation copyright © 1997-2003 the KDE developers. 2003 OPIE developers
Generated on Tue Feb 10 20:25:58 2004 by doxygen 1.3.5 written by Dimitri van Heesch, © 1997-2001