NCBI C++ ToolKit
Public Types | Public Member Functions | Static Public Attributes | Private Types | Private Member Functions | Private Attributes | Friends | List of all members
CTaxon1 Class Reference

Search Toolkit Book for CTaxon1

#include <objects/taxon1/taxon1.hpp>

+ Collaboration diagram for CTaxon1:

Public Types

enum  EOrgRefStatus {
  eStatus_Ok = COrg_ref::eOrgref_nothing , eStatus_WrongTaxId = COrg_ref::eOrgref_db_taxid , eStatus_NoOrgname = COrg_ref::eOrgref_orgname , eStatus_WrongTaxname = COrg_ref::eOrgref_taxname ,
  eStatus_WrongOrgrefMod = COrg_ref::eOrgref_mod , eStatus_WrongCommonName = COrg_ref::eOrgref_common , eStatus_WrongOrgname = COrg_ref::eOrgref_on_name , eStatus_WrongOrgmod = COrg_ref::eOrgref_on_mod ,
  eStatus_WrongLineage = COrg_ref::eOrgref_on_lin , eStatus_WrongDivision = COrg_ref::eOrgref_on_div , eStatus_WrongGC = COrg_ref::eOrgref_on_gc , eStatus_WrongMGC = COrg_ref::eOrgref_on_mgc ,
  eStatus_WrongPGC = COrg_ref::eOrgref_on_pgc , eStatus_WrongOrgnameAttr = COrg_ref::eOrgref_on_attr , eStatus_WrongONASpecified = COrg_ref::eOrgref_on_attr_spec , eStatus_WrongONANoModFwd = COrg_ref::eOrgref_on_attr_nofwd ,
  eStatus_WrongONAUncultured = COrg_ref::eOrgref_on_attr_uncult , eStatus_WrongNomenclature = COrg_ref::eOrgref_on_mod_nom , eStatus_WrongModOldname = COrg_ref::eOrgref_on_mod_oldname , eStatus_WrongModTypeMaterial = COrg_ref::eOrgref_on_mod_tm
}
 
enum  ESearch { eSearch_Exact , eSearch_TokenSet , eSearch_WildCard , eSearch_Phonetic }
 
enum  ESpeciesMode { eSpeciesMode_RankOnly , eSpeciesMode_Flag }
 
enum  EIteratorMode {
  eIteratorMode_FullTree , eIteratorMode_LeavesBranches , eIteratorMode_Best , eIteratorMode_Blast ,
  eIteratorMode_Default = eIteratorMode_FullTree
}
 
typedef list< stringTNameList
 
typedef vector< TTaxIdTTaxIdList
 
typedef list< CRef< CTaxon1_info > > TInfoList
 
typedef unsigned TOrgRefStatus
 

Public Member Functions

 CTaxon1 ()
 
 ~CTaxon1 ()
 
bool Init (void)
 
bool Init (unsigned cache_capacity)
 
bool Init (const STimeout *timeout, unsigned reconnect_attempts=def_reconnect_attempts, unsigned cache_capacity=def_cache_capacity)
 
void Fini (void)
 
CRef< CTaxon2_dataGetById (TTaxId tax_id)
 
bool GetScientificName (TTaxId tax_id, string &name_out)
 
CRef< CTaxon2_dataLookup (const COrg_ref &inp_orgRef, string *psLog=0)
 
CConstRef< CTaxon2_dataLookupMerge (COrg_ref &inp_orgRef, string *psLog=0, TOrgRefStatus *pStatusOut=0)
 
TTaxId GetTaxIdByOrgRef (const COrg_ref &inp_orgRef)
 
bool CheckOrgRef (const COrg_ref &orgRef, TOrgRefStatus &stat_out, string *psLog=0)
 
TTaxId GetTaxIdByName (const string &orgname)
 
TTaxId FindTaxIdByName (const string &orgname)
 
TTaxId SearchTaxIdByName (const string &orgname, ESearch mode=eSearch_TokenSet, list< CRef< CTaxon1_name > > *name_list_out=NULL)
 
int GetAllTaxIdByName (const string &orgname, TTaxIdList &lIds)
 
CConstRef< COrg_refGetOrgRef (TTaxId tax_id, bool &is_species, bool &is_uncultured, string &blast_name, bool *is_specified=NULL)
 
bool SetSynonyms (bool on_off)
 
TTaxId GetParent (TTaxId id_tax)
 
TTaxId GetSpecies (TTaxId id_tax, ESpeciesMode mode=eSpeciesMode_Flag)
 
