NLPACS::CRetrieverBank Class Reference

A bank of retrievers, shared by several global retrievers. More...

#include <retriever_bank.h>

Inherits NLPACS::URetrieverBank.

List of all members.

Public Member Functions

 CRetrieverBank (bool allLoaded=true)
 Constructor.
const std::vector
< CLocalRetriever > & 
getRetrievers () const
 Returns the vector of retrievers.
uint size () const
 Returns the number of retrievers in the bank.
const CLocalRetrievergetRetriever (uint n) const
 Gets nth retriever.
uint addRetriever (const CLocalRetriever &retriever)
 Adds the given retriever to the bank.
uint addRetriever (const std::string &filename)
 Loads the retriever named 'filename' (using defined search paths) and adds it to the bank.
void clean ()
 Cleans the bank up.
void setLrInFileFlag (bool status)
 Set the lr status.
void serial (NLMISC::IStream &f)
 Serialises this CRetrieverBank.
void saveRetrievers (const std::string &path, const std::string &bankPrefix)
 Write separate retrievers using dynamic filename convention.
void saveShortBank (const std::string &path, const std::string &bankPrefix, bool saveLr=true)
 Write separate retrievers using dynamic filename convention.
Dynamic retrieve loading



void diff (const std::set< uint > &newlr, std::set< uint > &in, std::set< uint > &out)
 Diff loaded retrievers.
void loadRetriever (uint n, NLMISC::IStream &s)
 Loads nth retriever from stream.
void setRetrieverAsLoaded (uint n)
 Insert a retriever in loaded list.
void unloadRetriever (uint n)
 Unload nth retriever.
const std::string & getNamePrefix () const
void setNamePrefix (const char *prefix)
bool allLoaded () const
bool isLoaded (uint n) const
 Tells if retriever is loaded.

Protected Attributes

std::vector< CLocalRetriever_Retrievers
 The retrievers stored in the retriever bank.
bool _AllLoaded
 All loaded ?
std::string _NamePrefix
 Bank name prefix.
std::set< uint_LoadedRetrievers
 The loaded retrievers, if the retriever bank is not in loadAll mode.
bool _LrInRBank
 Tells if retrievers should be read from rbank directly or streamed from disk.

Friends

class URetrieverBank

Detailed Description

A bank of retrievers, shared by several global retrievers.

Author:
Benjamin Legros
Nevrax France
Date:
2001

Definition at line 49 of file retriever_bank.h.


Constructor & Destructor Documentation

NLPACS::CRetrieverBank::CRetrieverBank ( bool  allLoaded = true  )  [inline]

Constructor.

Definition at line 71 of file retriever_bank.h.


Member Function Documentation

uint NLPACS::CRetrieverBank::addRetriever ( const std::string &  filename  )  [inline]

Loads the retriever named 'filename' (using defined search paths) and adds it to the bank.

Definition at line 92 of file retriever_bank.h.

References _Retrievers, NLMISC::CIFile::close(), nldebug, NLMISC::CIFile::open(), and NLPACS::CLocalRetriever::serial().

uint NLPACS::CRetrieverBank::addRetriever ( const CLocalRetriever retriever  )  [inline]

Adds the given retriever to the bank.

Definition at line 89 of file retriever_bank.h.

References _Retrievers.

bool NLPACS::CRetrieverBank::allLoaded (  )  const [inline]
void NLPACS::CRetrieverBank::clean ( void   ) 

Cleans the bank up.

Definition at line 67 of file retriever_bank.cpp.

References _Retrievers.

void NLPACS::CRetrieverBank::diff ( const std::set< uint > &  newlr,
std::set< uint > &  in,
std::set< uint > &  out 
) [inline]

Diff loaded retrievers.

Definition at line 210 of file retriever_bank.h.

References _LoadedRetrievers, _Retrievers, and NLMISC::n.

const std::string& NLPACS::CRetrieverBank::getNamePrefix (  )  const [inline]
const CLocalRetriever& NLPACS::CRetrieverBank::getRetriever ( uint  n  )  const [inline]
const std::vector<CLocalRetriever>& NLPACS::CRetrieverBank::getRetrievers (  )  const [inline]

