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

Go to the SVN repository for this file.

1 /* $Id: PluginArg.hpp 30280 2014-04-23 20:28:26Z 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  * Author: Mike DiCuccio, Denis Vakatov, Anatoliy Kuznetsov
27  *
28  * File Description:
29  * CPluginArg -- defines an interface for a single plugin argument
30  *
31  * Remark:
32  * This code was originally generated by application DATATOOL
33  * using specifications from the data definition file
34  * 'plugin.asn'.
35  */
36 
37 #ifndef GUI_CORE_PLUGIN_PLUGINARG_HPP
38 #define GUI_CORE_PLUGIN_PLUGINARG_HPP
39 
40 
41 // generated includes
43 
44 // generated classes
45 
47 
48 // predeclarations
49 class CObject;
50 
51 BEGIN_objects_SCOPE /// namespace ncbi::objects::
52 
53 class CDataHandle;
54 class CGBProjectHandle;
55 
56 
58 {
60 public:
61 
62 
63  /// constructor
64  CPluginArg(void);
65  /// destructor
66  ~CPluginArg(void);
67 
68  /// enumerated list of types we support
69  enum EType {
71 
81 
82  /// special type: could be any CSerialObject-derived object
84 
85  /// this must be last!
86  eMaxArg
87  };
88 
89  /// typedefs for collections of argument types
90  /// CPluginValue supports type-specific data retrieval of single entities
91  /// and also wraps the necessary document
92  typedef list< CConstRef<CPluginValue> > TValues;
93 
94  /// access the type for this argument
95  EType GetType(void) const;
96 
97  /// determine if this argument is empty (i.e., has all type information but
98  /// no values)
99  bool IsEmpty(void) const;
100 
101  /// clear any objects from object-based arguments
102  void ClearObjects();
103 
104  /// accessors for specific sub-components
105  /// in the event that the data type is list, NULL is returned
106  const CGBProjectHandle* GetProject (void) const;
107  const CObject* GetObject (void) const;
108 
109  /// accessor for the object-specific type info
110  /// in the event the data type is list, the type info for the first
111  /// item is returned, as we guarantee that all items in a list will
112  /// be equivalently typed
113  const string& GetObjectSubtype(void) const;
114 
115  /// set this argument as an integer
116  void SetBoolean(void);
117  void SetBoolean(bool arg);
118  void SetBoolean(const list<bool>& arg);
119  bool AsBoolean (void) const;
120 
121  /// set this argument as an integer
122  void SetInteger(void);
123  void SetInteger(const string& arg);
124  void SetInteger(int arg);
125  void SetInteger(const list<int>& arg);
126  int AsInteger (void) const;
127 
128  /// set this argument as a double
129  void SetDouble(void);
130  void SetDouble(const string& arg);
131  void SetDouble(double arg);
132  void SetDouble(const list<double>& arg);
133  double AsDouble (void) const;
134 
135  /// set this argument as a string
136  void SetString(void);
137  void SetString(const string& arg);
138  void SetString(const list<string>& arg);
139  const string& AsString (void) const;
140 
141  /// set this argument as a secret string
142  void SetSecretString(void);
143  void SetSecretString(const string& arg);
144  void SetSecretString(const list<string>& arg);
145  const string& AsSecretString (void) const;
146 
147  /// set this argument as an input file
148  void SetInputFile(void);
149  void SetInputFile(const string& arg);
150  void SetInputFile(const list<string>& arg);
151  const string& AsInputFile (void) const;
152 
153  /// set this argument as an output file
154  void SetOutputFile(void);
155  void SetOutputFile(const string& arg);
156  void SetOutputFile(const list<string>& arg);
157  const string& AsOutputFile (void) const;
158 
159  /// set this argument as a CGBProjectHandle
160  void SetProject(void);
161  void SetProject(const CGBProjectHandle& arg);
162  void SetProject(const TValues& arg);
163  const CGBProjectHandle& AsProject (void) const;
164 
165  /// set this argument as a CObject. There are multiple forms of this;
166  /// we provide for the passing in of a CTypeInfo object that provides
167  /// additional information, specifically about CSerialObject-derived
168  /// objects
169  void SetObject(const string& type);
170  void SetObject(const CTypeInfo* info = NULL);
171  void SetObject(const CObject& arg, const CGBProjectHandle* doc = NULL, const CDataHandle * dh = NULL);
172  void SetObject(const TValues& arg);
173  const CObject& AsObject (void) const;
174 
175  /// insure that this argument can accept a list of its current type
176  void SetList(void);
177  void SetList(const TValues& values);
178  void AsList(TValues& values) const;
179 
180 private:
181  /// Prohibit copy constructor and assignment operator
184 };
185 
186 
187 /////////////////// CPluginArg inline methods
188 
189 // constructor
190 inline
192 {
193 }
194 
195 
196 /////////////////// end of CPluginArg inline methods
197 
198 
199 END_objects_SCOPE /// namespace ncbi::objects::
200 
202 
203 #endif /// GUI_CORE_PLUGIN_PLUGINARG_HPP
204 /* Original file checksum: lines: 93, chars: 2382, CRC32: fb41a3 */
Data storage class.
CObject –.
Definition: ncbiobj.hpp:180
EType
enumerated list of types we support
Definition: PluginArg.hpp:69
@ eAnySerialObject
special type: could be any CSerialObject-derived object
Definition: PluginArg.hpp:83
list< CConstRef< CPluginValue > > TValues
typedefs for collections of argument types CPluginValue supports type-specific data retrieval of sing...
Definition: PluginArg.hpp:92
CPluginArg_Base Tparent
Definition: PluginArg.hpp:59
CPluginArg & operator=(const CPluginArg &value)
CPluginArg(const CPluginArg &value)
Prohibit copy constructor and assignment operator.
CPluginArg(void)
constructor
Definition: PluginArg.hpp:191
CTypeInfo class contains all information about C++ types (both basic and classes): members and layout...
Definition: typeinfo.hpp:76
char value[7]
Definition: config.c:431
#define NULL
Definition: ncbistd.hpp:225
#define END_NCBI_SCOPE
End previously defined NCBI scope.
Definition: ncbistl.hpp:103
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
Definition: ncbistl.hpp:100
#define NCBI_GUIOBJECTS_EXPORT
Definition: gui_export.h:511
static MDB_envinfo info
Definition: mdb_load.c:37
CProject * GetProject(wxTreeCtrl &treeCtrl, const CItem &item)
Definition: pt_utils.cpp:77
Definition: type.c:6
static bool SetInteger(wxSpinCtrl *spinctrl, int value)
Modified on Thu Mar 28 17:13:25 2024 by modify_doxy.py rev. 669887