NCBI C++ ToolKit
|
Search Toolkit Book for COrgRefCache
#include "cache.hpp"
(Private to src/objects/taxon1
.)
Classes | |
struct | SCacheEntry |
Public Member Functions | |
COrgRefCache (CTaxon1 &host) | |
~COrgRefCache () | |
bool | Init (unsigned nCapacity=10) |
bool | Lookup (TTaxId tax_id, CTaxon1Node **ppNode) |
bool | LookupAndAdd (TTaxId tax_id, CTaxon1Node **ppData) |
bool | LookupAndInsert (TTaxId tax_id, CTaxon2_data **ppData) |
bool | Lookup (TTaxId tax_id, CTaxon2_data **ppData) |
bool | Insert2 (CTaxon1Node &node) |
const char * | GetRankName (int rank) |
TTaxRank | GetSuperkingdomRank () const |
TTaxRank | GetGenusRank () const |
TTaxRank | GetSpeciesRank () const |
TTaxRank | GetSubspeciesRank () const |
const char * | GetNameClassName (short nc) |
TTaxNameClass | GetPreferredCommonNameClass () const |
TTaxNameClass | GetCommonNameClass () const |
const char * | GetDivisionName (TTaxDivision div_id) |
const char * | GetDivisionCode (TTaxDivision div_id) |
CTreeCont & | GetTree () |
const CTreeCont & | GetTree () const |
void | SetIndexEntry (int id, CTaxon1Node *pNode) |
Private Types | |
typedef map< TTaxNameClass, string > | TNameClassMap |
typedef TNameClassMap::const_iterator | TNameClassMapCI |
typedef TNameClassMap::iterator | TNameClassMapI |
Private Member Functions | |
bool | InitDomain (const string &name, CDomainStorage &storage) |
bool | InitRanks () |
TTaxRank | FindRankByName (const char *pchName) |
bool | InitNameClasses () |
TTaxNameClass | FindNameClassByName (const char *pchName) |
bool | InitDivisions () |
TTaxDivision | FindDivisionByCode (const char *pchCode) |
TTaxDivision | FindDivisionByName (const char *pchName) |
COrgRefCache (const COrgRefCache &) | |
COrgRefCache & | operator= (const COrgRefCache &) |
Friends | |
class | CTaxon1Node |
class | CTaxon1 |
|
private |
|
private |
|
private |
COrgRefCache::~COrgRefCache | ( | ) |
Definition at line 54 of file cache.cpp.
References i, m_lCache, and m_ppEntries.
|
private |
|
private |
Definition at line 435 of file cache.cpp.
References CDomainStorage::FindValueIdByField(), InitDivisions(), CDomainStorage::kIllegalValue, m_divStorage, and result.
Referenced by CTaxon1::GetDivisionIdByName().
|
private |
Definition at line 447 of file cache.cpp.
References CDomainStorage::FindValueIdByField(), InitDivisions(), CDomainStorage::kIllegalValue, m_divStorage, and result.
Referenced by CTaxon1::GetDivisionIdByName().
|
private |
Definition at line 381 of file cache.cpp.
References map_checker< Container >::begin(), map_checker< Container >::end(), InitNameClasses(), and m_ncStorage.
Referenced by CTaxon1::GetNameClassId(), and InitNameClasses().
Definition at line 265 of file cache.cpp.
References CDomainStorage::FindFieldValueById(), CDomainStorage::FindValueIdByField(), CDomainStorage::HasField(), InitRanks(), CDomainStorage::kIllegalValue, and m_rankStorage.
Referenced by CTaxon1::GetAncestorByRank(), CTaxon1::GetRankIdByName(), and InitRanks().
|
inline |
Definition at line 115 of file cache.hpp.
References m_ncCommon.
Referenced by CTaxon1::GetDisplayCommonName().
const char * COrgRefCache::GetDivisionCode | ( | TTaxDivision | div_id | ) |
Definition at line 459 of file cache.cpp.
References CDomainStorage::FindFieldStringById(), InitDivisions(), m_divStorage, and NULL.
Referenced by CTaxon1::GetDivisionName().
const char * COrgRefCache::GetDivisionName | ( | TTaxDivision | div_id | ) |
Definition at line 470 of file cache.cpp.
References CDomainStorage::FindFieldStringById(), InitDivisions(), m_divStorage, and NULL.
Referenced by CTaxon1::GetDivisionName().
|
inline |
Definition at line 109 of file cache.hpp.
References m_nGenusRank.
Referenced by CTaxon1::GetGenus().
const char * COrgRefCache::GetNameClassName | ( | short | nc | ) |
Definition at line 370 of file cache.cpp.
References map_checker< Container >::end(), map_checker< Container >::find(), InitNameClasses(), m_ncStorage, and NULL.
Referenced by CTaxon1::GetNameClass().
|
inline |
Definition at line 114 of file cache.hpp.
References m_ncPrefCommon.
Referenced by CTaxon1::GetDisplayCommonName().
Definition at line 278 of file cache.cpp.
References CDomainStorage::FindFieldStringById(), CDomainStorage::FindValueIdByField(), CDomainStorage::HasField(), InitRanks(), CDomainStorage::kIllegalValue, m_rankStorage, and NULL.
Referenced by CTaxon1::GetRankName().
|
inline |
Definition at line 110 of file cache.hpp.
References m_nSpeciesRank.
Referenced by CTaxon1::GetSpecies(), and CTaxon1::GetTypeMaterial().
|
inline |
Definition at line 111 of file cache.hpp.
References m_nSubspeciesRank.
Referenced by CTaxon1::GetTypeMaterial().
|
inline |
Definition at line 108 of file cache.hpp.
References m_nSuperkingdomRank.
Referenced by CTaxon1::GetSuperkingdom().
|
inline |
Definition at line 120 of file cache.hpp.
References m_tPartTree.
Referenced by CTaxon1::GetChildren(), CTaxon1::GetPopsetJoin(), CTaxon1::GetTreeIterator(), and CTaxon1::LoadSubtreeEx().
Definition at line 121 of file cache.hpp.
References m_tPartTree.
bool COrgRefCache::Init | ( | unsigned | nCapacity = 10 | ) |
Definition at line 65 of file cache.cpp.
References CTaxon1Node, CTaxon1_resp_Base::GetMaxtaxid(), CTaxon1_resp_Base::IsMaxtaxid(), m_host, m_nCacheCapacity, m_nMaxTaxId, m_ppEntries, m_tPartTree, CTaxon1::SendRequest(), CTaxon1_name_Base::SetCde(), SetIndexEntry(), CTaxon1::SetLastError(), CTaxon1_req_Base::SetMaxtaxid(), CTaxon1_name_Base::SetOname(), CTreeCont::SetRoot(), CTaxon1_name_Base::SetTaxid(), TAX_ID_CONST, and TAX_ID_TO.
Referenced by CTaxon1::Init().
|
private |
Definition at line 482 of file cache.cpp.
References CDomainStorage::empty(), InitDomain(), and m_divStorage.
Referenced by FindDivisionByCode(), FindDivisionByName(), GetDivisionCode(), and GetDivisionName().
|
private |
Definition at line 297 of file cache.cpp.
References CDomainStorage::AddField(), i, CDomainStorage::InsertFieldValue(), CTaxon1_resp_Base::IsGetdomain(), m_host, CTaxon1::SendRequest(), CTaxon1_req_Base::SetGetdomain(), CTaxon1_resp_Base::SetGetdomain(), CDomainStorage::SetId(), CTaxon1::SetLastError(), and CDomainStorage::SetName().
Referenced by InitDivisions(), and InitRanks().
|
private |
Definition at line 393 of file cache.cpp.
References FindNameClassByName(), CTaxon1_resp_Base::GetGetcde(), i, CTaxon1_resp_Base::IsGetcde(), m_host, m_ncCommon, m_ncPrefCommon, m_ncStorage, CTaxon1::SendRequest(), CTaxon1_req_Base::SetGetcde(), CTaxon1::SetLastError(), and map_checker< Container >::size().
Referenced by FindNameClassByName(), CTaxon1::GetDisplayCommonName(), CTaxon1::GetNameClassId(), and GetNameClassName().
|
private |
Definition at line 337 of file cache.cpp.
References CDomainStorage::empty(), FindRankByName(), InitDomain(), m_host, m_nGenusRank, m_nSpeciesRank, m_nSubspeciesRank, m_nSuperkingdomRank, m_rankStorage, and CTaxon1::SetLastError().
Referenced by FindRankByName(), CTaxon1::GetGenus(), GetRankName(), CTaxon1::GetSpecies(), CTaxon1::GetSuperkingdom(), and CTaxon1::GetTypeMaterial().
bool COrgRefCache::Insert2 | ( | CTaxon1Node & | node | ) |
Definition at line 221 of file cache.cpp.
References CTaxon1_resp_Base::GetLookup(), CTaxon1_data_Base::GetOrg(), CTaxon1Node::GetTaxId(), CTaxon1_resp_Base::IsLookup(), CTaxon1::m_bWithSynonyms, CTaxon1Node::m_cacheEntry, m_host, m_lCache, m_nCacheCapacity, COrgRefCache::SCacheEntry::m_pTax2, COrgRefCache::SCacheEntry::m_pTreeNode, NULL, CTaxon1::SendRequest(), CTaxon1::SetLastError(), CTaxon1_req_Base::SetLookup(), CTaxon2_data_Base::SetOrg(), COrgrefProp::SetOrgrefProp(), COrg_ref::SetTaxId(), and CTaxon1::x_ConvertOrgrefProps().
Referenced by LookupAndInsert().
bool COrgRefCache::Lookup | ( | TTaxId | tax_id, |
CTaxon1Node ** | ppNode | ||
) |
Definition at line 103 of file cache.cpp.
References m_nMaxTaxId, m_ppEntries, NULL, and TAX_ID_TO.
Referenced by CTaxon1::LoadSubtreeEx().
bool COrgRefCache::Lookup | ( | TTaxId | tax_id, |
CTaxon2_data ** | ppData | ||
) |
Definition at line 203 of file cache.cpp.
References COrgRefCache::SCacheEntry::GetData(), CTaxon1Node::GetEntry(), m_lCache, m_nMaxTaxId, m_ppEntries, NULL, and TAX_ID_TO.
bool COrgRefCache::LookupAndAdd | ( | TTaxId | tax_id, |
CTaxon1Node ** | ppData | ||
) |
Definition at line 114 of file cache.cpp.
References _ASSERT, CTreeIterator::AddChild(), CTaxon1Node, CTreeCont::GetIterator(), CTreeIterator::GetNode(), CTaxon1Node::GetTaxId(), CTreeIterator::GoNode(), i, CTaxon1_resp_Base::IsTaxalineage(), m_host, m_nMaxTaxId, m_ppEntries, m_tPartTree, NULL, CTaxon1::SendRequest(), CTaxon1::SetLastError(), CTaxon1_req_Base::SetTaxalineage(), CTaxon1_resp_Base::SetTaxalineage(), and TAX_ID_TO.
Referenced by CTaxon1::GetAncestorByRank(), CTaxon1::GetBlastName(), CTaxon1::GetChildren(), CTaxon1::GetDisplayCommonName(), CTaxon1::GetGenus(), CTaxon1::GetParent(), CTaxon1::GetPopsetJoin(), CTaxon1::GetScientificName(), CTaxon1::GetSpecies(), CTaxon1::GetSuperkingdom(), CTaxon1::GetTreeIterator(), CTaxon1::GetTypeMaterial(), CTaxon1::Join(), CTaxon1::LoadSubtreeEx(), and LookupAndInsert().
bool COrgRefCache::LookupAndInsert | ( | TTaxId | tax_id, |
CTaxon2_data ** | ppData | ||
) |
Definition at line 181 of file cache.cpp.
References COrgRefCache::SCacheEntry::GetData(), CTaxon1Node::GetEntry(), Insert2(), LookupAndAdd(), m_lCache, and NULL.
Referenced by CTaxon1::GetById(), CTaxon1::GetOrgRef(), and CTaxon1::GetSpecies().
|
private |
void COrgRefCache::SetIndexEntry | ( | int | id, |
CTaxon1Node * | pNode | ||
) |
Definition at line 521 of file cache.cpp.
References m_ppEntries.
Referenced by CTaxon1::GetChildren(), Init(), and CTaxon1::LoadSubtreeEx().
|
friend |
Definition at line 126 of file cache.hpp.
Referenced by Init(), and LookupAndAdd().
|
private |
Definition at line 171 of file cache.hpp.
Referenced by FindDivisionByCode(), FindDivisionByName(), GetDivisionCode(), GetDivisionName(), and InitDivisions().
|
private |
Definition at line 137 of file cache.hpp.
Referenced by Init(), InitDomain(), InitNameClasses(), InitRanks(), Insert2(), and LookupAndAdd().
|
private |
Definition at line 144 of file cache.hpp.
Referenced by Insert2(), Lookup(), LookupAndInsert(), and ~COrgRefCache().
|
private |
|
private |
Definition at line 161 of file cache.hpp.
Referenced by GetCommonNameClass(), and InitNameClasses().
|
private |
Definition at line 160 of file cache.hpp.
Referenced by GetPreferredCommonNameClass(), and InitNameClasses().
|
private |
Definition at line 166 of file cache.hpp.
Referenced by FindNameClassByName(), GetNameClassName(), and InitNameClasses().
|
private |
Definition at line 148 of file cache.hpp.
Referenced by GetGenusRank(), and InitRanks().
|
private |
Definition at line 139 of file cache.hpp.
Referenced by CTaxon1::GetMaxTaxId(), Init(), Lookup(), and LookupAndAdd().
|
private |
Definition at line 149 of file cache.hpp.
Referenced by GetSpeciesRank(), and InitRanks().
|
private |
Definition at line 150 of file cache.hpp.
Referenced by GetSubspeciesRank(), and InitRanks().
|
private |
Definition at line 147 of file cache.hpp.
Referenced by GetSuperkingdomRank(), and InitRanks().
|
private |
Definition at line 140 of file cache.hpp.
Referenced by Init(), Lookup(), LookupAndAdd(), SetIndexEntry(), and ~COrgRefCache().
|
private |
Definition at line 154 of file cache.hpp.
Referenced by FindRankByName(), GetRankName(), and InitRanks().
|
private |
Definition at line 141 of file cache.hpp.
Referenced by GetTree(), Init(), and LookupAndAdd().