CAccessorImplementation Class

# CAccessorImplementation Class Reference

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

CAccessorImplementation - a base class for everything accessing a GIFT database More...

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

Inherits: CAccessor

## 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)
- void getAllIDs (list<TID>&)
- /** List of triplets (ID,imageURL,thumbnailURL)
- void getRandomIDs (list<TID>&, list<TID>::size_type)
- void getRandomAccessorElements (list<CAccessorElement>& outResult, list<CAccessorElement>::size_type inSize)
- int size ()

## Protected Members

- string_TID_map mURLToID
- TID_CAccessorElement_map mIDToAccessorElement

## Detailed Description

CAccessorImplementation - a base class for everything accessing a GIFT database. at present this will be either an inverted file or a TrackingGIFT accessor. 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

## void getAllIDs(list<TID>&)

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

## 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

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

For drawing random sets. Why is this part of an CAccessorImplementation?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

## int size()

The number of images in this accessor

## string_TID_map mURLToID

map the url of an image to the id of this image

## TID_CAccessorElement_map mIDToAccessorElement

maps the ID of an image to the URL of this image

| Kdoc