Returns the vector of retrievers.

Definition at line 74 of file retriever_bank.h.

References _Retrievers.

Referenced by NLPACS::CGlobalRetriever::check(), NLPACS::CGlobalRetriever::getIdentifier(), and NLPACS::CGlobalRetriever::makeLinks().

bool NLPACS::CRetrieverBank::isLoaded ( uint  n  )  const [inline]

Tells if retriever is loaded.

Definition at line 285 of file retriever_bank.h.

References _Retrievers.

Referenced by NLPACS::CGlobalRetriever::selectInstances().

void NLPACS::CRetrieverBank::loadRetriever ( uint  n,
NLMISC::IStream s 
) [inline]

Loads nth retriever from stream.

Definition at line 244 of file retriever_bank.h.

References _AllLoaded, _LoadedRetrievers, _NamePrefix, _Retrievers, nlwarning, and NLMISC::IStream::serial().

void NLPACS::CRetrieverBank::saveRetrievers ( const std::string &  path,
const std::string &  bankPrefix 
) [inline]

Write separate retrievers using dynamic filename convention.

Definition at line 183 of file retriever_bank.h.

References _Retrievers, NLMISC::IStream::serial(), NLMISC::CPath::standardizePath(), and NLMISC::toString().

Referenced by saveShortBank().

void NLPACS::CRetrieverBank::saveShortBank ( const std::string &  path,
const std::string &  bankPrefix,
bool  saveLr = true 
) [inline]

Write separate retrievers using dynamic filename convention.

Definition at line 194 of file retriever_bank.h.

References _LrInRBank, saveRetrievers(), serial(), and NLMISC::CPath::standardizePath().

void NLPACS::CRetrieverBank::serial ( NLMISC::IStream f  )  [inline]
void NLPACS::CRetrieverBank::setLrInFileFlag ( bool  status  )  [inline]

Set the lr status.

Definition at line 109 of file retriever_bank.h.

References _LrInRBank.

void NLPACS::CRetrieverBank::setNamePrefix ( const char *  prefix  )  [inline]

Definition at line 279 of file retriever_bank.h.

References _NamePrefix.

void NLPACS::CRetrieverBank::setRetrieverAsLoaded ( uint  n  )  [inline]

Insert a retriever in loaded list.

Definition at line 257 of file retriever_bank.h.

References _LoadedRetrievers.

uint NLPACS::CRetrieverBank::size (  )  const [inline]

Returns the number of retrievers in the bank.

Definition at line 77 of file retriever_bank.h.

References _Retrievers.

void NLPACS::CRetrieverBank::unloadRetriever ( uint  n  )  [inline]

Unload nth retriever.

Definition at line 263 of file retriever_bank.h.

References _AllLoaded, _LoadedRetrievers, _NamePrefix, _Retrievers, and nlwarning.


Friends And Related Function Documentation

friend class URetrieverBank [friend]

Definition at line 51 of file retriever_bank.h.


Member Data Documentation

The loaded retrievers, if the retriever bank is not in loadAll mode.

Definition at line 64 of file retriever_bank.h.

Referenced by diff(), loadRetriever(), setRetrieverAsLoaded(), and unloadRetriever().

Tells if retrievers should be read from rbank directly or streamed from disk.

Definition at line 67 of file retriever_bank.h.

Referenced by saveShortBank(), serial(), and setLrInFileFlag().

std::string NLPACS::CRetrieverBank::_NamePrefix [protected]

The retrievers stored in the retriever bank.

Definition at line 55 of file retriever_bank.h.

Referenced by addRetriever(), clean(), diff(), getRetriever(), getRetrievers(), isLoaded(), loadRetriever(), saveRetrievers(), serial(), size(), and unloadRetriever().


The documentation for this class was generated from the following files:

Generated on Thu Jan 7 08:30:22 2010 for NeL by  doxygen 1.6.1