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

Go to the SVN repository for this file.

1 /* $Id: windowmasker_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: Vladimir Tereshkov
27  */
28 
29 
30 #include <ncbi_pch.hpp>
31 
33 
35 
37 
38 /*!
39  * CWindowMaskerParams type definition
40  */
41 
42 /*!
43  * Default constructor for CWindowMaskerParams
44  */
45 
47 {
48  Init();
49 }
50 
51 /*!
52  * Copy constructor for CWindowMaskerParams
53  */
54 
56 {
57  Init();
58  Copy(data);
59 }
60 
61 /*!
62  * Destructor for CWindowMaskerParams
63  */
64 
66 {
67 }
68 
69 /*!
70  * Assignment operator for CWindowMaskerParams
71  */
72 
74 {
75  Copy(data);
76 }
77 
78 /*!
79  * Equality operator for CWindowMaskerParams
80  */
81 
83 {
84 ////@begin CWindowMaskerParams equality operator
85  if (!(m_Standalone == data.m_Standalone)) return false;
86  if (!(m_OutputType == data.m_OutputType)) return false;
87  if (!(m_TaxId == data.m_TaxId)) return false;
88 ////@end CWindowMaskerParams equality operator
89  return true;
90 }
91 
92 /*!
93  * Copy function for CWindowMaskerParams
94  */
95 
97 {
98 ////@begin CWindowMaskerParams copy function
99  m_Standalone = data.m_Standalone;
100  m_OutputType = data.m_OutputType;
101  m_TaxId = data.m_TaxId;
102 ////@end CWindowMaskerParams copy function
103 
104  m_Objects = data.m_Objects;
105 }
106 
107 /*!
108  * Member initialisation for CWindowMaskerParams
109  */
110 
112 {
113 ////@begin CWindowMaskerParams member initialisation
114  m_Standalone = true;
115  m_OutputType = 0;
116  m_TaxId = 0;
117 ////@end CWindowMaskerParams member initialisation
118 }
119 
120 /// IRegSettings
121 void CWindowMaskerParams::SetRegistryPath(const string& path)
122 {
123  m_RegPath = path;
124 }
125 
126 static const char* kStandalone = "Standalone";
127 static const char* kOutputType = "OutputType";
128 static const char* kTaxId = "TaxId";
129 
131 {
132  if (!m_RegPath.empty()) {
134  CRegistryWriteView view = gui_reg.GetWriteView(m_RegPath);
135 
138  view.Set(kTaxId, m_TaxId);
139  }
140 }
141 
143 {
144  if (!m_RegPath.empty()) {
146  CRegistryReadView view = gui_reg.GetReadView(m_RegPath);
147 
150  m_TaxId = view.GetInt(kTaxId, m_TaxId);
151  }
152 }
153 
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
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
bool GetBool(const string &key, bool default_val=false) const
Definition: reg_view.cpp:241
void Set(const string &key, int val)
access a named key at this level, with no recursion
Definition: reg_view.cpp:533
TConstScopedObjects m_Objects
CWindowMaskerParams()
Default constructor for CWindowMaskerParams.
~CWindowMaskerParams()
Destructor for CWindowMaskerParams.
void Init()
Initialises member variables.
virtual void SetRegistryPath(const string &path)
IRegSettings.
bool operator==(const CWindowMaskerParams &data) const
Equality operator for CWindowMaskerParams.
virtual void SaveSettings() const
void Copy(const CWindowMaskerParams &data)
Copy function for CWindowMaskerParams.
void operator=(const CWindowMaskerParams &data)
Assignment operator for CWindowMaskerParams.
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 * kStandalone
static const char * kTaxId
static const char * kOutputType
Modified on Fri Sep 20 14:58:31 2024 by modify_doxy.py rev. 669887