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

Go to the SVN repository for this file.

1 #ifndef OBJMGR_TSE_HANDLE__HPP
2 #define OBJMGR_TSE_HANDLE__HPP
3 
4 /* $Id: tse_handle.hpp 100066 2023-06-12 15:57:33Z 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 * Authors:
30 * Eugene Vasilchenko
31 *
32 * File Description:
33 * CTSE_Handle is handle to TSE
34 *
35 */
36 
37 #include <corelib/ncbiobj.hpp>
43 #include <vector>
44 
47 
48 class CScope;
49 class CTSE_ScopeInfo;
50 class CTSE_Info;
51 class CTSE_Info_Object;
52 class CTSE_Lock;
53 class CBioseq_Handle;
54 class CSeq_entry;
55 class CSeq_entry_Handle;
56 class CSeq_id;
57 class CSeq_id_Handle;
58 class CBlobIdKey;
59 class CDataLoader;
60 class CSeq_annot_Handle;
61 class CSeq_feat_Handle;
62 class CAnnotObject_Info;
63 class CObject_id;
64 class CSeq_submit;
65 class CSubmit_block;
66 
67 class CScopeInfo_Base;
68 class CScopeInfoLocker;
69 
70 /////////////////////////////////////////////////////////////////////////////
71 // CTSE_Handle definition
72 /////////////////////////////////////////////////////////////////////////////
73 
74 
76 {
77 public:
78  /// Default constructor/destructor and assignment
79  CTSE_Handle(void);
80  CTSE_Handle(const CTSE_Handle& tse);
81  CTSE_Handle& operator=(const CTSE_Handle& tse);
82  ~CTSE_Handle(void);
83 
84  /// Returns scope
85  CScope& GetScope(void) const;
86 
87  /// State check
88  bool IsValid(void) const;
90 
91  bool operator==(const CTSE_Handle& tse) const;
92  bool operator!=(const CTSE_Handle& tse) const;
93  bool operator<(const CTSE_Handle& tse) const;
94  bool OrderedBefore(const CTSE_Handle& tse) const;
95 
96  /// Reset to null state
97  void Reset(void);
98 
99  /// TSE info getters
101  TBlobId GetBlobId(void) const;
102  CDataLoader* GetDataLoader(void) const;
103 
104  /// return estimated memory size occupied by this TSE
105  size_t GetUsedMemory(void) const;
106 
107  bool Blob_IsSuppressed(void) const;
108  bool Blob_IsSuppressedTemp(void) const;
109  bool Blob_IsSuppressedPerm(void) const;
110  bool Blob_IsDead(void) const;
111 
112  /// Complete and get const reference to the seq-entry
113  CConstRef<CSeq_entry> GetCompleteTSE(void) const;
114 
115  /// Get const reference to the seq-entry
116  CConstRef<CSeq_entry> GetTSECore(void) const;
117 
118  /// Unified interface for templates
120  CConstRef<TObject> GetCompleteObject(void) const;
121  CConstRef<TObject> GetObjectCore(void) const;
122 
123  /// Get top level Seq-entry handle
124  CSeq_entry_Handle GetTopLevelEntry(void) const;
125 
126  /// Type of top level object added to scope
132  eTopLevel_Seq_submit
133  };
134 
135  /// Get type of top level object added to scope
136  ETopLevelObjectType GetTopLevelObjectType() const;
137  bool IsTopLevelSeq_submit() const;
138  /// Return reference to top-level Seq-submit object
139  /// Throw an exception if it's not available
140  const CSeq_submit& GetTopLevelSeq_submit() const;
141  /// More efficient direct access to Seq-submit.sub field
142  const CSubmit_block& GetTopLevelSubmit_block() const;
143  CSubmit_block& SetTopLevelSubmit_block() const;
144  void SetTopLevelSubmit_block(CSubmit_block& sub) const;
145 
146  /// Get Bioseq handle from this TSE
147  CBioseq_Handle GetBioseqHandle(const CSeq_id& id) const;
148  CBioseq_Handle GetBioseqHandle(const CSeq_id_Handle& id) const;
149 
150  /// Register argument TSE as used by this TSE, so it will be
151  /// released by scope only after this TSE is released.
152  ///
153  /// @param tse
154  /// Used TSE handle
155  ///
156  /// @return
157  /// True if argument TSE was successfully registered as 'used'.
158  /// False if argument TSE was not registered as 'used'.
159  /// Possible reasons:
160  /// Circular reference in 'used' tree.
161  bool AddUsedTSE(const CTSE_Handle& tse) const;
162 
163  /// Return true if this TSE handle is local to scope and can be edited.
164  bool CanBeEdited(void) const;
165 
166 
167  typedef vector<CSeq_feat_Handle> TSeq_feat_Handles;
168 
169  /// Find features by an integer FeatId
170  typedef int TFeatureIdInt;
172  TFeatureIdInt id) const;
173  TSeq_feat_Handles GetFeaturesWithId(CSeqFeatData::ESubtype subtype,
174  TFeatureIdInt id) const;
175  TSeq_feat_Handles GetFeaturesWithXref(CSeqFeatData::E_Choice type,
176  TFeatureIdInt id) const;
177  TSeq_feat_Handles GetFeaturesWithXref(CSeqFeatData::ESubtype subtype,
178  TFeatureIdInt id) const;
180  TFeatureIdInt id) const;
181  CSeq_feat_Handle GetFeatureWithId(CSeqFeatData::ESubtype subtype,
182  TFeatureIdInt id) const;
183  /// Find features by a string FeatId
184  typedef string TFeatureIdStr;
186  const TFeatureIdStr& id) const;
187  TSeq_feat_Handles GetFeaturesWithId(CSeqFeatData::ESubtype subtype,
188  const TFeatureIdStr& id) const;
189  TSeq_feat_Handles GetFeaturesWithXref(CSeqFeatData::E_Choice type,
190  const TFeatureIdStr& id) const;
191  TSeq_feat_Handles GetFeaturesWithXref(CSeqFeatData::ESubtype subtype,
192  const TFeatureIdStr& id) const;
194  const TFeatureIdStr& id) const;
195  CSeq_feat_Handle GetFeatureWithId(CSeqFeatData::ESubtype subtype,
196  const TFeatureIdStr& id) const;
197 
198  /// Find features by CObject_id (string or integer)
200  // no context
202  const TFeatureId& id) const;
203  TSeq_feat_Handles GetFeaturesWithId(CSeqFeatData::ESubtype subtype,
204  const TFeatureId& id) const;
205  TSeq_feat_Handles GetFeaturesWithXref(CSeqFeatData::E_Choice type,
206  const TFeatureId& id) const;
207  TSeq_feat_Handles GetFeaturesWithXref(CSeqFeatData::ESubtype subtype,
208  const TFeatureId& id) const;
210  const TFeatureId& id) const;
211  CSeq_feat_Handle GetFeatureWithId(CSeqFeatData::ESubtype subtype,
212  const TFeatureId& id) const;
213  // Seq-annot context
215  const TFeatureId& id,
216  const CSeq_annot_Handle& src_annot) const;
217  TSeq_feat_Handles GetFeaturesWithId(CSeqFeatData::ESubtype subtype,
218  const TFeatureId& id,
219  const CSeq_annot_Handle& src_annot) const;
220  TSeq_feat_Handles GetFeaturesWithXref(CSeqFeatData::E_Choice type,
221  const TFeatureId& id,
222  const CSeq_annot_Handle& src_annot) const;
223  TSeq_feat_Handles GetFeaturesWithXref(CSeqFeatData::ESubtype subtype,
224  const TFeatureId& id,
225  const CSeq_annot_Handle& src_annot) const;
227  const TFeatureId& id,
228  const CSeq_annot_Handle& src_annot) const;
229  CSeq_feat_Handle GetFeatureWithId(CSeqFeatData::ESubtype subtype,
230  const TFeatureId& id,
231  const CSeq_annot_Handle& src_annot) const;
232  // Seq-feat context
234  const TFeatureId& id,
235  const CSeq_feat_Handle& src) const;
236  TSeq_feat_Handles GetFeaturesWithId(CSeqFeatData::ESubtype subtype,
237  const TFeatureId& id,
238  const CSeq_feat_Handle& src) const;
239  TSeq_feat_Handles GetFeaturesWithXref(CSeqFeatData::E_Choice type,
240  const TFeatureId& id,
241  const CSeq_feat_Handle& src) const;
242  TSeq_feat_Handles GetFeaturesWithXref(CSeqFeatData::ESubtype subtype,
243  const TFeatureId& id,
244  const CSeq_feat_Handle& src) const;
246  const TFeatureId& id,
247  const CSeq_feat_Handle& src) const;
248  CSeq_feat_Handle GetFeatureWithId(CSeqFeatData::ESubtype subtype,
249  const TFeatureId& id,
250  const CSeq_feat_Handle& src) const;
251 
252 
253  /// Find genes by locus, locus tag, or Gene-ref
254  // no context
255  CSeq_feat_Handle GetGeneWithLocus(const string& locus, bool tag) const;
256  TSeq_feat_Handles GetGenesWithLocus(const string& locus, bool tag) const;
257  CSeq_feat_Handle GetGeneByRef(const CGene_ref& ref) const;
258  TSeq_feat_Handles GetGenesByRef(const CGene_ref& ref) const;
259  // Seq-annot context
260  CSeq_feat_Handle GetGeneWithLocus(const string& locus,
261  bool tag,
262  const CSeq_annot_Handle& src_annot) const;
263  TSeq_feat_Handles GetGenesWithLocus(const string& locus,
264  bool tag,
265  const CSeq_annot_Handle& src_annot) const;
266  CSeq_feat_Handle GetGeneByRef(const CGene_ref& ref,
267  const CSeq_annot_Handle& src_annot) const;
268  TSeq_feat_Handles GetGenesByRef(const CGene_ref& ref,
269  const CSeq_annot_Handle& src_annot) const;
270  // Seq-feat context
271  CSeq_feat_Handle GetGeneWithLocus(const string& locus,
272  bool tag,
273  const CSeq_feat_Handle& src) const;
274  TSeq_feat_Handles GetGenesWithLocus(const string& locus,
275  bool tag,
276  const CSeq_feat_Handle& src) const;
277  CSeq_feat_Handle GetGeneByRef(const CGene_ref& ref,
278  const CSeq_feat_Handle& src) const;
279  TSeq_feat_Handles GetGenesByRef(const CGene_ref& ref,
280  const CSeq_feat_Handle& src) const;
281 
282  void Swap(CTSE_Handle& tse);
283 
284 protected:
285  friend class CScope_Impl;
286  friend class CTSE_ScopeInfo;
287  friend class CScopeInfo_Base;
288 
290 
291  CTSE_Handle(TScopeInfo& object);
292 
293  typedef vector<CAnnotObject_Info*> TAnnotObjectList;
294  CSeq_feat_Handle x_MakeHandle(CAnnotObject_Info* info) const;
295  CSeq_feat_Handle x_MakeHandle(const TAnnotObjectList& info) const;
296  TSeq_feat_Handles x_MakeHandles(const TAnnotObjectList& infos) const;
297 
298 private:
299 
302 
303 public: // non-public section
304 
305  CTSE_Handle(const CTSE_ScopeUserLock& lock);
306 
307  TScopeInfo& x_GetScopeInfo(void) const;
308  const CTSE_Info& x_GetTSE_Info(void) const;
309  CScope_Impl& x_GetScopeImpl(void) const;
310 };
311 
312 
313 /////////////////////////////////////////////////////////////////////////////
314 // CTSE_Handle inline methods
315 /////////////////////////////////////////////////////////////////////////////
316 
317 
318 inline
320 {
321 }
322 
323 
324 inline
326 {
327  return m_Scope.GetScope();
328 }
329 
330 
331 inline
333 {
334  return *m_Scope.GetImpl();
335 }
336 
337 
338 inline
339 bool CTSE_Handle::operator==(const CTSE_Handle& tse) const
340 {
341  return m_TSE == tse.m_TSE;
342 }
343 
344 
345 inline
346 bool CTSE_Handle::operator!=(const CTSE_Handle& tse) const
347 {
348  return m_TSE != tse.m_TSE;
349 }
350 
351 
352 inline
353 bool CTSE_Handle::operator<(const CTSE_Handle& tse) const
354 {
355  return m_TSE < tse.m_TSE;
356 }
357 
358 
359 inline
361 {
362  return const_cast<TScopeInfo&>(*m_TSE);
363 }
364 
365 
366 inline
368 {
369  return GetCompleteTSE();
370 }
371 
372 
373 inline
375 {
376  return GetTSECore();
377 }
378 
379 
380 inline
382 {
383  m_Scope.Swap(tse.m_Scope);
384  m_TSE.Swap(tse.m_TSE);
385 }
386 
387 
388 /////////////////////////////////////////////////////////////////////////////
389 // CScopeInfo classes
390 /////////////////////////////////////////////////////////////////////////////
391 
392 class CScopeInfo_Base : public CObject
393 {
394 public:
395  // creates object with one reference
398  const CTSE_Info_Object& info);
400  const CTSE_Info_Object& info);
402 
403  bool IsDetached(void) const
404  {
405  return m_TSE_ScopeInfo == 0;
406  }
407  bool IsAttached(void) const
408  {
409  return m_TSE_ScopeInfo != 0;
410  }
411  bool HasObject(void) const
412  {
413  return m_ObjectInfoAssigned;
414  }
415  bool HasObject(const CTSE_Info_Object& info) const
416  {
417  return HasObject() && &GetObjectInfo_Base() == &info;
418  }
419 
421  typedef vector<TIndexId> TIndexIds;
422 
423  virtual NCBI_XOBJMGR_EXPORT const TIndexIds* GetIndexIds(void) const;
424 
425  // Temporary means that this TSE object doesn't have identification,
426  // so we cannot retrieve the same CScopeInfo_Base for the TSE object
427  // after we release TSE object pointer.
428  // As a result, when all handles to this TSE object are removed,
429  // we simply forget this CScopeInfo_Base object.
430  // For non-temporary TSE object we keep CScopeInfo_Base object in
431  // index by its ids, and reuse it when new handle is created.
432  bool IsTemporary(void) const
433  {
434  const TIndexIds* ids = GetIndexIds();
435  return !ids || ids->empty();
436  }
437 
439  {
441  _ASSERT(info);
442  return *info;
443  }
444 
445  const CTSE_Handle& GetTSE_Handle(void) const
446  {
447  return m_TSE_Handle;
448  }
449 
451 
453  {
454  _ASSERT(HasObject());
455  return reinterpret_cast<const CTSE_Info_Object&>(*m_ObjectInfo);
456  }
457 
458 protected:
459  // CScopeInfo_Base can be in the following states:
460  //
461  // S0. detached, unlocked:
462  // TSE_ScopeInfo == 0,
463  // LockCounter == 0,
464  // TSE_Handle == 0,
465  // ObjectInfo == 0.
466  //
467  // S1. attached, locked:
468  // TSE_ScopeInfo != 0,
469  // LockCounter > 0,
470  // TSE_Handle != 0,
471  // ObjectInfo != 0, indexed.
472  // When unlocked by handles (LockCounter becomes 0):
473  // 1. TSE_Handle is reset,
474  // New state: S5.
475  // When removed explicitly:
476  // 1. Do actual remove,
477  // 2. Scan for implicit removals,
478  // 3. Assert that this CScopeInfo_Base is removed (detached),
479  // New state: S3 (implicitly).
480  // When removed implicitly (found in ObjectInfo index as being removed):
481  // 1. TSE_Handle is reset,
482  // 2. Removed from index by ObjectInfo,
483  // 3. Detached from TSE,
484  // New state: S3.
485  //
486  // S5. attached, unlocked, indexed:
487  // TSE_ScopeInfo != 0,
488  // LockCounter == 0,
489  // TSE_Handle == 0,
490  // ObjectInfo != 0, indexed.
491  // When relocked:
492  // 1. TSE_Handle is set,
493  // New state: S1.
494  // When removed implicitly (found in ObjectInfo index as being removed)
495  // 1. Removing from index by ObjectInfo,
496  // 2. Detached from TSE,
497  // New state: S3 (or S0).
498  // When TSE is unlocked completely, temporary:
499  // 1. ObjectInfo is reset, with removing from index by ObjectInfo,
500  // 2. Detached from TSE,
501  // New state: S0.
502  // When TSE is unlocked completely, non-temporary:
503  // 1. ObjectInfo is reset, with removing from index by ObjectInfo,
504  // New state: S2.
505  //
506  // S2. attached, unlocked, non-temporary:
507  // TSE_ScopeInfo != 0,
508  // LockCounter == 0,
509  // TSE_Handle == 0,
510  // ObjectInfo == 0.
511  // When relocked:
512  // 1. TSE_Handle is set,
513  // 2. ObjectInfo is set, adding to index by ObjectInfo,
514  // New state: S1.
515  // When removed implicitly (is it possible to determine?)
516  // 1. Detached from TSE,
517  // New state: S0.
518  //
519  // S3. detached, locked:
520  // TSE_ScopeInfo == 0,
521  // LockCounter > 0,
522  // TSE_Handle == 0,
523  // ObjectInfo != 0, unindexed.
524  // When unlocked by handles (LockCounter becomes 0):
525  // 1. ObjectInfo is reset,
526  // New state: S0.
527  // When added into another place:
528  // 1. attached to TSE,
529  // 2. TSE_Handle is set,
530  // 3. ObjectInfo is set, adding to index by ObjectInfo,
531  // New state: S1.
532  //
533  // S4. detached, locked, dummy:
534  // TSE_ScopeInfo == 0,
535  // LockCounter > 0,
536  // TSE_Handle == 0,
537  // ObjectInfo == 0.
538  // When unlocked by handles (LockCounter becomes 0):
539  // 1. -> S0.
540 
541  // A. TSE_ScopeInfo != 0: attached, means it's used by some TSE_ScopeInfo.
542  // B. LockCounter > 0: locked, means it's used by some handle.
543  // C. TSE_Handle != 0 only when attached and locked.
544  // D. Indexed by ObjectInfo only when attached and ObjectInfo != 0.
545 
546  friend class CTSE_ScopeInfo;
547  friend class CScopeInfoLocker;
548 
549  // disconnect from TSE
552 
553  enum ECheckFlags {
554  fAllowZero = 0x00,
555  fForceZero = 0x01,
556  fForbidZero = 0x02,
557  fAllowInfo = 0x00,
558  fForceInfo = 0x10,
559  fForbidInfo = 0x20
560  };
561  typedef int TCheckFlags;
562 
563  // attached new tse and object info
566  const CTSE_Info_Object& info);
568 
569  void AddInfoLock(void)
570  {
571  ++m_LockCounter;
572  }
573  void RemoveInfoLock(void)
574  {
575  if ( --m_LockCounter <= 0 ) {
576  x_ResetTSE_Lock();
577  }
578  }
579 
580 private: // data members
581 
582  CTSE_ScopeInfo* m_TSE_ScopeInfo; // null if object is removed.
583  atomic<Uint8> m_LockCounter; // counts all referencing handles.
584  // The following members are not null when handle is locked (counter > 0)
585  // and not removed.
586  CTSE_Handle m_TSE_Handle; // locks TSE from releasing.
587  CConstRef<CObject> m_ObjectInfo; // current object info.
588  atomic<bool> m_TSE_HandleAssigned;
589  atomic<bool> m_ObjectInfoAssigned;
591 
592 private: // to prevent copying
595 };
596 
597 
599 {
600 public:
601  void Lock(CScopeInfo_Base* info) const
602  {
604  info->AddInfoLock();
605  }
607  {
608  Lock(info);
609  }
611  {
612  info->RemoveInfoLock();
614  }
615 };
616 
617 
618 class CScopeInfo_RefBase : public CRef<CScopeInfo_Base, CScopeInfoLocker>
619 {
620 public:
622  {
623  }
626  {
627  }
628 
629  bool IsValid(void) const
630  {
631  return NotNull() && GetPointerOrNull()->IsAttached();
632  }
633  bool IsRemoved(void) const
634  {
635  return NotNull() && GetPointerOrNull()->IsDetached();
636  }
637 };
638 
639 
640 template<class Info>
642 {
643 public:
644  typedef Info TScopeInfo;
645 
647  {
648  }
651  {
652  }
653 
654  void Reset(void)
655  {
657  }
659  {
661  }
662 
664  {
665  return *toInfo(GetNonNullPointer());
666  }
667  const TScopeInfo& operator*(void) const
668  {
669  return *toInfo(GetNonNullPointer());
670  }
671  TScopeInfo& GetNCObject(void) const
672  {
673  return *toInfo(GetNonNullNCPointer());
674  }
675 
677  {
678  return toInfo(GetNonNullPointer());
679  }
680  const TScopeInfo* operator->(void) const
681  {
682  return toInfo(GetNonNullPointer());
683  }
684 
685 protected:
687  {
688  return reinterpret_cast<CScopeInfo_Base*>(info);
689  }
691  {
692  return reinterpret_cast<TScopeInfo*>(base);
693  }
694  static const TScopeInfo* toInfo(const CScopeInfo_Base* base)
695  {
696  return reinterpret_cast<const TScopeInfo*>(base);
697  }
698 };
699 
700 
703 
704 #endif//OBJMGR_TSE_HANDLE__HPP
bool operator!=(const _Ht_iterator< _Val, _Nonconst_traits< _Val >, _Key, _HF, _ExK, _EqK, _All > &__x, const _Ht_iterator< _Val, _Const_traits< _Val >, _Key, _HF, _ExK, _EqK, _All > &__y)
Definition: _hashtable.h:173
CBioseq_Handle –.
CScope_Impl * GetImpl(void) const
Definition: heap_scope.cpp:80
void Swap(CHeapScope &scope)
Definition: heap_scope.hpp:128
CScope & GetScope(void) const
Definition: heap_scope.cpp:68
CObject –.
Definition: ncbiobj.hpp:180
void Lock(CScopeInfo_Base *info) const
Definition: tse_handle.hpp:601
void Relock(CScopeInfo_Base *info) const
Definition: tse_handle.hpp:606
void Unlock(CScopeInfo_Base *info) const
Definition: tse_handle.hpp:610
CRef< CObject > m_DetachedInfo
Definition: tse_handle.hpp:590
CConstRef< CObject > m_ObjectInfo
Definition: tse_handle.hpp:587
void AddInfoLock(void)
Definition: tse_handle.hpp:569
CTSE_ScopeInfo * m_TSE_ScopeInfo
Definition: tse_handle.hpp:582
void RemoveInfoLock(void)
Definition: tse_handle.hpp:573
void operator=(const CScopeInfo_Base &)
CTSE_Handle m_TSE_Handle
Definition: tse_handle.hpp:586
bool IsDetached(void) const
Definition: tse_handle.hpp:403
bool IsTemporary(void) const
Definition: tse_handle.hpp:432
void x_SetTSE_Lock(const CTSE_ScopeUserLock &tse, const CTSE_Info_Object &info)
Definition: tse_handle.cpp:513
void x_SetTSE_Handle(const CTSE_Handle &tse)
Definition: tse_handle.cpp:492
const CTSE_Handle & GetTSE_Handle(void) const
Definition: tse_handle.hpp:445
~CScopeInfo_Base(void)
Definition: tse_handle.cpp:472
atomic< bool > m_TSE_HandleAssigned
Definition: tse_handle.hpp:588
virtual void x_DetachTSE(CTSE_ScopeInfo *tse)
Definition: tse_handle.cpp:563
CSeq_id_Handle TIndexId
Definition: tse_handle.hpp:420
bool IsAttached(void) const
Definition: tse_handle.hpp:407
virtual const TIndexIds * GetIndexIds(void) const
Definition: tse_handle.cpp:483
CScope_Impl & x_GetScopeImpl(void) const
Definition: tse_handle.cpp:477
CTSE_ScopeInfo & x_GetTSE_ScopeInfo(void) const
Definition: tse_handle.hpp:438
CScopeInfo_Base(const CScopeInfo_Base &)
bool HasObject(const CTSE_Info_Object &info) const
Definition: tse_handle.hpp:415
atomic< bool > m_ObjectInfoAssigned
Definition: tse_handle.hpp:589
vector< TIndexId > TIndexIds
Definition: tse_handle.hpp:421
virtual void x_AttachTSE(CTSE_ScopeInfo *tse)
Definition: tse_handle.cpp:554
void x_ResetTSE_Lock(void)
Definition: tse_handle.cpp:539
const CTSE_Info_Object & GetObjectInfo_Base(void) const
Definition: tse_handle.hpp:452
bool HasObject(void) const
Definition: tse_handle.hpp:411
atomic< Uint8 > m_LockCounter
Definition: tse_handle.hpp:583
bool IsRemoved(void) const
Definition: tse_handle.hpp:633
CScopeInfo_RefBase(CScopeInfo_Base *info)
Definition: tse_handle.hpp:624
bool IsValid(void) const
Definition: tse_handle.hpp:629
TScopeInfo * operator->(void)
Definition: tse_handle.hpp:676
void Reset(TScopeInfo *info)
Definition: tse_handle.hpp:658
void Reset(void)
Definition: tse_handle.hpp:654
const TScopeInfo * operator->(void) const
Definition: tse_handle.hpp:680
TScopeInfo & operator*(void)
Definition: tse_handle.hpp:663
const TScopeInfo & operator*(void) const
Definition: tse_handle.hpp:667
CScopeInfo_Ref(void)
Definition: tse_handle.hpp:646
static const TScopeInfo * toInfo(const CScopeInfo_Base *base)
Definition: tse_handle.hpp:694
static CScopeInfo_Base * toBase(TScopeInfo *info)
Definition: tse_handle.hpp:686
CScopeInfo_Ref(TScopeInfo &info)
Definition: tse_handle.hpp:649
TScopeInfo & GetNCObject(void) const
Definition: tse_handle.hpp:671
static TScopeInfo * toInfo(CScopeInfo_Base *base)
Definition: tse_handle.hpp:690
CScope –.
Definition: scope.hpp:92
CSeq_annot_Handle –.
CSeq_entry_Handle –.
Definition: Seq_entry.hpp:56
CSeq_feat_Handle –.
CSubmit_block –.
int TFeatureIdInt
Find features by an integer FeatId.
Definition: tse_handle.hpp:170
ETopLevelObjectType
Type of top level object added to scope.
Definition: tse_handle.hpp:127
@ eTopLevel_Bioseq_set
Definition: tse_handle.hpp:129
CBlobIdKey TBlobId
TSE info getters.
Definition: tse_handle.hpp:100
CConstRef< CSeq_entry > GetCompleteTSE(void) const
Complete and get const reference to the seq-entry.
Definition: tse_handle.cpp:193
bool operator<(const CTSE_Handle &tse) const
Definition: tse_handle.hpp:353
CTSE_ScopeInfo TScopeInfo
Definition: tse_handle.hpp:289
vector< CAnnotObject_Info * > TAnnotObjectList
Definition: tse_handle.hpp:293
CConstRef< CSeq_entry > GetTSECore(void) const
Get const reference to the seq-entry.
Definition: tse_handle.cpp:199
bool operator==(const CTSE_Handle &tse) const
Definition: tse_handle.hpp:339
CSeq_entry TObject
Unified interface for templates.
Definition: tse_handle.hpp:119
CScope_Impl & x_GetScopeImpl(void) const
Definition: tse_handle.hpp:332
vector< CSeq_feat_Handle > TSeq_feat_Handles
Definition: tse_handle.hpp:167
string TFeatureIdStr
Find features by a string FeatId.
Definition: tse_handle.hpp:184
CHeapScope m_Scope
Definition: tse_handle.hpp:300
CObject_id TFeatureId
Find features by CObject_id (string or integer)
Definition: tse_handle.hpp:199
CConstRef< TObject > GetCompleteObject(void) const
Definition: tse_handle.hpp:367
void Swap(CTSE_Handle &tse)
Definition: tse_handle.hpp:381
bool operator!=(const CTSE_Handle &tse) const
Definition: tse_handle.hpp:346
CConstRef< TObject > GetObjectCore(void) const
Definition: tse_handle.hpp:374
CTSE_ScopeUserLock m_TSE
Definition: tse_handle.hpp:301
TScopeInfo & x_GetScopeInfo(void) const
Definition: tse_handle.hpp:360
DECLARE_OPERATOR_BOOL(IsValid())
CTSE_Handle(void)
Default constructor/destructor and assignment.
Definition: tse_handle.hpp:319
CScope & GetScope(void) const
Returns scope.
Definition: tse_handle.hpp:325
bool operator<(const CEquivRange &A, const CEquivRange &B)
bool operator==(const CEquivRange &A, const CEquivRange &B)
void Info(CExceptionArgs_Base &args)
Definition: ncbiexpt.hpp:1185
bool IsValid(const CSeq_point &pt, CScope *scope)
Checks that point >= 0 and point < length of Bioseq.
TObjectType * GetNonNullPointer(void)
Get pointer value and throw a null pointer exception if pointer is null.
Definition: ncbiobj.hpp:968
bool NotNull(void) const THROWS_NONE
Check if pointer is not null – same effect as NotEmpty().
Definition: ncbiobj.hpp:744
TObjectType * GetNonNullNCPointer(void) const
Get pointer value and throw a null pointer exception if pointer is null.
Definition: ncbiobj.hpp:1144
void Reset(void)
Reset reference object.
Definition: ncbiobj.hpp:773
void Swap(TThisType &ref)
Swaps the pointer with another reference.
Definition: ncbiobj.hpp:754
void Unlock(const CObject *object) const
Definition: ncbiobj.cpp:1158
void Lock(const CObject *object) const
Definition: ncbiobj.cpp:1143
TObjectType * GetPointerOrNull(void) THROWS_NONE
Get pointer value.
Definition: ncbiobj.hpp:986
#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
#define NCBI_XOBJMGR_EXPORT
Definition: ncbi_export.h:1307
E_Choice
Choice variants.
static MDB_envinfo info
Definition: mdb_load.c:37
void Swap(T &a, T &b) RAPIDJSON_NOEXCEPT
Custom swap() to avoid dependency on C++ <algorithm> header.
Definition: swap.h:33
const char * tag
Portable reference counted smart and weak pointers using CWeakRef, CRef, CObject and CObjectEx.
Definition: type.c:6
#define _ASSERT
CScope & GetScope()
Modified on Fri Sep 20 14:57:32 2024 by modify_doxy.py rev. 669887