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

Go to the SVN repository for this file.

1 #ifndef WRITER_INTERFACE__HPP_INCLUDED
2 #define WRITER_INTERFACE__HPP_INCLUDED
3 /* */
4 
5 /* $Id: writer_interface.hpp 71299 2016-02-24 19:31:13Z vasilche $
6 * ===========================================================================
7 * PUBLIC DOMAIN NOTICE
8 * National Center for Biotechnology Information
9 *
10 * This software/database is a "United States Government Work" under the
11 * terms of the United States Copyright Act. It was written as part of
12 * the author's official duties as a United States Government employee and
13 * thus cannot be copyrighted. This software/database is freely available
14 * to the public for use. The National Library of Medicine and the U.S.
15 * Government have not placed any restriction on its use or reproduction.
16 *
17 * Although all reasonable efforts have been taken to ensure the accuracy
18 * and reliability of the software and data, the NLM and the U.S.
19 * Government do not and cannot warrant the performance or results that
20 * may be obtained by using this software or data. The NLM and the U.S.
21 * Government disclaim all warranties, express or implied, including
22 * warranties of performance, merchantability or fitness for any particular
23 * purpose.
24 *
25 * Please cite the author in any work or product based on this material.
26 * ===========================================================================
27 *
28 * Author: Eugene Vasilchenko
29 *
30 * File Description: Base data writer interface
31 *
32 */
33 
35 
38 
39 class CWriter;
41 {
42 public:
44  (const string& interface_name,
45  const string& driver_name = kEmptyStr,
48  : CPluginManager_DllResolver(interface_name,
49  driver_name,
50  version,
51  unload_dll)
52  {
53  }
54 
55  virtual
56  string GetDllName(const string& /*interface_name*/,
57  const string& driver_name = kEmptyStr,
59  const
60  {
62  driver_name,
63  version);
64  }
65  virtual
66  string GetDllNameMask(const string& /*interface_name*/,
67  const string& driver_name = kEmptyStr,
70  const
71  {
73  driver_name,
74  version,
75  ver_lct);
76  }
77 };
78 
80 
82 
83 template<>
85 {
86 public:
88  {
89  CPluginManager_DllResolver* resolver =
90  new objects::CGB_Writer_PluginManager_DllResolver
91  ("xwriter",
92  kEmptyStr,
95  resolver->SetDllNamePrefix("ncbi");
96  return resolver;
97  }
98 };
99 
101 
102 #endif//WRITER_INTERFACE__HPP_INCLUDED
CPluginManager_DllResolver * operator()(void)
Template function to create dll resolver for interface.
virtual string GetDllNameMask(const string &, const string &driver_name=kEmptyStr, const CVersionInfo &version=CVersionInfo::kAny, EVersionLocation ver_lct=eBeforeSuffix) const
Return DLL name mask.
CGB_Writer_PluginManager_DllResolver(const string &interface_name, const string &driver_name=kEmptyStr, const CVersionInfo &version=CVersionInfo::kAny, CDll::EAutoUnload unload_dll=CDll::eNoAutoUnload)
virtual string GetDllName(const string &, const string &driver_name=kEmptyStr, const CVersionInfo &version=CVersionInfo::kAny) const
Return dll file name.
Service class for DLLs resolution.
CVersionInfo –.
EAutoUnload
Whether to unload DLL in the destructor.
Definition: ncbidll.hpp:143
@ eAutoUnload
Definition: ncbidll.hpp:144
@ eNoAutoUnload
Definition: ncbidll.hpp:145
virtual void SetDllNamePrefix(const string &prefix)
Set DLL file name prefix.
virtual string GetDllNameMask(const string &interface_name, const string &driver_name=kEmptyStr, const CVersionInfo &version=CVersionInfo::kAny, EVersionLocation ver_lct=eBeforeSuffix) const
Return DLL name mask.
virtual string GetDllName(const string &interface_name, const string &driver_name=kEmptyStr, const CVersionInfo &version=CVersionInfo::kAny) const
Return dll file name.
#define END_NCBI_SCOPE
End previously defined NCBI scope.
Definition: ncbistl.hpp:103
#define END_SCOPE(ns)
End the previously defined scope.
Definition: ncbistl.hpp:75
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
Definition: ncbistl.hpp:100
#define BEGIN_SCOPE(ns)
Define a new scope.
Definition: ncbistl.hpp:72
#define kEmptyStr
Definition: ncbistr.hpp:123
static int version
Definition: mdb_load.c:29
Plugin manager (using class factory paradigm).
NCBI_DECLARE_INTERFACE_VERSION(objects::CWriter, "xwriter", 6, 1, 0)
Modified on Tue Nov 28 02:21:25 2023 by modify_doxy.py rev. 669887