TTaxId GetGenus (TTaxId id_tax)
 
TTaxId GetSuperkingdom (TTaxId id_tax)
 
TTaxId GetAncestorByRank (TTaxId id_tax, const char *rank_name)
 
TTaxId GetAncestorByRank (TTaxId id_tax, TTaxRank rank_id)
 
int GetChildren (TTaxId id_tax, TTaxIdList &children_ids)
 
bool GetGCName (TTaxGeneticCode gc_id, string &gc_name_out)
 
bool GetRankName (TTaxRank rank_id, string &rank_name_out)
 
TTaxRank GetRankIdByName (const string &rank_name)
 
bool GetDivisionName (TTaxDivision div_id, string &div_name_out, string *div_code_out=NULL)
 
TTaxDivision GetDivisionIdByName (const string &div_name)
 
bool GetNameClass (TTaxNameClass nameclass_id, string &class_name_out)
 
TTaxNameClass GetNameClassId (const string &class_name)
 
TTaxId Join (TTaxId taxid1, TTaxId taxid2)
 
int GetAllNames (TTaxId tax_id, TNameList &lNames, bool unique)
 
bool GetAllNamesEx (TTaxId tax_id, list< CRef< CTaxon1_name > > &lNames)
 
bool DumpNames (TTaxNameClass name_class, list< CRef< CTaxon1_name > > &out)
 
bool IsAlive (void)
 
bool GetTaxId4GI (TGi gi, TTaxId &tax_id_out)
 
bool GetBlastName (TTaxId tax_id, string &blast_name_out)
 
const stringGetLastError () const
 
bool GetPopsetJoin (const TTaxIdList &ids_in, TTaxIdList &ids_out)
 
bool LoadNode (TTaxId tax_id, const ITaxon1Node **ppNode=NULL)
 
bool LoadChildren (TTaxId tax_id, const ITaxon1Node **ppNode=NULL)
 
bool LoadSubtree (TTaxId tax_id, const ITaxon1Node **ppNode=NULL)
 
CRef< ITreeIteratorGetTreeIterator (EIteratorMode mode=eIteratorMode_Default)
 
CRef< ITreeIteratorGetTreeIterator (TTaxId tax_id, EIteratorMode mode=eIteratorMode_Default)
 
bool GetNodeProperty (TTaxId tax_id, const string &prop_name, bool &prop_val)
 
bool GetNodeProperty (TTaxId tax_id, const string &prop_name, int &prop_val)
 
bool GetNodeProperty (TTaxId tax_id, const string &prop_name, string &prop_val)
 
bool GetInheritedPropertyDefines (const string &prop_name, TInfoList &results_out, TTaxId subtree_root=TAX_ID_CONST(1))
 
bool GetTypeMaterial (TTaxId tax_id, TNameList &type_material_list_out)
 
TTaxId GetMaxTaxId (void)
 
bool GetDisplayCommonName (TTaxId tax_id, string &disp_name_out)
 

Static Public Attributes

static const unsigned def_reconnect_attempts = 5
 
static const unsigned def_cache_capacity = 1000
 

Private Types

typedef map< TTaxGeneticCode, stringTGCMap
 

Private Member Functions

void Reset (void)
 
bool SendRequest (CTaxon1_req &req, CTaxon1_resp &resp, bool bShouldReconnect=true)
 
void SetLastError (const char *err_msg)
 
bool LoadSubtreeEx (TTaxId tax_id, int type, const ITaxon1Node **ppNode)
 
TOrgRefStatus x_ConvertOrgrefProps (CTaxon2_data &data)
 

Private Attributes

ESerialDataFormat m_eDataFormat
 
const char * m_pchService
 
STimeoutm_timeout
 
STimeout m_timeout_value
 
CConn_ServiceStreamm_pServer
 
CObjectOStreamm_pOut
 
CObjectIStreamm_pIn
 
unsigned m_nReconnectAttempts
 
COrgRefCachem_plCache
 
bool m_bWithSynonyms
 
string m_sLastError
 
TGCMap m_gcStorage
 

Friends

class COrgRefCache
 

Detailed Description

Definition at line 67 of file taxon1.hpp.

Member Typedef Documentation

◆ TGCMap

Definition at line 610 of file taxon1.hpp.

◆ TInfoList

typedef list< CRef< CTaxon1_info > > CTaxon1::TInfoList

Definition at line 71 of file taxon1.hpp.

◆ TNameList

typedef list< string > CTaxon1::TNameList

Definition at line 69 of file taxon1.hpp.

◆ TOrgRefStatus

