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

Go to the SVN repository for this file.

1 /* $Id: PluginArgSet.hpp 14666 2007-07-09 13:40:22Z dicuccio $
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  * CPluginArgSet -- defines an interface for a collection of arguments for a
30  * plugin
31  *
32  * Remark:
33  * This code was originally generated by application DATATOOL
34  * using specifications from the data definition file
35  * 'plugin.asn'.
36  */
37 
38 #ifndef GUI_CORE_PLUGIN_PLUGINARGSET_HPP
39 #define GUI_CORE_PLUGIN_PLUGINARGSET_HPP
40 
41 
42 // generated includes
46 
47 // generated classes
48 
50 
51 BEGIN_objects_SCOPE /// namespace ncbi::objects::
52 
53 
54 //
55 // class CPluginArgSet is the primary argument interface class.
56 //
57 
59 {
61 public:
62  /// constructor
63  CPluginArgSet(void);
64  /// destructor
65  ~CPluginArgSet(void);
66 
67  /// operator[] for indexing based on named argument
68  /// this will throw if the named argument isn't found
69  const CPluginArg& operator[](const string& name) const;
70 
71  /// operator[] for indexing based on named argument (non-const)
72  /// this will throw if the named argument isn't found
73  CPluginArg& operator[](const string& name);
74 
75  /// Clear all objects from object-based arguments
76  void ClearObjects();
77 
78  /// HasArgument() verifies that an argument exists
79  bool HasArgument(const string& name) const;
80 
81  /// Delete an existing argument
82  void RemoveArgument(const string& arg_name);
83 
84  /// add a named argument. This argument is required, and has no default
85  /// value. Attempts to access the value without setting the value will
86  /// result in an exception being thrown.
87  CPluginArg& AddArgument(const string& name, const string& desc,
89  CPluginArg::TData::E_Choice single_or_array =
91 
92  /// add a named argument. This argument is required, and has no default
93  /// value. Attempts to access the value without setting the value will
94  /// result in an exception being thrown.
95  CPluginArg& AddArgument(const string& name, const string& desc,
96  const CTypeInfo* info,
97  CPluginArg::TData::E_Choice single_or_array =
99 
100  /// Add a flag value. This is a helper API; the request is reformatted
101  /// and passed on to AddArgument()
102  CPluginArg& AddFlag(const string& name, const string& desc);
103 
104  /// Add a default argument to the set of arguments. This function creates a
105  /// named argument with a default value of type string.
106  CPluginArg& AddDefaultArgument(const string& name,
107  const string& description,
108  CPluginArg::EType type, const string& val);
109 
110  /// Add a flag argument with a default value. This is a helper API; the
111  /// request is reformatted and passed on to AddDefaultArgument
112  CPluginArg& AddDefaultFlag(const string& name, const string& desc,
113  bool val);
114 
115  /// add an optional argument to the set of arguments. This supports an
116  /// optional default value argument. For non-built-in types, the default
117  /// value is ignored.
118  CPluginArg&
119  AddOptionalArgument(const string& name,
120  const string& description,
122  CPluginArg::TData::E_Choice single_or_array =
124 
125  CPluginArg&
126  AddOptionalArgument(const string& name, const string& description,
127  const CTypeInfo* info,
128  CPluginArg::TData::E_Choice single_or_array =
130 
131  /// Set the constraint of a named argument. This will throw an exception if
132  /// the argument is not found, and will replace all previous constraints if
133  /// the argument is found
134  void SetConstraint(const string& name, CPluginValueConstraint& constraint);
135 
136  /// Add a constraint to a named argument. This will throw an exception if
137  /// the argument is not found
138  void AddConstraint(const string& name, CPluginValueConstraint& constraint);
139 
140  /// Remove the constraint of a named argument. This will throw an exception if
141  /// the argument is not found.
142  void RemoveConstraint(const string& name);
143 
144 private:
145 
146  /// Prohibit copy constructor and assignment operator
149 };
150 
151 
152 
153 /////////////////// CPluginArgSet inline methods
154 
155 // constructor
156 inline
158 {
159 }
160 
161 
162 /////////////////// end of CPluginArgSet inline methods
163 
164 
165 END_objects_SCOPE /// namespace ncbi::objects::
166 
168 
169 #endif /// GUI_CORE_PLUGIN_PLUGINARGSET_HPP
170 /* Original file checksum: lines: 93, chars: 2348, CRC32: 56c3af4a */
Data storage class.
namespace ncbi::objects::
CPluginArgSet & operator=(const CPluginArgSet &value)
CPluginArgSet_Base Tparent
CPluginArgSet(const CPluginArgSet &value)
Prohibit copy constructor and assignment operator.
CPluginArgSet(void)
constructor
EType
enumerated list of types we support
Definition: PluginArg.hpp:69
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 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
E_Choice
Choice variants.
Definition: PluginArg_.hpp:115
static MDB_envinfo info
Definition: mdb_load.c:37
Definition: type.c:6
Modified on Sat Feb 24 07:49:44 2024 by modify_doxy.py rev. 669887