Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

OPimAccessBackend< T > Class Template Reference

#include </home/clem/local/src/opie/noncore/unsupported/libopie/pim/opimaccessbackend.h>

Inheritance diagram for OPimAccessBackend< T >:

Inheritance graph
[legend]
List of all members.

Public Types

typedef OTemplateBase< T > Frontend

Public Member Functions

 OPimAccessBackend (int access=0)
virtual ~OPimAccessBackend ()
virtual bool load ()=0
virtual bool reload ()=0
virtual bool save ()=0
virtual QArray< int > allRecords () const =0
virtual QArray< int > matchRegexp (const QRegExp &r) const =0
virtual QArray< int > queryByExample (const T &t, int settings, const QDateTime &d=QDateTime())=0
virtual T find (int uid) const =0
virtual T find (int uid, const QArray< int > &items, uint current, typename Frontend::CacheDirection) const
virtual void clear ()=0
virtual bool add (const T &t)=0
 Add the record to the internal database.
virtual bool remove (int uid)=0
virtual bool replace (const T &t)=0
 Take this Record and replace the old version.
void setFrontend (Frontend *front)
void setReadAhead (uint count)
 Set the number of items to Read-Ahead/Read-Behind.

Protected Member Functions

int access () const
void cache (const T &t) const
 Add the Record to the PIM Cache.
void setSaneCacheSize (int)
 Give a hint on the number of too cached items.
uint readAhead () const
 Return the number of Items to be ReadAhead.

Private Attributes

OPimAccessBackendPrivate * d
Frontendm_front
uint m_read
int m_acc

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.


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.

References l, and OPimAccessBackend< T >::m_front.

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

Definition at line 126 of file opimaccessbackend.h.


Member Function Documentation

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

Definition at line 157 of file opimaccessbackend.h.

References OPimAccessBackend< T >::m_acc.

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

Add the record to the internal database.

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>
template< class T > QArray< UID > 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.

Referenced by OPimAccessTemplate< T >::allRecords(), and OPimAccessTemplate< T >::records().

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

Add the Record to the PIM Cache.

This will add the Record to the PIM cache, which is owned by the FrontEnd. If no FrontEnd is available the item will not be cached.

Parameters:
t The Item to be added to the Cache

Definition at line 134 of file opimaccessbackend.h.

References OTemplateBase< T >::cache(), and OPimAccessBackend< T >::m_front.

template<class T = OPimRecord>
template< class T > bool 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>
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.

References OPimAccessBackend< T >::find().

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(), and OPimAccessBackend< T >::find().

template<class T = OPimRecord>
template< class T > 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>
template< class T > QArray< UID > 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.

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

template<class T = OPimRecord>
template< class T > QArray< UID > 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>
uint OPimAccessBackend< T >::readAhead  )  const [protected]
 

Return the number of Items to be ReadAhead.

Returns:
The number of Items to read ahead/read behind

Definition at line 153 of file opimaccessbackend.h.

References OPimAccessBackend< T >::m_read.

template<class T = OPimRecord>
template< class T > 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 >::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>
template< class T > bool OPimAccessBackend< T >::replace const T &  t  )  [pure virtual]
 

Take this Record and replace the old version.

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 = OPimRecord>
template< class T > 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>
void OPimAccessBackend< T >::setFrontend Frontend fr  ) 
 

@aram fron The Frontend that uses this backend

This function is called by the frontend and is used

Definition at line 130 of file opimaccessbackend.h.

References OPimAccessBackend< T >::m_front.

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

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

Set the number of items to Read-Ahead/Read-Behind.

set the read ahead count

Definition at line 149 of file opimaccessbackend.h.

References OPimAccessBackend< T >::m_read.

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

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

Give a hint on the number of too cached items.

use a prime number here!

Definition at line 139 of file opimaccessbackend.h.

References OPimAccessBackend< T >::m_front, and OTemplateBase< T >::setSaneCacheSize().


Member Data Documentation

template<class T = OPimRecord>
OPimAccessBackendPrivate* OPimAccessBackend< T >::d [private]
 

Reimplemented in OContactAccessBackend, ODateBookAccessBackend, ODateBookAccessBackend_SQL, ODateBookAccessBackend_XML, OTodoAccessBackend, and OTodoAccessXML.

Definition at line 112 of file opimaccessbackend.h.

template<class T = OPimRecord>
int OPimAccessBackend< T >::m_acc [private]
 

Definition at line 115 of file opimaccessbackend.h.

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

template<class T = OPimRecord>
Frontend* OPimAccessBackend< T >::m_front [private]
 

Definition at line 113 of file opimaccessbackend.h.

Referenced by OPimAccessBackend< T >::cache(), OPimAccessBackend< T >::OPimAccessBackend(), OPimAccessBackend< T >::setFrontend(), and OPimAccessBackend< T >::setSaneCacheSize().

template<class T = OPimRecord>
uint OPimAccessBackend< T >::m_read [private]
 

Definition at line 114 of file opimaccessbackend.h.

Referenced by OPimAccessBackend< T >::readAhead(), and OPimAccessBackend< T >::setReadAhead().


The documentation for this class was generated from the following files:
Generated on Sat Nov 5 17:43:05 2005 for OPIE by  doxygen 1.4.2