typedef unsigned CTaxon1::TOrgRefStatus

Definition at line 113 of file taxon1.hpp.

◆ TTaxIdList

typedef vector< TTaxId > CTaxon1::TTaxIdList

Definition at line 70 of file taxon1.hpp.

Member Enumeration Documentation

◆ EIteratorMode

Enumerator
eIteratorMode_FullTree 
eIteratorMode_LeavesBranches 
eIteratorMode_Best 
eIteratorMode_Blast 
eIteratorMode_Default 

Definition at line 510 of file taxon1.hpp.

◆ EOrgRefStatus

Enumerator
eStatus_Ok 
eStatus_WrongTaxId 
eStatus_NoOrgname 
eStatus_WrongTaxname 
eStatus_WrongOrgrefMod 
eStatus_WrongCommonName 
eStatus_WrongOrgname 
eStatus_WrongOrgmod 
eStatus_WrongLineage 
eStatus_WrongDivision 
eStatus_WrongGC 
eStatus_WrongMGC 
eStatus_WrongPGC 
eStatus_WrongOrgnameAttr 
eStatus_WrongONASpecified 
eStatus_WrongONANoModFwd 
eStatus_WrongONAUncultured 
eStatus_WrongNomenclature 
eStatus_WrongModOldname 
eStatus_WrongModTypeMaterial 

Definition at line 152 of file taxon1.hpp.

◆ ESearch

Enumerator
eSearch_Exact 
eSearch_TokenSet 
eSearch_WildCard 
eSearch_Phonetic 

Definition at line 181 of file taxon1.hpp.

◆ ESpeciesMode

Enumerator
eSpeciesMode_RankOnly 
eSpeciesMode_Flag 

Definition at line 270 of file taxon1.hpp.

Constructor & Destructor Documentation

◆ CTaxon1()

CTaxon1::CTaxon1 ( )

Definition at line 60 of file taxon1.cpp.

◆ ~CTaxon1()

CTaxon1::~CTaxon1 ( )

Definition at line 71 of file taxon1.cpp.

References Fini().

Member Function Documentation

◆ CheckOrgRef()

bool CTaxon1::CheckOrgRef ( const COrg_ref orgRef,
TOrgRefStatus stat_out,
string psLog = 0 
)

◆ DumpNames()

bool CTaxon1::DumpNames ( TTaxNameClass  name_class,
list< CRef< CTaxon1_name > > &  out 
)

◆ FindTaxIdByName()

TTaxId CTaxon1::FindTaxIdByName ( const string orgname)

◆ Fini()

void CTaxon1::Fini ( void  )

◆ GetAllNames()

int CTaxon1::GetAllNames ( TTaxId  tax_id,
TNameList lNames,
bool  unique 
)

◆ GetAllNamesEx()

bool CTaxon1::GetAllNamesEx ( TTaxId  tax_id,
list< CRef< CTaxon1_name > > &  lNames 
)

◆ GetAllTaxIdByName()

int CTaxon1::GetAllTaxIdByName ( const string orgname,
TTaxIdList lIds 
)

◆ GetAncestorByRank() [1/2]

TTaxId CTaxon1::GetAncestorByRank ( TTaxId  id_tax,
const char *  rank_name 
)

◆ GetAncestorByRank() [2/2]

TTaxId CTaxon1::GetAncestorByRank ( TTaxId  id_tax,
TTaxRank  rank_id 
)

◆ GetBlastName()

bool CTaxon1::GetBlastName ( TTaxId  tax_id,
string blast_name_out 
)

◆ GetById()

CRef< CTaxon2_data > CTaxon1::GetById ( TTaxId  tax_id)

◆ GetChildren()

int CTaxon1::GetChildren ( TTaxId  id_tax,
TTaxIdList children_ids 
)

◆ GetDisplayCommonName()

bool CTaxon1::GetDisplayCommonName ( TTaxId  tax_id,
string disp_name_out 
)

◆ GetDivisionIdByName()

TTaxDivision CTaxon1::GetDivisionIdByName ( const string div_name)

◆ GetDivisionName()

bool CTaxon1::GetDivisionName ( TTaxDivision  div_id,
string div_name_out,
string div_code_out = NULL 
)

◆ GetGCName()

bool CTaxon1::GetGCName ( TTaxGeneticCode  gc_id,
string gc_name_out 
)

◆ GetGenus()

TTaxId CTaxon1::GetGenus ( TTaxId  id_tax)

◆ GetInheritedPropertyDefines()

