This accessor is a base class for accessors which use an URL2FTS file to implement the interface of the CAccessor base class. More...
#include <CAcURL2FTS.h>
Public Member Functions | |
const string & | getURLToFeatureFileName () const |
gives back the content of mURLToFeatureFileName | |
CAcURL2FTS (const CXMLElement &inContentElement) | |
Constructor: slurp in an url2fts file and fill the maps. | |
virtual | operator bool () const |
Is this accessor up and working? | |
virtual int | size () const |
Give the number of elements stored in this accessor. | |
pair< bool, string > | URLToFFN (const string &inURL) const |
gives the feature file name which corresponds to a given URL return value: pair of bool (does the feature file exsist) string (the feature file name) | |
pair< bool, string > | IDToFFN (TID inID) const |
gives the feature file name which corresponds to a given URL return value: pair of bool (does the feature file exsist) string (the feature file name) | |
![]() | |
virtual string | IDToURL (TID inID) const |
Translate a DocumentID to a URL (for output) | |
virtual pair< bool, CAccessorElement > | IDToAccessorElement (TID inID) const |
Translate a DocumentID to an accessor Element. | |
virtual pair< bool, TID > | URLToID (const string &inURL) const |
Translate an URL to its document ID. | |
void | getAllIDs (list< TID > &) const |
This is useful for making lists of which images are present in a database etc. | |
void | getAllAccessorElements (list< CAccessorElement > &) const |
List of triplets (ID,imageURL,thumbnailURL) of all the documents present in the inverted file. | |
void | getRandomIDs (list< TID > &, list< TID >::size_type) const |
get a given number of random AccessorElement's | |
void | getRandomAccessorElements (list< CAccessorElement > &outResult, list< CAccessorElement >::size_type inSize) const |
For drawing random sets. | |
![]() | |
virtual | ~CAccessor () |
virtual accessor for clean destruction | |
virtual CXMLElement * | prepareDatabase () |
If a new collection is created during runtime, this function prepares the indexing structures such that they are able to accept new objects. | |
virtual bool | isPreparedDatabase () const |
Is the database accessed by this accessor prepared? In other words: is there an index structure to access? |
Protected Attributes | |
TID | mID |
the ID of the next element | |
string | mURLPrefix |
the url-prefix for the image list | |
string | mThumbnailURLPrefix |
the thumbnail-url-prefix for the image list | |
CMutex | mMutexURL2FTS |
the mutex for multithreading the name is intended to be unique and immune against inheritance... | |
string_string_map | mURLToFFN |
map from the url of an image to the name of the feature file for this image | |
TID_string_map | mIDToFFN |
map from the id of an image to the name of the feature file for this image | |
ifstream | mURLToFeatureFile |
URL -> FeatureFileName. | |
string | mURLToFeatureFileName |
Name of the file that contains pairs of URL and the Feature file that belongs to the URL. | |
![]() | |
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 |
Friends | |
class | CAcIFFileSystem |
void | newStartURL2FTSElement (void *inUserData, const char *inElementName, const char **inAttributes) |
we construct this with a little help from this friend | |
void | newEndURL2FTSElement (void *inUserData, const char *inElementName) |
we construct this with a little help from this friend |
Additional Inherited Members | |
![]() | |
virtual void | dummy () const |
without this function things like upcasting etc. |
This accessor is a base class for accessors which use an URL2FTS file to implement the interface of the CAccessor base class.
CAcURL2FTS::CAcURL2FTS | ( | const CXMLElement & | inContentElement | ) |
Constructor: slurp in an url2fts file and fill the maps.
Like every accessor, this accessor takes a <collection> MRML element as input (
cui-base-dir: the directory containing the following files cui-feature-file-location: the location of the "url2fts" file which translates urls to feature file names.
|
virtual |
Is this accessor up and working?
Implements CAccessorImplementation.
Reimplemented in CAcIFFileSystem.
|
virtual |
Give the number of elements stored in this accessor.
Reimplemented from CAccessorImplementation.
Reimplemented in CAcIFFileSystem.