PluginCommand.hpp
上传用户:yhdzpy8989
上传日期:2007-06-13
资源大小:13604k
文件大小:8k
- /*
- * ===========================================================================
- * PRODUCTION $Log: PluginCommand.hpp,v $
- * PRODUCTION Revision 1000.1 2004/04/12 18:14:42 gouriano
- * PRODUCTION PRODUCTION: UPGRADED [CATCHUP_003] Dev-tree R1.11
- * PRODUCTION
- * ===========================================================================
- */
- /* $Id: PluginCommand.hpp,v 1000.1 2004/04/12 18:14:42 gouriano Exp $
- * ===========================================================================
- *
- * PUBLIC DOMAIN NOTICE
- * National Center for Biotechnology Information
- *
- * This software/database is a "United States Government Work" under the
- * terms of the United States Copyright Act. It was written as part of
- * the author's official duties as a United States Government employee and
- * thus cannot be copyrighted. This software/database is freely available
- * to the public for use. The National Library of Medicine and the U.S.
- * Government have not placed any restriction on its use or reproduction.
- *
- * Although all reasonable efforts have been taken to ensure the accuracy
- * and reliability of the software and data, the NLM and the U.S.
- * Government do not and cannot warrant the performance or results that
- * may be obtained by using this software or data. The NLM and the U.S.
- * Government disclaim all warranties, express or implied, including
- * warranties of performance, merchantability or fitness for any particular
- * purpose.
- *
- * Please cite the author in any work or product based on this material.
- *
- * ===========================================================================
- *
- * Author: Mike DiCuccio, Denis Vakatov, Anatoliy Kuznetsov
- *
- * File Description:
- * CPluginCommand -- defines an interface for managing a single command
- * passed in to a plugin
- *
- * Remark:
- * This code was originally generated by application DATATOOL
- * using specifications from the data definition file
- * 'plugin.asn'.
- */
- #ifndef GUI_CORE_PLUGIN_PLUGINCOMMAND_HPP
- #define GUI_CORE_PLUGIN_PLUGINCOMMAND_HPP
- // generated includes
- #include <gui/plugin/PluginCommand_.hpp>
- #include <gui/plugin/PluginArg.hpp>
- // generated classes
- BEGIN_NCBI_SCOPE
- BEGIN_objects_SCOPE // namespace ncbi::objects::
- class CPluginValueConstraint;
- class NCBI_XGBPLUGIN_EXPORT CPluginCommand : public CPluginCommand_Base
- {
- typedef CPluginCommand_Base Tparent;
- public:
- // constructor
- CPluginCommand(void);
- // destructor
- ~CPluginCommand(void);
- // operator[] for indexing based on named argument
- // this will throw if the named argument isn't found
- const CPluginArg& operator[](const string& name) const;
- CPluginArg& operator[](const string& name);
- // HasArgument() can be used to verify whether a named argument exists
- bool HasArgument(const string& name) const;
- // add a named argument. This argument is required, and has no default
- // value. Attempts to access the value without setting the value will
- // result in an exception being thrown.
- CPluginArg& AddArgument(const string& name, const string& desc,
- CPluginArg::EType type,
- CPluginArg::TData::E_Choice single_or_array =
- CPluginArg::TData::e_Single);
- // add a named argument. This argument is required, and has no default
- // value. Attempts to access the value without setting the value will
- // result in an exception being thrown.
- CPluginArg& AddArgument(const string& name, const string& desc,
- const CTypeInfo* info,
- CPluginArg::TData::E_Choice single_or_array =
- CPluginArg::TData::e_Single);
- // Add a flag value. This is a helper API.
- CPluginArg& AddFlag(const string& name, const string& desc);
- // Add a default argument to the set of arguments. This function creates a
- // named argument with a default value of type string.
- CPluginArg& AddDefaultArgument(const string& name, const string& desc,
- CPluginArg::EType type, const string& val);
- // Add a flag argument with a default value. This is a helper API.
- CPluginArg& AddDefaultFlag(const string& name, const string& desc,
- bool val);
- // add an optional argument to the set of arguments. This supports an
- // optional default value argument. For non-built-in types, the default
- // value is ignored.
- CPluginArg& AddOptionalArgument(const string& name, const string& desc,
- CPluginArg::EType type,
- CPluginArg::TData::E_Choice single_or_array =
- CPluginArg::TData::e_Single);
- CPluginArg& AddOptionalArgument(const string& name, const string& desc,
- const CTypeInfo* info,
- CPluginArg::TData::E_Choice single_or_array =
- CPluginArg::TData::e_Single);
- // set the constraint for a named argument, removing all previous
- // constraints
- void SetConstraint(const string& name, CPluginValueConstraint& constraint);
- // add a constraint to a named argument.
- void AddConstraint(const string& name, CPluginValueConstraint& constraint);
- private:
- // Prohibit copy constructor and assignment operator
- CPluginCommand(const CPluginCommand& value);
- CPluginCommand& operator=(const CPluginCommand& value);
- };
- /////////////////// CPluginCommand inline methods
- // constructor
- inline
- CPluginCommand::CPluginCommand(void)
- {
- }
- /////////////////// end of CPluginCommand inline methods
- END_objects_SCOPE // namespace ncbi::objects::
- END_NCBI_SCOPE
- /*
- * ===========================================================================
- *
- * $Log: PluginCommand.hpp,v $
- * Revision 1000.1 2004/04/12 18:14:42 gouriano
- * PRODUCTION: UPGRADED [CATCHUP_003] Dev-tree R1.11
- *
- * Revision 1.11 2004/01/21 14:13:15 dicuccio
- * Added AddFlag() and AddDefaultFlag() - front-ends to AddArgument() and
- * AddDefaultArgument()
- *
- * Revision 1.10 2003/10/07 13:33:43 dicuccio
- * Renamed CPluginURL* to CPluginValue*. Dropped find_if.hpp. Moved validation
- * code into CPluginUtils.
- *
- * Revision 1.9 2003/07/31 16:43:32 dicuccio
- * Changed return value of AddArgument() functions to return the added argument
- *
- * Revision 1.8 2003/06/20 14:45:52 dicuccio
- * Revised handling of default arguments - now, all built-in argument types are
- * supported.
- *
- * Revision 1.7 2003/05/19 13:33:02 dicuccio
- * Moved gui/core/plugin --> gui/plugin/
- *
- * Revision 1.6 2003/05/09 16:43:57 dicuccio
- * Added interfaces forwarded to CPluginArgSet for non-const op[], HasArgument()
- *
- * Revision 1.5 2003/04/30 13:52:45 dicuccio
- * Added interface for creating multiple constraints for a given argument
- *
- * Revision 1.4 2003/04/25 14:13:17 dicuccio
- * Changed API for optional arguments - permit data model objects as optional
- * components; eliminate old "optional-and-default" combination
- *
- * Revision 1.3 2003/04/24 16:17:07 dicuccio
- * Clarified addition of arguments that take data-model types
- *
- * Revision 1.2 2003/03/03 14:22:04 dicuccio
- * Added argument constraints - lower bound, upper bound, range, and member-of-set
- *
- * Revision 1.1 2003/02/24 13:00:18 dicuccio
- * Renamed classes in plugin spec:
- * CArgSeg --> CPluginArgSet
- * CArgument --> CPluginArg
- * CPluginArgs --> CPluginCommand
- * CPluginCommands --> CPluginCommandSet
- *
- * Revision 1.2 2003/02/21 16:44:13 dicuccio
- * Added Win32 export specifiers for new plugin library. Fixed compilation
- * issues for Win32.
- *
- * Revision 1.1 2003/02/20 19:44:06 dicuccio
- * Created new plugin architecture, mediated via an ASN.1 spec. Moved GBENCH
- * framework over to use new plugin architecture.
- *
- *
- * ===========================================================================
- */
- #endif // GUI_CORE_PLUGIN_PLUGINCOMMAND_HPP
- /* Original file checksum: lines: 93, chars: 2416, CRC32: 45677dc4 */