bool CTaxon1::GetInheritedPropertyDefines ( const string prop_name,
CTaxon1::TInfoList results,
TTaxId  subtree_root = TAX_ID_CONST(1) 
)

◆ GetLastError()

const string& CTaxon1::GetLastError ( void  ) const
inline

◆ GetMaxTaxId()

TTaxId CTaxon1::GetMaxTaxId ( void  )

◆ GetNameClass()

bool CTaxon1::GetNameClass ( TTaxNameClass  nameclass_id,
string class_name_out 
)

◆ GetNameClassId()

TTaxNameClass CTaxon1::GetNameClassId ( const string class_name)

◆ GetNodeProperty() [1/3]

bool CTaxon1::GetNodeProperty ( TTaxId  tax_id,
const string prop_name,
bool prop_val 
)

◆ GetNodeProperty() [2/3]

bool CTaxon1::GetNodeProperty ( TTaxId  tax_id,
const string prop_name,
int prop_val 
)

◆ GetNodeProperty() [3/3]

bool CTaxon1::GetNodeProperty ( TTaxId  tax_id,
const string prop_name,
string prop_val 
)

◆ GetOrgRef()

CConstRef< COrg_ref > CTaxon1::GetOrgRef ( TTaxId  tax_id,
bool is_species,
bool is_uncultured,
string blast_name,
bool is_specified = NULL 
)

◆ GetParent()

TTaxId CTaxon1::GetParent ( TTaxId  id_tax)

◆ GetPopsetJoin()

bool CTaxon1::GetPopsetJoin ( const TTaxIdList ids_in,
TTaxIdList ids_out 
)

◆ GetRankIdByName()

TTaxRank CTaxon1::GetRankIdByName ( const string rank_name)

◆ GetRankName()

bool CTaxon1::GetRankName ( TTaxRank  rank_id,
string rank_name_out 
)

◆ GetScientificName()

bool CTaxon1::GetScientificName ( TTaxId  tax_id,
string name_out 
)

◆ GetSpecies()

TTaxId CTaxon1::GetSpecies ( TTaxId  id_tax,
ESpeciesMode  mode = eSpeciesMode_Flag 
)

◆ GetSuperkingdom()

TTaxId CTaxon1::GetSuperkingdom ( TTaxId  id_tax)

◆ GetTaxId4GI()

bool CTaxon1::GetTaxId4GI ( TGi  gi,
TTaxId tax_id_out 
)

◆ GetTaxIdByName()

TTaxId CTaxon1::GetTaxIdByName ( const string orgname)

◆ GetTaxIdByOrgRef()

TTaxId CTaxon1::GetTaxIdByOrgRef ( const COrg_ref inp_orgRef)

◆ GetTreeIterator() [1/2]

CRef< ITreeIterator > CTaxon1::GetTreeIterator ( CTaxon1::EIteratorMode  mode = eIteratorMode_Default)

◆ GetTreeIterator() [2/2]

CRef< ITreeIterator > CTaxon1::GetTreeIterator ( TTaxId  tax_id,
CTaxon1::EIteratorMode  mode = eIteratorMode_Default 
)

◆ GetTypeMaterial()

bool CTaxon1::GetTypeMaterial ( TTaxId  tax_id,
TNameList type_material_list_out 
)

◆ Init() [1/3]

bool CTaxon1::Init ( const STimeout timeout,
unsigned  reconnect_attempts = def_reconnect_attempts,
unsigned  cache_capacity = def_cache_capacity 
)

◆ Init() [2/3]

bool CTaxon1::Init ( unsigned  cache_capacity)

Definition at line 107 of file taxon1.cpp.

References def_reconnect_attempts, def_timeout, and Init().

◆ Init() [3/3]

bool CTaxon1::Init ( void  )

◆ IsAlive()

bool CTaxon1::IsAlive ( void  )

◆ Join()

TTaxId CTaxon1::Join ( TTaxId  taxid1,
TTaxId  taxid2 
)

◆ LoadChildren()

bool CTaxon1::LoadChildren ( TTaxId  tax_id,
const ITaxon1Node **  ppNode = NULL 
)
inline

Definition at line 498 of file taxon1.hpp.

References LoadSubtreeEx().

◆ LoadNode()

bool CTaxon1::LoadNode ( TTaxId  tax_id,
const ITaxon1Node **  ppNode = NULL 
)
inline

◆ LoadSubtree()

bool CTaxon1::LoadSubtree ( TTaxId  tax_id,
const ITaxon1Node **  ppNode = NULL 
)
inline

Definition at line 507 of file taxon1.hpp.

References LoadSubtreeEx().

◆ LoadSubtreeEx()

