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

Go to the SVN repository for this file.

1 /* $Id: test_objmgr.hpp 102081 2024-03-28 14:38:47Z grichenk $
2 * ===========================================================================
3 *
4 * PUBLIC DOMAIN NOTICE
5 * National Center for Biotechnology Information
6 *
7 * This software/database is a "United States Government Work" under the
8 * terms of the United States Copyright Act. It was written as part of
9 * the author's official duties as a United States Government employee and
10 * thus cannot be copyrighted. This software/database is freely available
11 * to the public for use. The National Library of Medicine and the U.S.
12 * Government have not placed any restriction on its use or reproduction.
13 *
14 * Although all reasonable efforts have been taken to ensure the accuracy
15 * and reliability of the software and data, the NLM and the U.S.
16 * Government do not and cannot warrant the performance or results that
17 * may be obtained by using this software or data. The NLM and the U.S.
18 * Government disclaim all warranties, express or implied, including
19 * warranties of performance, merchantability or fitness for any particular
20 * purpose.
21 *
22 * Please cite the author in any work or product based on this material.
23 *
24 * ===========================================================================
25 *
26 * Author: Christiam Camacho
27 *
28 * File Description:
29 * Singleton class to facilitate the creation of SSeqLocs.
30 *
31 * ===========================================================================
32 */
33 #ifndef _TEST_OBJMRG_HPP
34 #define _TEST_OBJMRG_HPP
35 
37 #include <util/range.hpp>
39 
41 
42 #ifndef SKIP_DOXYGEN_PROCESSING
43 
44 // Forward declarations
47  class CSeq_id;
48  class CObjectManager;
50 BEGIN_SCOPE(blast)
51  struct SSeqLoc;
52 END_SCOPE(blast)
54 
56 
57 /// This class wraps the C++ Object Manager to control its lifetime and to
58 /// facilitate the creation of SSeqLoc structures. One CScope is created for
59 /// each sequence requested to avoid having multiple sequences in once CScope.
60 class CTestObjMgr {
61 
62 public:
63  static CTestObjMgr& Instance();
64  blast::SSeqLoc* CreateSSeqLoc(objects::CSeq_id& id,
67 
68  blast::SSeqLoc* CreateSSeqLoc(objects::CSeq_id& id,
69  pair<TSeqPos, TSeqPos> range,
72 
73  blast::SSeqLoc* CreateSSeqLoc(objects::CSeq_id& id,
74  TSeqRange const & range,
77 
78  blast::SSeqLoc* CreateWholeSSeqLoc(objects::CSeq_id& id);
79 
80  blast::SSeqLoc* CreateEmptySSeqLoc(objects::CSeq_id& id);
81 
83  CreateBlastSearchQuery(objects::CSeq_id& id,
86 
87  objects::CObjectManager& GetObjMgr();
88 
89  ~CTestObjMgr();
90 private:
92  static unique_ptr<CTestObjMgr> m_Instance;
93 
94  CTestObjMgr();
95  CTestObjMgr(const CTestObjMgr& rhs);
96  const CTestObjMgr& operator=(const CTestObjMgr& rhs);
97 };
98 
99 #endif /* SKIP_DOXYGEN_PROCESSING */
100 
101 #endif // _TEST_OBJMRG_HPP
CObjectManager –.
CRef –.
Definition: ncbiobj.hpp:618
This class wraps the C++ Object Manager to control its lifetime and to facilitate the creation of SSe...
Definition: test_objmgr.hpp:60
blast::SSeqLoc * CreateSSeqLoc(objects::CSeq_id &id, objects::ENa_strand s=objects::eNa_strand_unknown)
CRef< blast::CBlastSearchQuery > CreateBlastSearchQuery(objects::CSeq_id &id, objects::ENa_strand s=objects::eNa_strand_unknown)
const CTestObjMgr & operator=(const CTestObjMgr &rhs)
objects::CObjectManager & GetObjMgr()
Definition: test_objmgr.cpp:78
CTestObjMgr(const CTestObjMgr &rhs)
blast::SSeqLoc * CreateSSeqLoc(objects::CSeq_id &id, pair< TSeqPos, TSeqPos > range, objects::ENa_strand s=objects::eNa_strand_unknown)
blast::SSeqLoc * CreateEmptySSeqLoc(objects::CSeq_id &id)
static CTestObjMgr & Instance()
Definition: test_objmgr.cpp:69
static unique_ptr< CTestObjMgr > m_Instance
Definition: test_objmgr.hpp:92
blast::SSeqLoc * CreateWholeSSeqLoc(objects::CSeq_id &id)
blast::SSeqLoc * CreateSSeqLoc(objects::CSeq_id &id, TSeqRange const &range, objects::ENa_strand s=objects::eNa_strand_unknown)
CRef< objects::CObjectManager > m_ObjMgr
Definition: test_objmgr.hpp:91
Ensure direct dependencies on enough of the core xncbi library to satisfy shared libraries that depen...
#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
ENa_strand
strand of nucleic acid
Definition: Na_strand_.hpp:64
@ eNa_strand_unknown
Definition: Na_strand_.hpp:65
range(_Ty, _Ty) -> range< _Ty >
Definition of SSeqLoc structure.
Structure to represent a single sequence to be fed to BLAST.
Definition: sseqloc.hpp:47
USING_NCBI_SCOPE
Definition: test_objmgr.hpp:51
Modified on Fri Sep 20 14:57:33 2024 by modify_doxy.py rev. 669887