CAccessor Class

# CAccessor Class Reference

[CADIHash.h Index] [CADIHash.h Hierarchy]

CAccessor - an abstract base class for everything accessing a GIFT database More...

`#include <../libInvertedFile/include/CAccessor.h>`

## Public Members

- virtual operator bool ()
- virtual string IDToURL (TID inID)
- virtual pair<bool,CAccessorElement> IDToAccessorElement (TID inID)
- virtual pair<bool,TID> URLToID (const string& inURL)
- virtual void getAllIDs (list<TID>&)
- /** List of triplets (ID,imageURL,thumbnailURL)
- virtual void getRandomIDs (list<TID>&, list<TID>::size_type)
- virtual void getRandomAccessorElements (list<CAccessorElement>& outResult, list<CAccessorElement>::size_type inSize)
- virtual int size ()

## Protected Members

- virtual void dummy ()

## Detailed Description

CAccessor - an abstract base class for everything accessing a GIFT database. in the future this might be an SQL database or Monet??

modification history:

WM 19990804 created file

compiler defines used:

## virtual operator bool()

Is this accessor up and working?

## virtual string IDToURL(TID inID)

Translate a DocumentID to a URL (for output)

## virtual pair<bool,CAccessorElement> IDToAccessorElement(TID inID)

Translate a DocumentID to an accessor Element

## virtual pair<bool,TID> URLToID(const string& inURL)

Translate an URL to its document ID

## virtual void getAllIDs(list<TID>&)

List of the IDs of all documents present in the inverted file

## virtual void getRandomIDs(list<TID>&, list<TID>::size_type)

get a given number of random AccessorElement's

Parameters:

  inSize | the desired size of the inoutResultList
  inoutResultList | the list which will contain the result

## virtual void getRandomAccessorElements(list<CAccessorElement.html">CAccessorElement>& outResult, list<CAccessorElement.html">CAccessorElement>::size_type inSize)

For drawing random sets. Why is this part of an CAccessor?The way the accessor is organised might influence the way random sets can be drawn. At present everything happens in RAM, but we do not want to be fixed on that.

Parameters:

  inSize | the desired size of the inoutResultList
  inoutResultList | the list which will contain the result

## virtual int size()

The number of images in this accessor

## virtual void dummy()

without this variable things like upcasting etc. won't work (see stroustrup for this)

| Kdoc