bool CTaxon1::LoadSubtreeEx ( TTaxId  tax_id,
int  type,
const ITaxon1Node **  ppNode 
)
private

◆ Lookup()

CRef< CTaxon2_data > CTaxon1::Lookup ( const COrg_ref inp_orgRef,
string psLog = 0 
)

◆ LookupMerge()

CConstRef< CTaxon2_data > CTaxon1::LookupMerge ( COrg_ref inp_orgRef,
string psLog = 0,
TOrgRefStatus pStatusOut = 0 
)

◆ Reset()

void CTaxon1::Reset ( void  )
private

Definition at line 78 of file taxon1.cpp.

References m_pIn, m_plCache, m_pOut, m_pServer, NULL, and SetLastError().

Referenced by Fini().

◆ SearchTaxIdByName()

TTaxId CTaxon1::SearchTaxIdByName ( const string orgname,
ESearch  mode = eSearch_TokenSet,
list< CRef< CTaxon1_name > > *  name_list_out = NULL 
)

◆ SendRequest()

bool CTaxon1::SendRequest ( CTaxon1_req req,
CTaxon1_resp resp,
bool  bShouldReconnect = true 
)
private

◆ SetLastError()

void CTaxon1::SetLastError ( const char *  err_msg)
private

◆ SetSynonyms()

bool CTaxon1::SetSynonyms ( bool  on_off)

Definition at line 746 of file taxon1.cpp.

References m_bWithSynonyms, NULL, and SetLastError().

Referenced by fix_synonyms(), and TaxClient::SetSynonyms().

◆ x_ConvertOrgrefProps()

CTaxon1::TOrgRefStatus CTaxon1::x_ConvertOrgrefProps ( CTaxon2_data data)
private

Friends And Related Function Documentation

◆ COrgRefCache

friend class COrgRefCache
friend

Definition at line 591 of file taxon1.hpp.

Referenced by Init().

Member Data Documentation

◆ def_cache_capacity

const unsigned CTaxon1::def_cache_capacity = 1000
static

Definition at line 84 of file taxon1.hpp.

Referenced by Init().

◆ def_reconnect_attempts

const unsigned CTaxon1::def_reconnect_attempts = 5
static

Definition at line 83 of file taxon1.hpp.

Referenced by Init().

◆ m_bWithSynonyms

bool CTaxon1::m_bWithSynonyms
private

Definition at line 607 of file taxon1.hpp.

Referenced by COrgRefCache::Insert2(), Lookup(), LookupMerge(), and SetSynonyms().

◆ m_eDataFormat

ESerialDataFormat CTaxon1::m_eDataFormat
private

Definition at line 593 of file taxon1.hpp.

Referenced by Init(), and SendRequest().

◆ m_gcStorage

TGCMap CTaxon1::m_gcStorage
private

Definition at line 611 of file taxon1.hpp.

Referenced by GetGCName().

◆ m_nReconnectAttempts

unsigned CTaxon1::m_nReconnectAttempts
private

Definition at line 603 of file taxon1.hpp.

Referenced by Init(), and SendRequest().

◆ m_pchService

const char* CTaxon1::m_pchService
private

Definition at line 594 of file taxon1.hpp.

Referenced by Init(), and SendRequest().

◆ m_pIn

CObjectIStream* CTaxon1::m_pIn
private

Definition at line 601 of file taxon1.hpp.

Referenced by Init(), IsAlive(), Reset(), and SendRequest().

◆ m_plCache

COrgRefCache* CTaxon1::m_plCache
private

◆ m_pOut

CObjectOStream* CTaxon1::m_pOut
private

Definition at line 600 of file taxon1.hpp.

Referenced by Init(), IsAlive(), Reset(), and SendRequest().

◆ m_pServer

CConn_ServiceStream* CTaxon1::m_pServer
private

Definition at line 598 of file taxon1.hpp.

Referenced by Init(), Reset(), and SendRequest().

◆ m_sLastError

string CTaxon1::m_sLastError
private

Definition at line 608 of file taxon1.hpp.

Referenced by GetLastError(), and SetLastError().

◆ m_timeout

STimeout* CTaxon1::m_timeout
private

Definition at line 595 of file taxon1.hpp.

Referenced by Init(), and SendRequest().

◆ m_timeout_value

STimeout CTaxon1::m_timeout_value
private

Definition at line 596 of file taxon1.hpp.

Referenced by Init().


The documentation for this class was generated from the following files:
Modified on Sun Jun 16 04:30:03 2024 by modify_doxy.py rev. 669887