NCBI C++ ToolKit
seq_id_tree.hpp
Go to the documentation of this file.

Go to the SVN repository for this file.

1 #ifndef OBJECTS_OBJMGR___SEQ_ID_TREE__HPP
2 #define OBJECTS_OBJMGR___SEQ_ID_TREE__HPP
3 
4 /* $Id: seq_id_tree.hpp 99036 2023-02-06 21:49:17Z vasilche $
5 * ===========================================================================
6 *
7 * PUBLIC DOMAIN NOTICE
8 * National Center for Biotechnology Information
9 *
10 * This software/database is a "United States Government Work" under the
11 * terms of the United States Copyright Act. It was written as part of
12 * the author's official duties as a United States Government employee and
13 * thus cannot be copyrighted. This software/database is freely available
14 * to the public for use. The National Library of Medicine and the U.S.
15 * Government have not placed any restriction on its use or reproduction.
16 *
17 * Although all reasonable efforts have been taken to ensure the accuracy
18 * and reliability of the software and data, the NLM and the U.S.
19 * Government do not and cannot warrant the performance or results that
20 * may be obtained by using this software or data. The NLM and the U.S.
21 * Government disclaim all warranties, express or implied, including
22 * warranties of performance, merchantability or fitness for any particular
23 * purpose.
24 *
25 * Please cite the author in any work or product based on this material.
26 *
27 * ===========================================================================
28 *
29 * Author: Aleksey Grichenko, Eugene Vasilchenko
30 *
31 * File Description:
32 * Seq-id mapper for Object Manager
33 *
34 */
35 
36 #include <corelib/ncbiobj.hpp>
37 #include <corelib/ncbimtx.hpp>
38 #include <corelib/ncbistr.hpp>
39 #include <corelib/ncbi_limits.hpp>
40 
41 #include <objects/general/Date.hpp>
45 
47 
54 
56 
57 #include <vector>
58 #include <set>
59 #include <map>
60 #include <unordered_map>
61 
64 
65 
66 class CSeq_id;
67 class CSeq_id_Handle;
68 class CSeq_id_Info;
69 class CSeq_id_Mapper;
70 class CSeq_id_Which_Tree;
71 
72 struct PHashNocase {
73  static char get_hash(char c)
74  {
75  // In ids only ASCII characters are allowed, and in ASCII
76  // upper and lower cases differ only by one bit.
77  // So for efficiency it's enough to reset that bit
78  // instead of using more complex tolower().
79  return c&~32;
80  //return tolower(c);
81  }
82  size_t operator()(const string& s) const
83  {
84  size_t h = s.size();
85  for ( auto c : s )
86  h = h*17 + get_hash(c);
87  return h;
88  }
89 };
90 struct PEqualNocase {
91  bool operator()(const string& s1, const string& s2) const
92  {
93  // in most cases letter cases match,
94  // so it's faster first to check that
95  // with more efficient direct string comparison
96  if ( s1 == s2 ) {
97  return true;
98  }
99  // otherwise we first check if lengths are the same
100  size_t len = s1.size();
101  if ( s2.size() != len ) {
102  return false;
103  }
104  for ( size_t i = 0; i < len; ++i ) {
105  char c1 = s1[i];
106  char c2 = s2[i];
107  if ( tolower((unsigned char)c1) != tolower((unsigned char)c2) ) {
108  return false;
109  }
110  }
111  return true;
112  // commented out old less efficient comparison
113  //return NStr::EqualNocase(s1, s2);
114  }
115 };
116 
117 ////////////////////////////////////////////////////////////////////
118 //
119 // CSeq_id_***_Tree::
120 //
121 // Seq-id sub-type specific trees
122 //
123 
124 
125 // Base class for seq-id type-specific trees
127 {
128 public:
129  // 'ctors
131  virtual ~CSeq_id_Which_Tree(void);
132 
133  static void Initialize(CSeq_id_Mapper* mapper,
134  vector<CRef<CSeq_id_Which_Tree> >& v);
135 
136  virtual bool Empty(void) const = 0;
137 
138  // Find exaclty the same seq-id
139  virtual CSeq_id_Handle FindInfo(const CSeq_id& id) const = 0;
140  virtual CSeq_id_Handle FindOrCreate(const CSeq_id& id) = 0;
141  virtual CSeq_id_Handle GetGiHandle(TGi gi);
142 
143  virtual void DropInfo(const CSeq_id_Info* info);
144 
146 
147  // Get the list of matching seq-id.
148  virtual bool HaveMatch(const CSeq_id_Handle& id) const;
149  virtual void FindMatch(const CSeq_id_Handle& id,
150  TSeq_id_MatchList& id_list) const;
151  virtual void FindMatchStr(const string& sid,
152  TSeq_id_MatchList& id_list) const = 0;
153 
154  // returns true if FindMatch(h1, id_list) will put h2 in id_list.
155  virtual bool Match(const CSeq_id_Handle& h1,
156  const CSeq_id_Handle& h2) const;
157 
158  virtual bool IsBetterVersion(const CSeq_id_Handle& h1,
159  const CSeq_id_Handle& h2) const;
160 
161  // Reverse matching
162  virtual bool HaveReverseMatch(const CSeq_id_Handle& id) const;
163  virtual void FindReverseMatch(const CSeq_id_Handle& id,
164  TSeq_id_MatchList& id_list);
165 
166  virtual size_t Dump(CNcbiOstream& out,
168  int details) const = 0;
169 
170 protected:
171  friend class CSeq_id_Mapper;
172 
174 
176  CSeq_id_Info* CreateInfo(const CSeq_id& id);
177 
178  static const CSeq_id_Info* GetInfo(const CSeq_id_Handle& id)
179  {
180  return id.m_Info;
181  }
182  static const CSeq_id* GetSeqId(const CSeq_id_Info* info)
183  {
184  return info->m_Seq_id.GetPointerOrNull();
185  }
186  virtual void x_Unindex(const CSeq_id_Info* info) = 0;
187 
191 
194 
195 private:
198 };
199 
200 
201 
202 ////////////////////////////////////////////////////////////////////
203 // not-set tree (maximum 1 entry allowed)
204 
205 
207 {
208 public:
210  ~CSeq_id_not_set_Tree(void);
211 
212  virtual bool Empty(void) const;
213 
214  virtual CSeq_id_Handle FindInfo(const CSeq_id& id) const;
215  virtual CSeq_id_Handle FindOrCreate(const CSeq_id& id);
216 
217  virtual void DropInfo(const CSeq_id_Info* info);
218 
219  virtual void FindMatch(const CSeq_id_Handle& id,
220  TSeq_id_MatchList& id_list) const;
221  virtual void FindMatchStr(const string& sid,
222  TSeq_id_MatchList& id_list) const;
223  virtual void FindReverseMatch(const CSeq_id_Handle& id,
224  TSeq_id_MatchList& id_list);
225 
226  virtual size_t Dump(CNcbiOstream& out,
228  int details) const;
229 
230 protected:
231  virtual void x_Unindex(const CSeq_id_Info* info);
232  bool x_Check(const CSeq_id& id) const;
233 };
234 
235 
236 ////////////////////////////////////////////////////////////////////
237 // Base class for Gi, Gibbsq & Gibbmt trees
238 
239 
241 {
242 public:
244  ~CSeq_id_int_Tree(void);
245 
246  virtual bool Empty(void) const;
247 
248  virtual CSeq_id_Handle FindInfo(const CSeq_id& id) const;
249  virtual CSeq_id_Handle FindOrCreate(const CSeq_id& id);
250 
251  virtual void FindMatchStr(const string& sid,
252  TSeq_id_MatchList& id_list) const;
253 
254  virtual size_t Dump(CNcbiOstream& out,
256  int details) const;
257 
258 protected:
259  virtual void x_Unindex(const CSeq_id_Info* info);
260  virtual bool x_Check(const CSeq_id& id) const = 0;
261  virtual TPacked x_Get(const CSeq_id& id) const = 0;
262 
263 private:
266 };
267 
268 
269 ////////////////////////////////////////////////////////////////////
270 // Gibbsq tree
271 
272 
274 {
275 public:
277 protected:
278  virtual bool x_Check(const CSeq_id& id) const;
279  virtual TPacked x_Get(const CSeq_id& id) const;
280 };
281 
282 
283 ////////////////////////////////////////////////////////////////////
284 // Gibbmt tree
285 
286 
288 {
289 public:
291 protected:
292  virtual bool x_Check(const CSeq_id& id) const;
293  virtual TPacked x_Get(const CSeq_id& id) const;
294 };
295 
296 
297 ////////////////////////////////////////////////////////////////////
298 // Gi tree
299 
300 
302 {
303 public:
305 
306  CConstRef<CSeq_id> GetPackedSeqId(TPacked packed, TVariant /*variant*/) const override;
307 };
308 
309 
311 {
312 public:
314  ~CSeq_id_Gi_Tree(void);
315 
316  virtual bool Empty(void) const;
317 
318  virtual CSeq_id_Handle FindInfo(const CSeq_id& id) const;
319  virtual CSeq_id_Handle FindOrCreate(const CSeq_id& id);
320  virtual CSeq_id_Handle GetGiHandle(TGi gi);
321 
322  virtual void FindMatchStr(const string& sid,
323  TSeq_id_MatchList& id_list) const;
324 
325  virtual size_t Dump(CNcbiOstream& out,
327  int details) const;
328 
329 protected:
330  virtual void x_Unindex(const CSeq_id_Info* info);
331  bool x_Check(const CSeq_id& id) const;
332  TGi x_Get(const CSeq_id& id) const;
333 
336 };
337 
338 
339 ////////////////////////////////////////////////////////////////////
340 // Base class for e_Genbank, e_Embl, e_Pir, e_Swissprot, e_Other,
341 // e_Ddbj, e_Prf, e_Tpg, e_Tpe, e_Tpd trees
342 
343 
345 {
346 public:
348 
349  CConstRef<CSeq_id> GetPackedSeqId(TPacked packed, TVariant variant) const override;
350 
351  TVariant ParseCaseVariant(const string& acc) const;
352  TVariant ParseCaseVariant(const CTextseq_id& id) const;
353 };
354 
355 
357 public:
359 
360  struct TKey {
361  TKey(void)
362  : m_Hash(0), m_Version(0)
363  {
364  }
365 
366  unsigned m_Hash;
369  enum {
370  kMaxPrefixLen = 7
371  };
373 
375 
376  bool operator==(const TKey& b) const {
377  return m_Hash == b.m_Hash && m_Version == b.m_Version &&
378  NStr::EqualNocase(GetAccPrefix(), b.GetAccPrefix());
379  }
380  bool operator!=(const TKey& b) const {
381  return !(*this == b);
382  }
383  bool operator<(const TKey& b) const {
384  return m_Hash < b.m_Hash ||
385  (m_Hash == b.m_Hash &&
386  (m_Version < b.m_Version ||
387  (m_Version == b.m_Version &&
388  NStr::CompareNocase(GetAccPrefix(), b.GetAccPrefix()) < 0)));
389  }
390 
391  bool SameHash(const TKey& b) const {
392  return m_Hash == b.m_Hash;
393  }
394  bool SameHashNoVer(const TKey& b) const {
395  return ((m_Hash ^ b.m_Hash) & ~1) == 0;
396  }
397  bool EqualAcc(const TKey& b) const {
398  return SameHashNoVer(b) &&
399  NStr::EqualNocase(GetAccPrefix(), b.GetAccPrefix());
400  }
401 
402  bool IsSetVersion(void) const {
403  return (m_Hash & 1) != 0;
404  }
405  const TVersion& GetVersion(void) const {
407  return m_Version;
408  }
409  void ResetVersion(void) {
410  m_Hash &= ~1;
411  m_Version = 0;
412  }
414  m_Hash |= 1;
415  m_Version = version;
416  }
417  int GetAccDigits(void) const {
418  return (m_Hash & 0xff) >> 1;
419  }
420  TVariant ParseCaseVariant(const string& acc) const;
421 
422  size_t GetPrefixLen() const {
423  return m_PrefixLen;
424  }
425  CTempString GetAccPrefix(void) const {
427  }
428  };
430  CSeq_id_Mapper* mapper,
431  const TKey& key);
432  ~CSeq_id_Textseq_Info(void);
433 
434  const TKey& GetKey(void) const {
435  return m_Key;
436  }
437  CTempString GetAccPrefix(void) const {
438  return m_Key.GetAccPrefix();
439  }
440  bool GoodPrefix(const CTempString& acc) const {
442  }
443  int GetAccDigits(void) const {
444  return m_Key.GetAccDigits();
445  }
446  bool IsSetVersion(void) const {
447  return m_Key.IsSetVersion();
448  }
449  const TVersion& GetVersion(void) const {
450  return m_Key.GetVersion();
451  }
452  void RestoreAccession(string& acc, TPacked param, TVariant variant) const;
453  void Restore(CTextseq_id& id, TPacked param, TVariant variant) const;
454 
455  static TKey ParseAcc(const string& acc, const TVersion* ver);
456  static TKey ParseAcc(const string& acc, const CTextseq_id& tid) {
457  TVersion ver;
458  const TVersion *ver_ptr = 0;
459  if ( tid.IsSetVersion() ) {
460  ver = tid.GetVersion();
461  ver_ptr = &ver;
462  }
463  return ParseAcc(acc, ver_ptr);
464  }
465  static TPacked Pack(const TKey& key, const string& acc);
466  static TPacked Pack(const TKey& key, const CTextseq_id& id);
467  static TVariant ParseCaseVariant(const CSeq_id_Info* info, const string& acc);
468 
469  CConstRef<CSeq_id> GetPackedSeqId(TPacked packed, TVariant variant) const override;
470 
471  int CompareOrdered(const CSeq_id_Info& other, const CSeq_id_Handle& h_this, const CSeq_id_Handle& h_other) const override;
472 
473 private:
475 };
476 
477 
479 {
480 public:
482 
484  ~CSeq_id_Textseq_Tree(void);
485 
486  virtual bool Empty(void) const;
487 
488  virtual CSeq_id_Handle FindInfo(const CSeq_id& id) const;
489  virtual CSeq_id_Handle FindOrCreate(const CSeq_id& id);
490 
491  virtual bool HaveMatch(const CSeq_id_Handle& id) const;
492  virtual void FindMatch(const CSeq_id_Handle& id,
493  TSeq_id_MatchList& id_list) const;
494  virtual void FindMatchStr(const string& sid,
495  TSeq_id_MatchList& id_list) const;
496 
497  virtual bool Match(const CSeq_id_Handle& h1,
498  const CSeq_id_Handle& h2) const;
499  virtual bool IsBetterVersion(const CSeq_id_Handle& h1,
500  const CSeq_id_Handle& h2) const;
501 
502  virtual bool HaveReverseMatch(const CSeq_id_Handle& id) const;
503  virtual void FindReverseMatch(const CSeq_id_Handle& id,
504  TSeq_id_MatchList& id_list);
505 
506  virtual size_t Dump(CNcbiOstream& out,
508  int details) const;
509 
510 protected:
511  virtual void x_Unindex(const CSeq_id_Info* info);
512  virtual bool x_Check(const CSeq_id::E_Choice& type) const;
513  virtual bool x_Check(const CSeq_id& id) const;
514  const CTextseq_id& x_Get(const CSeq_id& id) const {
515  const CTextseq_id* text_id = id.GetTextseq_Id();
516  _ASSERT(text_id);
517  return *text_id;
518  }
520  const CTextseq_id& tid) const;
521  bool x_GetVersion(TVersion& version, const CSeq_id_Handle& id) const;
522 
523 private:
527  typedef pair<TStringMapCI, TStringMapCI> TVersions;
533 
534  static bool x_Equals(const CTextseq_id& id1, const CTextseq_id& id2);
535  static void x_Erase(TStringMap& str_map,
536  const string& key,
537  const CSeq_id_Info* info);
538 
540  const string& str,
542  const CTextseq_id& tid) const;
543 
544  void x_FindMatchByAcc(TSeq_id_MatchList& id_list,
545  const string& acc,
546  const TVersion* ver = 0) const;
548  const string& acc,
549  const CTextseq_id* tid) const {
550  TVersion ver, *ver_ptr = 0;
551  if ( tid && tid->IsSetVersion() ) {
552  ver = tid->GetVersion();
553  ver_ptr = &ver;
554  }
555  x_FindMatchByAcc(id_list, acc, ver_ptr);
556  }
557  void x_FindMatchByName(TSeq_id_MatchList& id_list,
558  const string& name,
559  const CTextseq_id* tid = 0) const;
560 
562  const string& acc,
563  const TVersion* ver = 0) const;
565  const string& acc,
566  const TVersion* ver = 0) const;
568  const string& acc,
569  const TVersion* ver = 0) const;
571  const string& acc,
572  const CTextseq_id* tid) const {
573  TVersion ver, *ver_ptr = 0;
574  if ( tid && tid->IsSetVersion() ) {
575  ver = tid->GetVersion();
576  ver_ptr = &ver;
577  }
578  x_FindRevMatchByAcc(id_list, acc, ver_ptr);
579  }
581  const string& name,
582  const CTextseq_id* tid = 0) const;
583 
586  TStringMap m_ByName; // Used for searching by string
588 };
589 
590 
591 ////////////////////////////////////////////////////////////////////
592 // Genbank, EMBL and DDBJ joint tree
593 
594 
596 {
597 public:
599 protected:
600  virtual bool x_Check(const CSeq_id::E_Choice& type) const;
601 };
602 
603 
604 ////////////////////////////////////////////////////////////////////
605 // Pir tree
606 
607 
609 {
610 public:
612 };
613 
614 
615 ////////////////////////////////////////////////////////////////////
616 // Swissprot
617 
618 
620 {
621 public:
623 };
624 
625 
626 ////////////////////////////////////////////////////////////////////
627 // Prf tree
628 
629 
631 {
632 public:
634 };
635 
636 
637 ////////////////////////////////////////////////////////////////////
638 // Tpg tree
639 
640 
642 {
643 public:
645 };
646 
647 
648 ////////////////////////////////////////////////////////////////////
649 // Tpe tree
650 
651 
653 {
654 public:
656 };
657 
658 
659 ////////////////////////////////////////////////////////////////////
660 // Tpd tree
661 
662 
664 {
665 public:
667 };
668 
669 
670 ////////////////////////////////////////////////////////////////////
671 // Gpipe tree
672 
673 
675 {
676 public:
678 };
679 
680 
681 ////////////////////////////////////////////////////////////////////
682 // Named-annot-track tree
683 
684 
686 {
687 public:
689 };
690 
691 
692 ////////////////////////////////////////////////////////////////////
693 // Other tree
694 
695 
697 {
698 public:
700 };
701 
702 
703 ////////////////////////////////////////////////////////////////////
704 // e_Local tree
705 
706 
708 public:
709  CSeq_id_Local_Info(const CObject_id& oid, CSeq_id_Mapper* mapper);
710  ~CSeq_id_Local_Info(void);
711 
712  bool IsId() const {
713  return m_IsId;
714  }
715  bool HasMatchingId() const {
716  return m_HasMatchingId;
717  }
719  return m_MatchingId;
720  }
721 
722  TVariant ParseCaseVariant(const string& str) const;
723  TVariant ParseCaseVariant(const CObject_id& oid) const;
724 
725  CConstRef<CSeq_id> GetPackedSeqId(TPacked packed, TVariant variant) const override;
726 
727 private:
728  bool m_IsId;
731 };
732 
733 
735 {
736 public:
738  ~CSeq_id_Local_Tree(void);
739 
740  virtual bool Empty(void) const;
741 
742  virtual CSeq_id_Handle FindInfo(const CSeq_id& id) const;
743  virtual CSeq_id_Handle FindOrCreate(const CSeq_id& id);
744 
745  // Get the list of matching seq-id (int id = str id).
746  virtual bool HaveMatch(const CSeq_id_Handle& id) const;
747  virtual void FindMatch(const CSeq_id_Handle& id,
748  TSeq_id_MatchList& id_list) const;
749  virtual void FindMatchStr(const string& sid,
750  TSeq_id_MatchList& id_list) const;
751 
752  virtual size_t Dump(CNcbiOstream& out,
754  int details) const;
755 
756 private:
757  virtual void x_Unindex(const CSeq_id_Info* info);
758  CSeq_id_Local_Info* x_FindInfo(const CObject_id& oid) const;
759  CSeq_id_Local_Info* x_FindStrInfo(const string& str) const;
761 
762  typedef unordered_map<string, CSeq_id_Local_Info*, PHashNocase, PEqualNocase> TByStr;
764 
767 };
768 
769 
770 ////////////////////////////////////////////////////////////////////
771 // e_General tree
772 
773 
775 public:
776  typedef string TKey;
777  typedef PNocase PKeyLess;
778 
781 
782  const TKey& GetKey(void) const {
783  return m_Key;
784  }
785  const string& GetDbtag(void) const {
786  return m_Key;
787  }
788  void Restore(CDbtag& id, TPacked param, TVariant variant) const;
789 
790  static TPacked Pack(const TKey& key, const CDbtag& id);
791 
792  CConstRef<CSeq_id> GetPackedSeqId(TPacked packed, TVariant variant) const override;
793 
794  int CompareOrdered(const CSeq_id_Info& other, const CSeq_id_Handle& h_this, const CSeq_id_Handle& h_other) const override;
795 
796 private:
798 };
799 
800 
802 public:
803  struct TKey {
805  string m_Db;
806  string m_StrPrefix;
807  string m_StrSuffix;
808  bool operator==(const TKey& b) const {
809  return m_Key == b.m_Key &&
810  PEqualNocase()(m_StrSuffix, b.m_StrSuffix) &&
811  PEqualNocase()(m_StrPrefix, b.m_StrPrefix) &&
812  PEqualNocase()(m_Db, b.m_Db);
813  }
814  bool operator!=(const TKey& b) const {
815  return !(*this == b);
816  }
817  size_t GetStrDigits(void) const {
818  return m_Key & 0xff;
819  }
820  TVariant ParseCaseVariant(const CDbtag& dbtag) const;
821  };
822  struct PKeyLess {
823  bool operator()(const TKey& a, const TKey& b) const {
824  if ( a.m_Key != b.m_Key ) {
825  return a.m_Key < b.m_Key;
826  }
827  int diff = NStr::CompareNocase(a.m_StrSuffix, b.m_StrSuffix);
828  if ( diff == 0 ) {
829  diff = NStr::CompareNocase(a.m_StrPrefix, b.m_StrPrefix);
830  if ( diff == 0 ) {
831  diff = NStr::CompareNocase(a.m_Db, b.m_Db);
832  }
833  }
834  return diff < 0;
835  }
836  };
837  struct PHash {
838  TPacked operator()(const TKey& a) const {
839  return a.m_Key;
840  }
841  };
842 
843  CSeq_id_General_Str_Info(CSeq_id_Mapper* mapper, const TKey& key);
845 
846  const TKey& GetKey(void) const {
847  return m_Key;
848  }
849  const string& GetDbtag(void) const {
850  return m_Key.m_Db;
851  }
852  const string& GetStrPrefix(void) const {
853  return m_Key.m_StrPrefix;
854  }
855  const string& GetStrSuffix(void) const {
856  return m_Key.m_StrSuffix;
857  }
858  size_t GetStrDigits(void) const {
859  return m_Key.GetStrDigits();
860  }
861  void Restore(CDbtag& id, TPacked param, TVariant variant) const;
862 
863  static TKey Parse(const CDbtag& id);
864  static TPacked Pack(const TKey& key, const CDbtag& id);
865 
866  CConstRef<CSeq_id> GetPackedSeqId(TPacked packed, TVariant variant) const override;
867 
868  int CompareOrdered(const CSeq_id_Info& other, const CSeq_id_Handle& h_this, const CSeq_id_Handle& h_other) const override;
869 
870 private:
871  string x_GetStr(TPacked param) const;
872 
874 };
875 
876 
878 public:
879  CSeq_id_General_PlainInfo(const CDbtag& dbid, CSeq_id_Mapper* mapper);
880 
881  CConstRef<CSeq_id> GetPackedSeqId(TPacked packed, TVariant variant) const override;
882 
883  TVariant ParseCaseVariant(const CDbtag& dbtag) const;
884 };
885 
886 
888 {
889 public:
891  ~CSeq_id_General_Tree(void);
892 
893  virtual bool Empty(void) const;
894 
895  virtual CSeq_id_Handle FindInfo(const CSeq_id& id) const;
896  virtual CSeq_id_Handle FindOrCreate(const CSeq_id& id);
897 
898  // Get the list of matching seq-id (int id = str id).
899  virtual bool HaveMatch(const CSeq_id_Handle& id) const;
900  virtual void FindMatch(const CSeq_id_Handle& id,
901  TSeq_id_MatchList& id_list) const;
902  virtual void FindMatchStr(const string& sid,
903  TSeq_id_MatchList& id_list) const;
904 
905  virtual size_t Dump(CNcbiOstream& out,
907  int details) const;
908 
909 private:
910  virtual void x_Unindex(const CSeq_id_Info* info);
911  CSeq_id_General_PlainInfo* x_FindInfo(const CDbtag& dbid) const;
912 
913  struct STagMap {
914  public:
915  typedef unordered_map<string, CSeq_id_General_PlainInfo*, PHashNocase, PEqualNocase> TByStr;
919  };
925  typedef unordered_map<TPackedStrKey, CConstRef<CSeq_id_General_Str_Info>,
927 
931 };
932 
933 
934 ////////////////////////////////////////////////////////////////////
935 // e_Giim tree
936 
937 
939 {
940 public:
942  ~CSeq_id_Giim_Tree(void);
943 
944  virtual bool Empty(void) const;
945 
946  virtual CSeq_id_Handle FindInfo(const CSeq_id& id) const;
947  virtual CSeq_id_Handle FindOrCreate(const CSeq_id& id);
948 
949  virtual void FindMatchStr(const string& sid,
950  TSeq_id_MatchList& id_list) const;
951 
952  virtual size_t Dump(CNcbiOstream& out,
954  int details) const;
955 
956 private:
957  virtual void x_Unindex(const CSeq_id_Info* info);
958  CSeq_id_Info* x_FindInfo(const CGiimport_id& gid) const;
959 
960  // 2-level indexing: first by Id, second by Db+Release
961  typedef vector<CSeq_id_Info*> TGiimList;
963 
965 };
966 
967 
968 ////////////////////////////////////////////////////////////////////
969 // e_Patent tree
970 
971 
973 {
974 public:
976  ~CSeq_id_Patent_Tree(void);
977 
978  virtual bool Empty(void) const;
979 
980  virtual CSeq_id_Handle FindInfo(const CSeq_id& id) const;
981  virtual CSeq_id_Handle FindOrCreate(const CSeq_id& id);
982 
983  virtual void FindMatchStr(const string& sid,
984  TSeq_id_MatchList& id_list) const;
985 
986  virtual size_t Dump(CNcbiOstream& out,
988  int details) const;
989 
990 private:
991  virtual void x_Unindex(const CSeq_id_Info* info);
992  CSeq_id_Info* x_FindInfo(const CPatent_seq_id& pid) const;
993 
994  // 3-level indexing: country, (number|app_number), seqid.
995  // Ignoring patent doc-type in indexing.
996  struct SPat_idMap {
998  typedef map<string, TBySeqid, PNocase> TByNumber; // or by App_number
999 
1002  };
1004 
1006 };
1007 
1008 
1009 ////////////////////////////////////////////////////////////////////
1010 // e_PDB tree
1011 
1012 
1014 public:
1015  CSeq_id_PDB_Info(const CConstRef<CSeq_id>& seq_id, CSeq_id_Mapper* mapper);
1016 
1017  CConstRef<CSeq_id> GetPackedSeqId(TPacked packed, TVariant variant) const override;
1018 
1019  static pair<CConstRef<CSeq_id>, TVariant> Normalize(const CSeq_id& seq_id);
1020 
1021 private:
1022  static TVariant x_NormalizeDate(const CDate_std& date_std);
1023 
1024  // variant contains bits describing if chain fields are set,
1025  // and normalized date fields - year, month, day, hour, minute, and second
1026 
1027  // base constants
1028  static const int kSecondBits = 6; // 0-63, 63 means not set
1029  static const int kMinuteBits = 6; // 0-63, 63 means not set
1030  static const int kHourBits = 5; // 0-31, 31 means not set
1031  static const int kDayBits = 5; // 1-31, 0 means not set
1032  static const int kMonthBits = 4; // 1-12, 0 means not set
1033  static const int kYearBits = 12; // 1-4095
1034  static const int kMolLowerCaseBits = 3; // up to 3 'mol' letters
1035 
1036  // derived constants
1037  static const int kNoChainOffset = 0;
1038  static const int kNoChain_idOffset = kNoChainOffset + 1;
1039  static const int kSecondOffset = kNoChain_idOffset + 1;
1041  static const int kHourOffset = kMinuteOffset + kMinuteBits;
1042  static const int kDayOffset = kHourOffset + kHourBits;
1043  static const int kMonthOffset = kDayOffset + kDayBits;
1044  static const int kYearOffset = kMonthOffset + kMonthBits;
1046 };
1047 
1048 
1050 {
1051 public:
1053  ~CSeq_id_PDB_Tree(void);
1054 
1055  virtual bool Empty(void) const;
1056 
1057  virtual CSeq_id_Handle FindInfo(const CSeq_id& id) const;
1058  virtual CSeq_id_Handle FindOrCreate(const CSeq_id& id);
1059 
1060  virtual bool HaveMatch(const CSeq_id_Handle& id) const;
1061  virtual void FindMatch(const CSeq_id_Handle& id,
1062  TSeq_id_MatchList& id_list) const;
1063  virtual void FindMatchStr(const string& sid,
1064  TSeq_id_MatchList& id_list) const;
1065  virtual bool HaveReverseMatch(const CSeq_id_Handle& id) const;
1066  virtual void FindReverseMatch(const CSeq_id_Handle& id,
1067  TSeq_id_MatchList& id_list);
1068 
1069  virtual size_t Dump(CNcbiOstream& out,
1071  int details) const;
1072 
1073 private:
1074  virtual void x_Unindex(const CSeq_id_Info* info);
1075 
1076  string x_IdToStrKey(const CPDB_seq_id& id) const;
1077 
1078  // Index by mol+chain, no date - too complicated
1079  typedef vector<CSeq_id_Info*> TSubMolList;
1081 
1083 };
1084 
1085 
1086 // Seq-id mapper exception
1088 {
1089 public:
1090  enum EErrCode {
1094  eOtherError
1095  };
1096  const char* GetErrCodeString(void) const override;
1098 };
1099 
1100 
1101 /////////////////////////////////////////////////////////////////////////////
1102 //
1103 // Inline methods
1104 //
1105 /////////////////////////////////////////////////////////////////////////////
1106 
1109 
1110 #endif /* OBJECTS_OBJMGR___SEQ_ID_TREE__HPP */
User-defined methods of the data storage class.
User-defined methods of the data storage class.
Definition: Dbtag.hpp:53
CFastMutex –.
Definition: ncbimtx.hpp:667
CGiimport_id –.
Definition: Giimport_id.hpp:66
CObject –.
Definition: ncbiobj.hpp:180
CRef –.
Definition: ncbiobj.hpp:618
CSeq_id_GB_Tree(CSeq_id_Mapper *mapper)
virtual bool x_Check(const CSeq_id::E_Choice &type) const
int CompareOrdered(const CSeq_id_Info &other, const CSeq_id_Handle &h_this, const CSeq_id_Handle &h_other) const override
const string & GetDbtag(void) const
static TPacked Pack(const TKey &key, const CDbtag &id)
CSeq_id_General_Id_Info(CSeq_id_Mapper *mapper, const TKey &key)
const TKey & GetKey(void) const
void Restore(CDbtag &id, TPacked param, TVariant variant) const
CConstRef< CSeq_id > GetPackedSeqId(TPacked packed, TVariant variant) const override
TVariant ParseCaseVariant(const CDbtag &dbtag) const
CSeq_id_General_PlainInfo(const CDbtag &dbid, CSeq_id_Mapper *mapper)
CConstRef< CSeq_id > GetPackedSeqId(TPacked packed, TVariant variant) const override
string x_GetStr(TPacked param) const
CConstRef< CSeq_id > GetPackedSeqId(TPacked packed, TVariant variant) const override
static TKey Parse(const CDbtag &id)
CSeq_id_General_Str_Info(CSeq_id_Mapper *mapper, const TKey &key)
static TPacked Pack(const TKey &key, const CDbtag &id)
const string & GetStrPrefix(void) const
int CompareOrdered(const CSeq_id_Info &other, const CSeq_id_Handle &h_this, const CSeq_id_Handle &h_other) const override
void Restore(CDbtag &id, TPacked param, TVariant variant) const
const TKey & GetKey(void) const
size_t GetStrDigits(void) const
const string & GetStrSuffix(void) const
const string & GetDbtag(void) const
CSeq_id_General_Tree(CSeq_id_Mapper *mapper)
map< string, STagMap, PNocase > TDbMap
virtual void x_Unindex(const CSeq_id_Info *info)
CSeq_id_General_Id_Info::TKey TPackedIdKey
virtual size_t Dump(CNcbiOstream &out, CSeq_id::E_Choice type, int details) const
virtual CSeq_id_Handle FindInfo(const CSeq_id &id) const
CSeq_id_General_PlainInfo * x_FindInfo(const CDbtag &dbid) const
virtual bool Empty(void) const
TPackedIdMap m_PackedIdMap
CSeq_id_General_Str_Info::TKey TPackedStrKey
virtual CSeq_id_Handle FindOrCreate(const CSeq_id &id)
TPackedStrMap m_PackedStrMap
map< TPackedIdKey, CConstRef< CSeq_id_General_Id_Info >, CSeq_id_General_Id_Info::PKeyLess > TPackedIdMap
virtual void FindMatch(const CSeq_id_Handle &id, TSeq_id_MatchList &id_list) const
unordered_map< TPackedStrKey, CConstRef< CSeq_id_General_Str_Info >, CSeq_id_General_Str_Info::PHash > TPackedStrMap
virtual bool HaveMatch(const CSeq_id_Handle &id) const
virtual void FindMatchStr(const string &sid, TSeq_id_MatchList &id_list) const
CSeq_id_Gi_Info(CSeq_id_Mapper *mapper)
CConstRef< CSeq_id > GetPackedSeqId(TPacked packed, TVariant) const override
CSeq_id_Gi_Tree(CSeq_id_Mapper *mapper)
virtual CSeq_id_Handle FindInfo(const CSeq_id &id) const
virtual CSeq_id_Handle GetGiHandle(TGi gi)
virtual bool Empty(void) const
virtual void FindMatchStr(const string &sid, TSeq_id_MatchList &id_list) const
virtual void x_Unindex(const CSeq_id_Info *info)
virtual CSeq_id_Handle FindOrCreate(const CSeq_id &id)
CSeq_id_Info * m_ZeroInfo
TGi x_Get(const CSeq_id &id) const
CSeq_id_Info * m_SharedInfo
virtual size_t Dump(CNcbiOstream &out, CSeq_id::E_Choice type, int details) const
bool x_Check(const CSeq_id &id) const
virtual bool x_Check(const CSeq_id &id) const
CSeq_id_Gibbmt_Tree(CSeq_id_Mapper *mapper)
virtual TPacked x_Get(const CSeq_id &id) const
CSeq_id_Gibbsq_Tree(CSeq_id_Mapper *mapper)
virtual TPacked x_Get(const CSeq_id &id) const
virtual bool x_Check(const CSeq_id &id) const
virtual size_t Dump(CNcbiOstream &out, CSeq_id::E_Choice type, int details) const
virtual bool Empty(void) const
virtual CSeq_id_Handle FindOrCreate(const CSeq_id &id)
virtual CSeq_id_Handle FindInfo(const CSeq_id &id) const
CSeq_id_Info * x_FindInfo(const CGiimport_id &gid) const
virtual void x_Unindex(const CSeq_id_Info *info)
CSeq_id_Giim_Tree(CSeq_id_Mapper *mapper)
map< TPacked, TGiimList > TIdMap
virtual void FindMatchStr(const string &sid, TSeq_id_MatchList &id_list) const
vector< CSeq_id_Info * > TGiimList
CSeq_id_Gpipe_Tree(CSeq_id_Mapper *mapper)
bool HasMatchingId() const
CConstRef< CSeq_id > GetPackedSeqId(TPacked packed, TVariant variant) const override
CObject_id::TId m_MatchingId
TVariant ParseCaseVariant(const string &str) const
CSeq_id_Local_Info(const CObject_id &oid, CSeq_id_Mapper *mapper)
bool IsId() const
CObject_id::TId GetMatchingId() const
virtual bool HaveMatch(const CSeq_id_Handle &id) const
map< CObject_id::TId, CSeq_id_Local_Info * > TById
virtual CSeq_id_Handle FindInfo(const CSeq_id &id) const
virtual void FindMatchStr(const string &sid, TSeq_id_MatchList &id_list) const
CSeq_id_Local_Info * x_FindIdInfo(CObject_id::TId id) const
unordered_map< string, CSeq_id_Local_Info *, PHashNocase, PEqualNocase > TByStr
virtual void FindMatch(const CSeq_id_Handle &id, TSeq_id_MatchList &id_list) const
virtual void x_Unindex(const CSeq_id_Info *info)
virtual CSeq_id_Handle FindOrCreate(const CSeq_id &id)
virtual bool Empty(void) const
CSeq_id_Local_Tree(CSeq_id_Mapper *mapper)
CSeq_id_Local_Info * x_FindInfo(const CObject_id &oid) const
CSeq_id_Local_Info * x_FindStrInfo(const string &str) const
virtual size_t Dump(CNcbiOstream &out, CSeq_id::E_Choice type, int details) const
NCBI_EXCEPTION_DEFAULT(CSeq_id_MapperException, CException)
CSeq_id_Named_annot_track_Tree(CSeq_id_Mapper *mapper)
CSeq_id_Other_Tree(CSeq_id_Mapper *mapper)
static const int kYearBits
static const int kHourOffset
static pair< CConstRef< CSeq_id >, TVariant > Normalize(const CSeq_id &seq_id)
static const int kHourBits
static const int kDayBits
CConstRef< CSeq_id > GetPackedSeqId(TPacked packed, TVariant variant) const override
static const int kSecondBits
static const int kMinuteBits
static const int kMonthBits
CSeq_id_PDB_Info(const CConstRef< CSeq_id > &seq_id, CSeq_id_Mapper *mapper)
static const int kSecondOffset
static const int kNoChain_idOffset
static const int kNoChainOffset
static const int kYearOffset
static const int kMolLowerCaseBits
static const int kDayOffset
static const int kMonthOffset
static const int kMolLowerCaseOffset
static const int kMinuteOffset
static TVariant x_NormalizeDate(const CDate_std &date_std)
string x_IdToStrKey(const CPDB_seq_id &id) const
virtual bool HaveReverseMatch(const CSeq_id_Handle &id) const
virtual void FindReverseMatch(const CSeq_id_Handle &id, TSeq_id_MatchList &id_list)
virtual bool HaveMatch(const CSeq_id_Handle &id) const
virtual bool Empty(void) const
virtual size_t Dump(CNcbiOstream &out, CSeq_id::E_Choice type, int details) const
map< string, TSubMolList, PCase > TMolMap
virtual void x_Unindex(const CSeq_id_Info *info)
CSeq_id_PDB_Tree(CSeq_id_Mapper *mapper)
virtual void FindMatch(const CSeq_id_Handle &id, TSeq_id_MatchList &id_list) const
virtual CSeq_id_Handle FindInfo(const CSeq_id &id) const
vector< CSeq_id_Info * > TSubMolList
virtual void FindMatchStr(const string &sid, TSeq_id_MatchList &id_list) const
virtual CSeq_id_Handle FindOrCreate(const CSeq_id &id)
virtual CSeq_id_Handle FindOrCreate(const CSeq_id &id)
virtual CSeq_id_Handle FindInfo(const CSeq_id &id) const
virtual size_t Dump(CNcbiOstream &out, CSeq_id::E_Choice type, int details) const
CSeq_id_Info * x_FindInfo(const CPatent_seq_id &pid) const
map< string, SPat_idMap, PNocase > TByCountry
virtual bool Empty(void) const
CSeq_id_Patent_Tree(CSeq_id_Mapper *mapper)
virtual void x_Unindex(const CSeq_id_Info *info)
virtual void FindMatchStr(const string &sid, TSeq_id_MatchList &id_list) const
CSeq_id_Pir_Tree(CSeq_id_Mapper *mapper)
CSeq_id_Prf_Tree(CSeq_id_Mapper *mapper)
CSeq_id_Swissprot_Tree(CSeq_id_Mapper *mapper)
static TVariant ParseCaseVariant(const CSeq_id_Info *info, const string &acc)
CConstRef< CSeq_id > GetPackedSeqId(TPacked packed, TVariant variant) const override
int GetAccDigits(void) const
CTempString GetAccPrefix(void) const
bool GoodPrefix(const CTempString &acc) const
void Restore(CTextseq_id &id, TPacked param, TVariant variant) const
void RestoreAccession(string &acc, TPacked param, TVariant variant) const
int CompareOrdered(const CSeq_id_Info &other, const CSeq_id_Handle &h_this, const CSeq_id_Handle &h_other) const override
static TPacked Pack(const TKey &key, const string &acc)
CSeq_id_Textseq_Info(CSeq_id::E_Choice type, CSeq_id_Mapper *mapper, const TKey &key)
static TKey ParseAcc(const string &acc, const TVersion *ver)
const TKey & GetKey(void) const
static TKey ParseAcc(const string &acc, const CTextseq_id &tid)
bool IsSetVersion(void) const
const TVersion & GetVersion(void) const
CTextseq_id::TVersion TVersion
CSeq_id_Textseq_PlainInfo(const CConstRef< CSeq_id > &seq_id, CSeq_id_Mapper *mapper)
CConstRef< CSeq_id > GetPackedSeqId(TPacked packed, TVariant variant) const override
TVariant ParseCaseVariant(const string &acc) const
static void x_Erase(TStringMap &str_map, const string &key, const CSeq_id_Info *info)
virtual bool x_Check(const CSeq_id::E_Choice &type) const
virtual size_t Dump(CNcbiOstream &out, CSeq_id::E_Choice type, int details) const
void x_FindRevMatchByAccNonPacked(TSeq_id_MatchList &id_list, const string &acc, const TVersion *ver=0) const
CSeq_id_Textseq_Info::TKey TPackedKey
CTextseq_id::TVersion TVersion
virtual void x_Unindex(const CSeq_id_Info *info)
CSeq_id::E_Choice m_Type
const CTextseq_id & x_Get(const CSeq_id &id) const
virtual bool HaveMatch(const CSeq_id_Handle &id) const
TPackedMap::const_iterator TPackedMap_CI
TPackedMap::value_type TPackedMapValue
bool x_GetVersion(TVersion &version, const CSeq_id_Handle &id) const
virtual bool Match(const CSeq_id_Handle &h1, const CSeq_id_Handle &h2) const
void x_FindRevMatchByAcc(TSeq_id_MatchList &id_list, const string &acc, const CTextseq_id *tid) const
virtual bool Empty(void) const
pair< TStringMapCI, TStringMapCI > TVersions
static bool x_Equals(const CTextseq_id &id1, const CTextseq_id &id2)
virtual bool HaveReverseMatch(const CSeq_id_Handle &id) const
CSeq_id_Textseq_PlainInfo * x_FindStrInfo(CSeq_id::E_Choice type, const CTextseq_id &tid) const
void x_FindMatchByAcc(TSeq_id_MatchList &id_list, const string &acc, const CTextseq_id *tid) const
virtual void FindReverseMatch(const CSeq_id_Handle &id, TSeq_id_MatchList &id_list)
virtual CSeq_id_Handle FindInfo(const CSeq_id &id) const
virtual bool IsBetterVersion(const CSeq_id_Handle &h1, const CSeq_id_Handle &h2) const
multimap< string, CSeq_id_Textseq_PlainInfo *, PNocase > TStringMap
TStringMap::const_iterator TStringMapCI
void x_FindRevMatchByAcc(TSeq_id_MatchList &id_list, const string &acc, const TVersion *ver=0) const
virtual void FindMatchStr(const string &sid, TSeq_id_MatchList &id_list) const
CSeq_id_Textseq_Tree(CSeq_id_Mapper *mapper, CSeq_id::E_Choice type)
map< TPackedKey, CConstRef< CSeq_id_Textseq_Info > > TPackedMap
void x_FindRevMatchByAccPacked(TSeq_id_MatchList &id_list, const string &acc, const TVersion *ver=0) const
virtual CSeq_id_Handle FindOrCreate(const CSeq_id &id)
TStringMap::value_type TStringMapValue
TPackedMap::iterator TPackedMap_I
virtual void FindMatch(const CSeq_id_Handle &id, TSeq_id_MatchList &id_list) const
void x_FindRevMatchByName(TSeq_id_MatchList &id_list, const string &name, const CTextseq_id *tid=0) const
void x_FindMatchByName(TSeq_id_MatchList &id_list, const string &name, const CTextseq_id *tid=0) const
void x_FindMatchByAcc(TSeq_id_MatchList &id_list, const string &acc, const TVersion *ver=0) const
CSeq_id_Tpd_Tree(CSeq_id_Mapper *mapper)
CSeq_id_Tpe_Tree(CSeq_id_Mapper *mapper)
CSeq_id_Tpg_Tree(CSeq_id_Mapper *mapper)
TTreeLock::TReadLockGuard TReadLockGuard
virtual CSeq_id_Handle FindInfo(const CSeq_id &id) const =0
virtual size_t Dump(CNcbiOstream &out, CSeq_id::E_Choice type, int details) const =0
virtual CSeq_id_Handle GetGiHandle(TGi gi)
virtual bool HaveReverseMatch(const CSeq_id_Handle &id) const
TTreeLock::TWriteLockGuard TWriteLockGuard
virtual void FindMatchStr(const string &sid, TSeq_id_MatchList &id_list) const =0
const CSeq_id_Which_Tree & operator=(const CSeq_id_Which_Tree &tree)
virtual CSeq_id_Handle FindOrCreate(const CSeq_id &id)=0
CSeq_id_Which_Tree(const CSeq_id_Which_Tree &tree)
static const CSeq_id * GetSeqId(const CSeq_id_Info *info)
CSeq_id_Info * CreateInfo(CSeq_id::E_Choice type)
CSeq_id_Info::TPacked TPacked
virtual void DropInfo(const CSeq_id_Info *info)
CSeq_id_Which_Tree(CSeq_id_Mapper *mapper)
Definition: seq_id_tree.cpp:59
virtual bool HaveMatch(const CSeq_id_Handle &id) const
Definition: seq_id_tree.cpp:71
virtual void FindReverseMatch(const CSeq_id_Handle &id, TSeq_id_MatchList &id_list)
CFastMutex TTreeLock
CSeq_id_Mapper * m_Mapper
static const CSeq_id_Info * GetInfo(const CSeq_id_Handle &id)
virtual void x_Unindex(const CSeq_id_Info *info)=0
virtual bool Match(const CSeq_id_Handle &h1, const CSeq_id_Handle &h2) const
Definition: seq_id_tree.cpp:84
virtual void FindMatch(const CSeq_id_Handle &id, TSeq_id_MatchList &id_list) const
Definition: seq_id_tree.cpp:77
static void Initialize(CSeq_id_Mapper *mapper, vector< CRef< CSeq_id_Which_Tree > > &v)
virtual bool Empty(void) const =0
set< CSeq_id_Handle > TSeq_id_MatchList
virtual ~CSeq_id_Which_Tree(void)
Definition: seq_id_tree.cpp:66
virtual bool IsBetterVersion(const CSeq_id_Handle &h1, const CSeq_id_Handle &h2) const
Definition: seq_id_tree.cpp:99
virtual void x_Unindex(const CSeq_id_Info *info)
virtual TPacked x_Get(const CSeq_id &id) const =0
virtual bool Empty(void) const
virtual bool x_Check(const CSeq_id &id) const =0
virtual CSeq_id_Handle FindOrCreate(const CSeq_id &id)
CSeq_id_int_Tree(CSeq_id_Mapper *mapper)
virtual CSeq_id_Handle FindInfo(const CSeq_id &id) const
virtual size_t Dump(CNcbiOstream &out, CSeq_id::E_Choice type, int details) const
virtual void FindMatchStr(const string &sid, TSeq_id_MatchList &id_list) const
map< TPacked, CSeq_id_Info * > TIntMap
virtual size_t Dump(CNcbiOstream &out, CSeq_id::E_Choice type, int details) const
virtual void FindMatchStr(const string &sid, TSeq_id_MatchList &id_list) const
virtual CSeq_id_Handle FindOrCreate(const CSeq_id &id)
virtual void FindReverseMatch(const CSeq_id_Handle &id, TSeq_id_MatchList &id_list)
virtual bool Empty(void) const
virtual void DropInfo(const CSeq_id_Info *info)
virtual void x_Unindex(const CSeq_id_Info *info)
bool x_Check(const CSeq_id &id) const
virtual CSeq_id_Handle FindInfo(const CSeq_id &id) const
CSeq_id_not_set_Tree(CSeq_id_Mapper *mapper)
virtual void FindMatch(const CSeq_id_Handle &id, TSeq_id_MatchList &id_list) const
CTempString implements a light-weight string on top of a storage buffer whose lifetime management is ...
Definition: tempstr.hpp:65
Definition: set.hpp:45
The NCBI C++ standard methods for dealing with std::string.
std::ofstream out("events_result.xml")
main entry point for tests
EErrCode
Error types that an application can generate.
Definition: ncbiexpt.hpp:884
virtual const char * GetErrCodeString(void) const
Get error code interpreted as text.
Definition: ncbiexpt.cpp:444
uint8_t Uint1
1-byte (8-bit) unsigned integer
Definition: ncbitype.h:99
#define END_NCBI_SCOPE
End previously defined NCBI scope.
Definition: ncbistl.hpp:103
#define END_SCOPE(ns)
End the previously defined scope.
Definition: ncbistl.hpp:75
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
Definition: ncbistl.hpp:100
#define BEGIN_SCOPE(ns)
Define a new scope.
Definition: ncbistl.hpp:72
IO_PREFIX::ostream CNcbiOstream
Portable alias for ostream.
Definition: ncbistre.hpp:149
static int CompareNocase(const CTempString s1, SIZE_TYPE pos, SIZE_TYPE n, const char *s2)
Case-insensitive compare of a substring with another string.
Definition: ncbistr.cpp:219
PEqualNocase_Generic< string > PEqualNocase
Definition: ncbistr.hpp:4974
static bool StartsWith(const CTempString str, const CTempString start, ECase use_case=eCase)
Check if a string starts with a specified prefix value.
Definition: ncbistr.hpp:5411
static bool EqualNocase(const CTempString s1, SIZE_TYPE pos, SIZE_TYPE n, const char *s2)
Case-insensitive equality of a substring with another string.
Definition: ncbistr.hpp:5352
@ eNocase
Case insensitive compare.
Definition: ncbistr.hpp:1206
#define NCBI_SEQ_EXPORT
Definition: ncbi_export.h:825
TVersion GetVersion(void) const
Get the Version member data.
E_Choice
Choice variants.
Definition: Seq_id_.hpp:93
bool IsSetVersion(void) const
Check if a value has been assigned to Version data member.
int i
int len
static MDB_envinfo info
Definition: mdb_load.c:37
static int version
Definition: mdb_load.c:29
const struct ncbi::grid::netcache::search::fields::KEY key
unsigned int a
Definition: ncbi_localip.c:102
int tolower(Uchar c)
Definition: ncbictype.hpp:72
Multi-threading – mutexes; rw-locks; semaphore.
Portable reference counted smart and weak pointers using CWeakRef, CRef, CObject and CObjectEx.
static const char * str(char *buf, int n)
Definition: stats.c:84
TPacked operator()(const TKey &a) const
bool operator()(const TKey &a, const TKey &b) const
TVariant ParseCaseVariant(const CDbtag &dbtag) const
bool operator!=(const TKey &b) const
size_t GetStrDigits(void) const
bool operator==(const TKey &b) const
unordered_map< string, CSeq_id_General_PlainInfo *, PHashNocase, PEqualNocase > TByStr
map< TPacked, CSeq_id_General_PlainInfo * > TById
map< string, TBySeqid, PNocase > TByNumber
map< TPacked, CSeq_id_Info * > TBySeqid
CTempString GetAccPrefix(void) const
bool operator<(const TKey &b) const
char m_PrefixBuf[kMaxPrefixLen]
int GetAccDigits(void) const
DECLARE_OPERATOR_BOOL(m_Hash !=0)
bool operator!=(const TKey &b) const
bool operator==(const TKey &b) const
bool SameHash(const TKey &b) const
bool IsSetVersion(void) const
bool EqualAcc(const TKey &b) const
bool SameHashNoVer(const TKey &b) const
TVariant ParseCaseVariant(const string &acc) const
const TVersion & GetVersion(void) const
void SetVersion(TVersion version)
bool operator()(const string &s1, const string &s2) const
Definition: seq_id_tree.hpp:91
size_t operator()(const string &s) const
Definition: seq_id_tree.hpp:82
static char get_hash(char c)
Definition: seq_id_tree.hpp:73
Definition: type.c:6
#define _ASSERT
Modified on Tue Nov 28 02:18:55 2023 by modify_doxy.py rev. 669887