NCBI C++ ToolKit
wig_load_params.cpp
Go to the documentation of this file.

Go to the SVN repository for this file.

1 /* $Id: wig_load_params.cpp 39666 2017-10-25 16:01:13Z katargir $
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  * Authors: Roman Katargin
27  */
28 
29 
30 #include <ncbi_pch.hpp>
31 
33 
35 
37 
39 
40 /*!
41  * CWigLoadParams type definition
42  */
43 
44 /*!
45  * Default constructor for CWigLoadParams
46  */
47 
49 {
50  Init();
51 }
52 
53 /*!
54  * Copy constructor for CWigLoadParams
55  */
56 
58 {
59  Init();
60  Copy(data);
61 }
62 
63 /*!
64  * Destructor for CWigLoadParams
65  */
66 
68 {
69 }
70 
71 /*!
72  * Assignment operator for CWigLoadParams
73  */
74 
76 {
77  Copy(data);
78 }
79 
80 /*!
81  * Equality operator for CWigLoadParams
82  */
83 
85 {
86 ////@begin CWigLoadParams equality operator
87  if (!(m_NumErrors == data.m_NumErrors)) return false;
88  if (!(m_MapAssembly == data.m_MapAssembly)) return false;
89 ////@end CWigLoadParams equality operator
90  return true;
91 }
92 
93 /*!
94  * Copy function for CWigLoadParams
95  */
96 
98 {
99 ////@begin CWigLoadParams copy function
100  m_NumErrors = data.m_NumErrors;
101  m_MapAssembly = data.m_MapAssembly;
102 ////@end CWigLoadParams copy function
103 }
104 
105 /*!
106  * Member initialisation for CWigLoadParams
107  */
108 
110 {
111 ////@begin CWigLoadParams member initialisation
112  m_NumErrors = 10;
113 ////@end CWigLoadParams member initialisation
114 }
115 
116 static const char* kNumErrors = "NumErrors";
117 static const char* kMapAssembly = ".MapAssembly";
118 
119 /// IRegSettings
121 {
122  if (!m_RegPath.empty()) {
124  CRegistryWriteView view = gui_reg.GetWriteView(m_RegPath);
125 
126  view.Set(kNumErrors, m_NumErrors);
127 
128  view = gui_reg.GetWriteView(m_RegPath + kMapAssembly);
130  }
131 }
132 
134 {
135  if (!m_RegPath.empty()) {
137  CRegistryReadView view = gui_reg.GetReadView(m_RegPath);
138 
140 
141  view = gui_reg.GetReadView(m_RegPath + kMapAssembly);
143  }
144 }
145 
CRegistryWriteView GetWriteView(const string &section)
get a read-write view at a particular level.
Definition: registry.cpp:462
static CGuiRegistry & GetInstance()
access the application-wide singleton
Definition: registry.cpp:400
CRegistryReadView GetReadView(const string &section) const
get a read-only view at a particular level.
Definition: registry.cpp:428
void LoadSettings(CRegistryReadView &view)
void SaveSettings(CRegistryWriteView &view) const
class CRegistryReadView provides a nested hierarchical view at a particular key.
Definition: reg_view.hpp:58
int GetInt(const string &key, int default_val=0) const
access a named key at this level, with no recursion
Definition: reg_view.cpp:230
void Set(const string &key, int val)
access a named key at this level, with no recursion
Definition: reg_view.cpp:533
bool operator==(const CWigLoadParams &data) const
Equality operator for CWigLoadParams.
CWigLoadParams()
Default constructor for CWigLoadParams.
CMapAssemblyParams m_MapAssembly
virtual void SaveSettings() const
IRegSettings.
void operator=(const CWigLoadParams &data)
Assignment operator for CWigLoadParams.
virtual void LoadSettings()
void Init()
Initialises member variables.
void Copy(const CWigLoadParams &data)
Copy function for CWigLoadParams.
~CWigLoadParams()
Destructor for CWigLoadParams.
char data[12]
Definition: iconv.c:80
#define END_NCBI_SCOPE
End previously defined NCBI scope.
Definition: ncbistl.hpp:103
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
Definition: ncbistl.hpp:100
static const char * kNumErrors
static const char * kMapAssembly
Modified on Sun May 12 04:53:55 2024 by modify_doxy.py rev. 669887