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

Go to the SVN repository for this file.

1 /* $Id: PluginCommand.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  * CPluginCommand -- defines an interface for managing a single command
30  * passed in to a 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_PLUGINCOMMAND_HPP
39 #define GUI_CORE_PLUGIN_PLUGINCOMMAND_HPP
40 
41 
42 // generated includes
45 
46 // generated classes
47 
49 
50 BEGIN_objects_SCOPE /// namespace ncbi::objects::
51 
53 
54 
56 {
58 public:
59  /// constructor
60  CPluginCommand(void);
61  /// destructor
62  ~CPluginCommand(void);
63 
64  /// operator[] for indexing based on named argument
65  /// this will throw if the named argument isn't found
66  const CPluginArg& operator[](const string& name) const;
67  CPluginArg& operator[](const string& name);
68 
69  /// Clear all objects from object-based arguments
70  void ClearObjects();
71 
72  /// HasArgument() can be used to verify whether a named argument exists
73  bool HasArgument(const string& name) const;
74 
75  /// add a named argument. This argument is required, and has no default
76  /// value. Attempts to access the value without setting the value will
77  /// result in an exception being thrown.
78  CPluginArg& AddArgument(const string& name, const string& desc,
80  CPluginArg::TData::E_Choice single_or_array =
82 
83  /// add a named argument. This argument is required, and has no default
84  /// value. Attempts to access the value without setting the value will
85  /// result in an exception being thrown.
86  CPluginArg& AddArgument(const string& name, const string& desc,
87  const CTypeInfo* info,
88  CPluginArg::TData::E_Choice single_or_array =
90 
91  /// Add a flag value. This is a helper API.
92  CPluginArg& AddFlag(const string& name, const string& desc);
93 
94  /// Add a default argument to the set of arguments. This function creates a
95  /// named argument with a default value of type string.
96  CPluginArg& AddDefaultArgument(const string& name, const string& desc,
97  CPluginArg::EType type, const string& val);
98 
99  /// Add a flag argument with a default value. This is a helper API.
100  CPluginArg& AddDefaultFlag(const string& name, const string& desc,
101  bool val);
102 
103  /// add an optional argument to the set of arguments. This supports an
104  /// optional default value argument. For non-built-in types, the default
105  /// value is ignored.
106  CPluginArg& AddOptionalArgument(const string& name, const string& desc,
108  CPluginArg::TData::E_Choice single_or_array =
110 
111  CPluginArg& AddOptionalArgument(const string& name, const string& desc,
112  const CTypeInfo* info,
113  CPluginArg::TData::E_Choice single_or_array =
115 
116  /// set the constraint for a named argument, removing all previous
117  /// constraints
118  void SetConstraint(const string& name, CPluginValueConstraint& constraint);
119 
120  /// add a constraint to a named argument.
121  void AddConstraint(const string& name, CPluginValueConstraint& constraint);
122 
123  /// Delete an existing argument
124  void RemoveArgument(const string& arg_name);
125 
126 private:
127  /// Prohibit copy constructor and assignment operator
130 
131 };
132 
133 
134 
135 /////////////////// CPluginCommand inline methods
136 
137 // constructor
138 inline
140 {
141 }
142 
143 
144 /////////////////// end of CPluginCommand inline methods
145 
146 
147 END_objects_SCOPE /// namespace ncbi::objects::
148 
150 
151 #endif /// GUI_CORE_PLUGIN_PLUGINCOMMAND_HPP
152 /* Original file checksum: lines: 93, chars: 2416, CRC32: 45677dc4 */
Data storage class.
EType
enumerated list of types we support
Definition: PluginArg.hpp:69
CPluginCommand(void)
constructor
CPluginCommand & operator=(const CPluginCommand &value)
CPluginCommand_Base Tparent
CPluginCommand(const CPluginCommand &value)
Prohibit copy constructor and assignment operator.
CTypeInfo class contains all information about C++ types (both basic and classes): members and layout...
Definition: typeinfo.hpp:76
#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
const GenericPointer< typename T::ValueType > T2 value
Definition: pointer.h:1227
Definition: type.c:6
Modified on Fri Apr 12 17:22:34 2024 by modify_doxy.py rev. 669887