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

Go to the SVN repository for this file.

1 #ifndef CORELIB___NCBIAPP__HPP
2 #define CORELIB___NCBIAPP__HPP
3 
4 /* $Id: ncbiapp.hpp 87311 2019-08-16 21:22:00Z vasilche $
5  * ===========================================================================
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  *
29  * Authors: Denis Vakatov, Vsevolod Sandomirskiy
30  *
31  *
32  */
33 
34 /// @file ncbiapp.hpp
35 /// Defines the CNcbiApplication and CAppException classes for creating
36 /// NCBI applications.
37 ///
38 /// The CNcbiApplication class defines the application framework and the high
39 /// high level behavior of an application, and the CAppException class is used
40 /// for the exceptions generated by CNcbiApplication.
41 
42 #include <corelib/ncbiapp_api.hpp>
43 #include <corelib/version.hpp>
44 
45 #if defined(NCBI_OS_MSWIN) && defined(_UNICODE)
46 # define NcbiSys_main wmain
47 #else
48 # define NcbiSys_main main
49 #endif
50 
52 
53 #ifdef CNcbiApplication
54 # undef CNcbiApplication
55 #endif
56 
57 // Set the version number for the program in the form "major.minor.patch"
58 // and also record all build information pertaining to building the app itself
59 // (and not the C++ Toolkit against which it's built).
60 #define NCBI_APP_SET_VERSION(major, minor, patch) \
61  SetVersion( CVersionInfo(major,minor,patch, NCBI_TEAMCITY_PROJECT_NAME_PROXY), NCBI_APP_SBUILDINFO_DEFAULT())
62 
63 // Set the version number for the program in the form "major.minor.teamcity_build_number"
64 // and also record all build information pertaining to building the app itself
65 // (and not the C++ Toolkit against which it's built).
66 // Uses zero patch level if NCBI_TEAMCITY_BUILD_NUMBER is unavailable.
67 #define NCBI_APP_SET_VERSION_AUTO(major, minor) NCBI_APP_SET_VERSION(major, minor, NCBI_TEAMCITY_BUILD_NUMBER_PROXY)
68 
69 
71 {
72 public:
73  /// Singleton method.
74  ///
75  /// Track the instance of CNcbiApplicationAPI, and throw an exception
76  /// if an attempt is made to create another instance of the application.
77  /// @return
78  /// Current application instance.
79  /// @sa
80  /// GetInstanceMutex()
81  static CNcbiApplication* Instance(void);
82 
83  /// Destructor.
84  ///
85  /// Clean up the application settings, flush the diagnostic stream.
86  virtual ~CNcbiApplication(void);
87 
88  /// Constructor.
89  ///
90  /// Register the application instance, and reset important
91  /// application-specific settings to empty values that will
92  /// be set later.
93  explicit
95 };
96 
97 
99 
100 #endif /* CORELIB___NCBIAPP__HPP */
CNcbiApplicationAPI –.
Define CVersionInfo, a version info storage class.
static CNcbiApplicationAPI * Instance(void)
Singleton method.
Definition: ncbiapp.cpp:127
#define CNcbiApplication
#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_SBUILDINFO_DEFAULT()
Definition: version.hpp:119
#define NCBI_XNCBI_EXPORT
Definition: ncbi_export.h:1283
This class allows to add build info (date and tag) to application version.
Definition: version_api.hpp:62
Modified on Fri Sep 20 14:57:45 2024 by modify_doxy.py rev. 669887