ddc
|
#include <ddcMMap.h>
Public Types | |
typedef ddcMMap< T > | MMapT |
typedef vector< T > | VecT |
typedef T | EltT |
typedef T * | iterator |
typedef const T * | const_iterator |
Public Member Functions | |
ddcVecFile () | |
default constructor More... | |
ddcVecFile (const std::string &filename, bool useMMap=false) | |
construct and open More... | |
~ddcVecFile () | |
default destructor calls close() More... | |
void | clear () |
clear() method wraps close() More... | |
const string & | filename () const |
returns filename of last open(), or NULL More... | |
T * | data () const |
returns a pointer to the mmap()ed file data, or NULL More... | |
size_t | size () const |
returns the number of objects of type T in this vector, or 0 More... | |
bool | empty () const |
STL-esque wrapper. More... | |
bool | opened () const |
returns true iff m_data is non-NULL More... | |
operator bool () const | |
implicit typecast to bool More... | |
operator T* () const | |
implicit typecast to T* More... | |
T & | operator[] (size_t idx) const |
indexing operator More... | |
void | push_back (const T &value) |
simulate vector::push_back(): used by indexing routines More... | |
iterator | begin () |
iterator | end () |
const_iterator | begin () const |
const_iterator | end () const |
ddcVecFile & | open (const std::string &filename, bool useMMap=false) |
map a named file filename More... | |
void | close () |
unmap current file (if any) More... | |
void | ensureVec () |
force vector-implementation More... | |
void | ensureData () |
ensure data is a valid pointer More... | |
void | save (FILE *fp) const |
dump data to a FILE* More... | |
void | save (const string &FileName) const |
dump to a named file More... | |
void | save (FILE *fp, const string &name) const |
dump data to a FILE* with a symbolic name More... | |
Public Attributes | |
string | m_file |
filename (if any) More... | |
ddcMMap< T > | m_mmap |
data (mmap) More... | |
vector< T > | m_vec |
data (slurp) More... | |
T * | m_data |
data (pointer to m_mmap or m_vec data) More... | |
slurp or mmap an array of <T> to memory. uses either ReadVector(...,vector<T>) ("slurp") or ddcMMap<T> ("mmap")
typedef ddcMMap<T> ddcVecFile< T >::MMapT |
typedef vector<T> ddcVecFile< T >::VecT |
typedef T ddcVecFile< T >::EltT |
typedef T* ddcVecFile< T >::iterator |
typedef const T* ddcVecFile< T >::const_iterator |
|
inline |
default constructor
|
inline |
construct and open
|
inline |
default destructor calls close()
|
inline |
Referenced by CFreeBiblIndex::clear(), CHitBorders::CBreakCollection::ClearAll(), CStringIndexSet::ConvertLoadIndexToWorkingIndex(), CConcIndexator::CreateAsUnion(), CFreeBiblStringIndex::CreatePartitions(), CFreeBiblIndex::CreateUnion(), CFreeBiblStringIndex::CreateUnion(), CIndexSetForQueryingStage::DestroyIndexSet(), CHitBorders::RemoveHitBordersFileAndClear(), CConcIndexator::SplitProject(), CConcXml::Start(), CHitBorders::StartIndexing(), CConcXml::UnionBibliographies(), and CStringIndexSet::UnionIndexSets().
|
inline |
returns filename of last open(), or NULL
Referenced by ddcMapFile< DWORD, DWORD >::ensureMap(), ddcStringEnum< OffT_ >::ensureVec(), and ddcCorpusList< OffT_ >::ensureVec().
|
inline |
returns a pointer to the mmap()ed file data, or NULL
|
inline |
returns the number of objects of type T in this vector, or 0
Referenced by CIndexSetForLoadingStage::AddItemStrToBuffer(), CIndexSetForQueryingStage::AddOneIndexItem(), CHitBorders::CBreakCollection::AppendBreaks(), CFreeBiblStringIndex::ConvertAndSaveToDiskAfterIndexing(), CQueryNode::ConvertOccurrencesToHitsForPatterns(), CQCount::CountUniversal(), CConcIndexator::CreateAsUnion(), CreateMorphIndex(), CStringIndexSet::CreateSplitPartitions(), CConcordance::DumpFileIndexTabs(), CStringIndexSet::EnsureSuffixIndex(), CConcSession::GetContext(), CStringIndexSet::GetContextBounds(), CConcSession::GetContextJson(), CHitBorders::GetCorpusEndTokenNo(), CBiblIndex::GetFullBibliographyOfHit(), CHitBorders::GetPageNumber(), CStringIndexSet::GetTokenIndexId(), CStringIndexSet::GetTokensFromStorage(), CDDCLeafServer::handle__info(), CConcSession::InitFileReferences(), CConcSession::InitSortByRank(), ddcCorpusList< OffT_ >::itemEndOffset(), CBiblIndex::LoadBibl(), CConcordance::LoadMaskedFiles(), CStringIndexSet::QueryTokenListUniversal(), CStringIndexSet::QueryTokenListUsingRegExp(), CFreeBiblIndex::ReadFromDisk(), ddcStringEnum< OffT_ >::size(), ddcCorpusList< OffT_ >::size(), CConcXml::UnionBibliographies(), and CStringIndexSet::UnionIndexSets().
|
inline |
STL-esque wrapper.
Referenced by CStringIndexSet::ConvertLoadIndexToWorkingIndex(), CStringIndexSet::ConvertTempStorageToPersistent(), ddcStringEnum< OffT_ >::empty(), ddcCorpusList< OffT_ >::empty(), CHitBorders::GetCorpusEndTokenNo(), CHitBorders::GetFileStartTokenNo(), CHitBorders::GetPageNumber(), and CBiblIndex::InitSortByDate().
|
inline |
returns true iff m_data is non-NULL
Referenced by ddcStringEnum< OffT_ >::opened(), ddcCorpusList< OffT_ >::opened(), and ddcMapFile< DWORD, DWORD >::opened().
|
inline |
implicit typecast to bool
|
inline |
implicit typecast to T*
References ddcMMap< T >::m_data.
|
inline |
indexing operator
|
inline |
simulate vector::push_back(): used by indexing routines
Referenced by CIndexSetForLoadingStage::AddItemStrToBuffer(), CIndexSetForQueryingStage::AddOneIndexItem(), CFreeBiblIndex::RegisterBiblStringItemId(), and CFreeBiblStringIndex::RegisterBiblStringItemId().
|
inline |
Referenced by CHitBorders::CBreakCollection::AppendBreaks(), CHitBorders::ConvertHitsToPageBreaks(), CQueryNode::ConvertOccurrencesToHits(), CQueryNode::ConvertOccurrencesToHitsForPatterns(), CQCount::CountUniversal(), CConcIndexator::CreateAsUnion(), CFreeBiblIndex::CreatePartitions(), CFreeBiblStringIndex::CreatePartitions(), CConcordance::DumpFileIndexTabs(), CStringIndexSet::GetContextBounds(), CConcordance::GetOccurrencesByPosition(), CHitBorders::GetTokenPageBreak(), CStringIndexSet::GetTypeIndexId(), CStringIndexSet::GetTypeIndexIdLowerBound(), CStringIndexSet::GetTypeIndexIdLowerBoundIter(), CStringIndexSet::GetTypeIndexIdUpperBoundIter(), CConcSession::InitFileReferences(), CConcordance::LoadMaskedFiles(), ddcStringEnum< OffT_ >::lower_bound(), CStringIndexSet::QueryTokenList(), CStringIndexSet::QueryTokenListWithLeftTruncation(), CStringIndexSet::QueryTokenListWithRightTruncation(), CConcXml::SplitBibliography(), CConcIndexator::SplitProject(), ddcStringEnum< OffT_ >::to_vector(), and ddcStringEnum< OffT_ >::upper_bound().
|
inline |
Referenced by CHitBorders::CBreakCollection::AppendBreaks(), CHitBorders::ConvertHitsToPageBreaks(), CQueryNode::ConvertOccurrencesToHits(), CQueryNode::ConvertOccurrencesToHitsForPatterns(), CQCount::CountUniversal(), CConcIndexator::CreateAsUnion(), CConcordance::DumpFileIndexJson(), CConcordance::DumpFileIndexTabs(), CStringIndexSet::GetContextBounds(), CConcordance::GetOccurrencesByPosition(), CHitBorders::GetTokenPageBreak(), CStringIndexSet::GetTypeIndexId(), CStringIndexSet::GetTypeIndexIdLowerBoundIter(), CStringIndexSet::GetTypeIndexIdUpperBoundIter(), CConcSession::InitFileReferences(), CConcordance::LoadMaskedFiles(), ddcStringEnum< OffT_ >::lower_bound(), CStringIndexSet::QueryTokenList(), CStringIndexSet::QueryTokenListWithLeftTruncation(), CStringIndexSet::QueryTokenListWithRightTruncation(), CConcIndexator::SplitProject(), ddcStringEnum< OffT_ >::to_vector(), and ddcStringEnum< OffT_ >::upper_bound().
|
inline |
|
inline |
|
inline |
map a named file filename
Referenced by CBiblIndex::LoadBibl(), CHitBorders::LoadHitBorders(), CIndexSetForQueryingStage::LoadIndexSet(), CConcordance::LoadMaskedFiles(), ddcStringEnum< OffT_ >::open(), ddcCorpusList< OffT_ >::open(), CFreeBiblIndex::ReadFromDisk(), CHitBorders::CBreakCollection::ReadFromDisk(), and CStringIndexSet::ReadFromTheDisk().
|
inline |
unmap current file (if any)
Referenced by ddcStringEnum< OffT_ >::close(), ddcCorpusList< OffT_ >::close(), CStringIndexSet::DestroyIndexSet(), ddcStringEnum< OffT_ >::ensureVec(), and ddcCorpusList< OffT_ >::ensureVec().
|
inline |
force vector-implementation
Referenced by CHitBorders::AddPageBreak(), CHitBorders::CBreakCollection::AppendBreaks(), CFreeBiblIndex::ConvertAndSaveToDiskAfterIndexing(), CFreeBiblStringIndex::ConvertAndSaveToDiskAfterIndexing(), CStringIndexSet::ConvertTempStorageToPersistent(), CConcIndexator::CreateAsUnion(), CFreeBiblStringIndex::CreatePartitions(), CFreeBiblIndex::CreateUnion(), CFreeBiblStringIndex::CreateUnion(), CStringIndexSet::EnsureSuffixIndex(), CConcXml::FinalSaveBibliography(), CConcIndexator::SplitProject(), CConcXml::UnionBibliographies(), CStringIndexSet::UnionIndexSets(), and CStringIndexSet::WriteToFile().
|
inline |
ensure data is a valid pointer
Referenced by CHitBorders::CBreakCollection::AppendBreaks(), CFreeBiblStringIndex::CreatePartitions(), CFreeBiblIndex::CreateUnion(), CFreeBiblStringIndex::CreateUnion(), CConcIndexator::SplitProject(), and CConcXml::UnionBibliographies().
|
inline |
dump data to a FILE*
Referenced by CFreeBiblStringIndex::CreatePartitions(), CFreeBiblIndex::CreateUnion(), CFreeBiblStringIndex::CreateUnion(), ddcVecFile< CIndexItem >::save(), CHitBorders::SavePageBreaks(), CHitBorders::CBreakCollection::SaveToFile(), and CConcXml::UnionBibliographies().
|
inline |
dump to a named file
|
inline |
dump data to a FILE* with a symbolic name
string ddcVecFile< T >::m_file |
filename (if any)
ddcMMap<T> ddcVecFile< T >::m_mmap |
data (mmap)
vector<T> ddcVecFile< T >::m_vec |
data (slurp)
Referenced by CConcXml::AddIndexItem(), CHitBorders::AddPageBreak(), CHitBorders::CBreakCollection::AppendBreaks(), CFreeBiblIndex::ConvertAndSaveToDiskAfterIndexing(), CFreeBiblStringIndex::ConvertAndSaveToDiskAfterIndexing(), CStringIndexSet::ConvertTempStorageToPersistent(), CConcIndexator::CreateAsUnion(), CFreeBiblStringIndex::CreatePartitions(), CStringIndexSet::CreateSplitPartitions(), CFreeBiblIndex::CreateUnion(), CFreeBiblStringIndex::CreateUnion(), CStringIndexSet::EnsureSuffixIndex(), CConcXml::FinalSaveBibliography(), CConcXml::SplitBibliography(), CConcIndexator::SplitProject(), CConcXml::UnionBibliographies(), CStringIndexSet::UnionIndexSets(), and CStringIndexSet::WriteToFile().
T* ddcVecFile< T >::m_data |
data (pointer to m_mmap or m_vec data)
Referenced by CStringIndexSet::GetTypeIndexIdLowerBoundIter(), CStringIndexSet::GetTypeIndexIdUpperBoundIter(), ddcStringEnum< OffT_ >::operator[](), CStringIndexSet::QueryTokenListWithLeftTruncation(), CStringIndexSet::QueryTokenListWithRightTruncation(), and ddcStringEnum< OffT_ >::to_vector().