- /*
- * ===========================================================================
- * PRODUCTION $Log: algo_factory.hpp,v $
- * PRODUCTION Revision 1000.1 2004/04/12 18:12:04 gouriano
- * PRODUCTION PRODUCTION: UPGRADED [CATCHUP_003] Dev-tree R1.9
- * PRODUCTION
- * ===========================================================================
- */
- #ifndef GUI_CORE___ALGO_FACTORY__HPP
- #define GUI_CORE___ALGO_FACTORY__HPP
- /* $Id: algo_factory.hpp,v 1000.1 2004/04/12 18:12:04 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.
- *
- * ===========================================================================
- *
- * Authors: Mike DiCuccio
- *
- * File Description:
- * CAlgoFactory -- templatized base class for algorithm plugins, providing
- * standard support for launching plugins
- */
- #include <gui/plugin/PluginCommand.hpp>
- #include <gui/plugin/PluginReply.hpp>
- #include <gui/plugin/PluginArgSet.hpp>
- #include <gui/core/context_factory.hpp>
- #include <gui/plugin/MessageStatus.hpp>
- BEGIN_NCBI_SCOPE
- template <class AlgoType>
- class CAlgoFactory : public CContextFactory<AlgoType>
- {
- public:
- virtual CPluginBase* GetPlugin(void)
- {
- return new AlgoType;
- }
- };
- // Macros for easily defining and registering unique factory names and
- // instances
- #define DECLARE_ALGO_FACTORY(name)
- static CAlgoFactory<name> s_AlgoFactory_##name
- #define REGISTER_ALGO_PLUGIN(name)
- plugins.push_back(&s_AlgoFactory_##name)
- END_NCBI_SCOPE
- #endif // GUI_CORE___ALGO_FACTORY__HPP
- /*
- * ===========================================================================
- * $Log: algo_factory.hpp,v $
- * Revision 1000.1 2004/04/12 18:12:04 gouriano
- * PRODUCTION: UPGRADED [CATCHUP_003] Dev-tree R1.9
- *
- * Revision 1.9 2003/12/22 19:10:05 dicuccio
- * Don't swallow the trailing ';' on macros
- *
- * Revision 1.8 2003/08/22 15:52:50 dicuccio
- * Removed 'USING_SCOPE(objects)'
- *
- * Revision 1.7 2003/07/14 10:56:35 shomrat
- * Plugin messageing system related changes
- *
- * Revision 1.6 2003/06/25 16:59:41 dicuccio
- * Changed CPluginHandle into a pointer-to-implementation (the previous
- * implementation is now the pointer held). Lots of #include file clean-ups.
- *
- * Revision 1.5 2003/06/20 14:44:36 dicuccio
- * Revamped handling of plugin registration. All plugin factories now derive
- * from CPluginFactoryBase; CPluginFactory is a template. There is a new
- * requirement for derived plugin handlers of all types (each must implement a
- * static function of the form 'static void GetInfo(CPluginInfo&)')
- *
- * Revision 1.4 2003/05/19 13:32:43 dicuccio
- * Moved gui/core/plugin --> gui/plugin/
- *
- * Revision 1.3 2003/02/24 13:00:17 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.
- *
- * ===========================================================================
- */