NCBI C++ ToolKit
|
#include <ncbi_pch.hpp>
#include <common/ncbi_source_ver.h>
#include <corelib/ncbiapp.hpp>
#include <corelib/ncbifile.hpp>
#include <corelib/ncbi_system.hpp>
#include <corelib/ncbi_param.hpp>
#include <corelib/syslog.hpp>
#include <corelib/error_codes.hpp>
#include <corelib/ncbi_safe_static.hpp>
#include <corelib/request_ctx.hpp>
#include "ncbisys.hpp"
#include <corelib/ncbi_os_mswin.hpp>
#include <corelib/ncbidll.hpp>
#include <io.h>
#include <fcntl.h>
#include <unistd.h>
Go to the source code of this file.
Go to the SVN repository for this file.
Classes | |
class | CIdlerWrapper |
Macros | |
#define | HAVE_LOCAL_NCBI_BUILD_VER_H 1 |
#define | NCBI_USE_ERRCODE_X Corelib_App |
#define | NCBI_LOG_PARAM(type, Name, NAME) |
#define | RES_SIZE_USAGE(name, value_in_bytes) |
#define | RES_TIME_USAGE(name, value) |
Enumerations | |
enum | ELogOptionsEvent { eStartEvent = 0x01 , eStopEvent = 0x02 , eOtherEvent = 0x03 } |
enum | ELogOptions { fLogAppEnvironment = 0x01 , fLogAppEnvironmentStop = 0x02 , fLogAppRegistry = 0x04 , fLogAppRegistryStop = 0x08 , fLogAppArguments = 0x10 , fLogAppPath = 0x20 , fLogAppResUsageStop = 0x40 } |
Flags to switch what to log. More... | |
Functions | |
DEFINE_STATIC_MUTEX (s_InstanceMutex) | |
NCBI_PARAM_DECL (bool, Debug, Catch_Unhandled_Exceptions) | |
NCBI_PARAM_DEF_EX (bool, Debug, Catch_Unhandled_Exceptions, true, eParam_NoThread, DEBUG_CATCH_UNHANDLED_EXCEPTIONS) | |
typedef | NCBI_PARAM_TYPE (Debug, Catch_Unhandled_Exceptions) TParamCatchExceptions |
bool | s_HandleExceptions (void) |
NCBI_PARAM_DECL (bool, NCBI, TerminateOnCpuIncompatibility) | |
NCBI_PARAM_DEF_EX (bool, NCBI, TerminateOnCpuIncompatibility, false, eParam_NoThread, NCBI_CONFIG__TERMINATE_ON_CPU_INCOMPATIBILITY) | |
NCBI_PARAM_DECL (bool, Log, LogAppEnvironment) | |
NCBI_PARAM_DEF_EX (bool, Log, LogAppEnvironment, false, eParam_NoThread, DIAG_LOG_APP_ENVIRONMENT) | |
typedef | NCBI_PARAM_TYPE (Log, LogAppEnvironment) TLogAppEnvironment |
NCBI_PARAM_DECL (bool, Log, LogAppEnvironmentOnStop) | |
NCBI_PARAM_DEF_EX (bool, Log, LogAppEnvironmentOnStop, false, eParam_NoThread, DIAG_LOG_APP_ENVIRONMENT_ON_STOP) | |
typedef | NCBI_PARAM_TYPE (Log, LogAppEnvironmentOnStop) TLogAppEnvironmentOnStop |
NCBI_PARAM_DECL (bool, Log, LogAppRegistry) | |
NCBI_PARAM_DEF_EX (bool, Log, LogAppRegistry, false, eParam_NoThread, DIAG_LOG_APP_REGISTRY) | |
typedef | NCBI_PARAM_TYPE (Log, LogAppRegistry) TLogAppRegistry |
NCBI_PARAM_DECL (bool, Log, LogAppRegistryOnStop) | |
NCBI_PARAM_DEF_EX (bool, Log, LogAppRegistryOnStop, false, eParam_NoThread, DIAG_LOG_APP_REGISTRY_ON_STOP) | |
typedef | NCBI_PARAM_TYPE (Log, LogAppRegistryOnStop) TLogAppRegistryOnStop |
NCBI_PARAM_DECL (bool, Log, LogAppArguments) | |
NCBI_PARAM_DEF_EX (bool, Log, LogAppArguments, false, eParam_NoThread, DIAG_LOG_APP_ARGUMENTS) | |
typedef | NCBI_PARAM_TYPE (Log, LogAppArguments) TLogAppArguments |
NCBI_PARAM_DECL (bool, Log, LogAppPath) | |
NCBI_PARAM_DEF_EX (bool, Log, LogAppPath, false, eParam_NoThread, DIAG_LOG_APP_PATH) | |
typedef | NCBI_PARAM_TYPE (Log, LogAppPath) TLogAppPath |
NCBI_PARAM_DECL (bool, Log, LogAppRunContext) | |
NCBI_PARAM_DEF_EX (bool, Log, LogAppRunContext, false, eParam_NoThread, DIAG_LOG_APP_RUN_CONTEXT) | |
typedef | NCBI_PARAM_TYPE (Log, LogAppRunContext) TLogAppRunContext |
NCBI_PARAM_DECL (bool, Log, LogAppResUsageOnStop) | |
NCBI_PARAM_DEF_EX (bool, Log, LogAppResUsageOnStop, false, eParam_NoThread, DIAG_LOG_APP_RESUSAGE_ON_STOP) | |
typedef | NCBI_PARAM_TYPE (Log, LogAppResUsageOnStop) TLogAppResUsageOnStop |
void | s_RoundResUsageSize (Uint8 value_in_bytes, string &suffix, Uint8 &value) |
INcbiIdler * | GetIdler (EOwnership ownership) |
Return currently installed idler or NULL. More... | |
void | SetIdler (INcbiIdler *idler, EOwnership ownership) |
Set new idler and ownership. More... | |
void | RunIdler (void) |
Execute currently installed idler if any. More... | |
Variables | |
const char * | s_ArgLogFile |
const char * | s_ArgCfgFile |
const char * | s_ArgVersion |
const char * | s_ArgFullVersion |
const char * | s_ArgFullVersionXml |
const char * | s_ArgFullVersionJson |
const char * | s_ArgDryRun |
const char * | s_ArgDelimiter |
static bool | s_IsApplicationStarted = false |
static CSafeStatic< CRWLock > | s_InstanceRWLock (CSafeStaticLifeSpan(CSafeStaticLifeSpan::eLifeSpan_Long, 1)) |
CSafeStatic< CIdlerWrapper > | s_IdlerWrapper |
#define HAVE_LOCAL_NCBI_BUILD_VER_H 1 |
Definition at line 36 of file ncbiapp.cpp.
Definition at line 472 of file ncbiapp.cpp.
#define NCBI_USE_ERRCODE_X Corelib_App |
Definition at line 65 of file ncbiapp.cpp.
#define RES_SIZE_USAGE | ( | name, | |
value_in_bytes | |||
) |
Definition at line 548 of file ncbiapp.cpp.
#define RES_TIME_USAGE | ( | name, | |
value | |||
) |
Definition at line 556 of file ncbiapp.cpp.
enum ELogOptions |
Flags to switch what to log.
Definition at line 495 of file ncbiapp.cpp.
enum ELogOptionsEvent |
Enumerator | |
---|---|
eStartEvent | right before AppMain() |
eStopEvent | right after AppMain() |
eOtherEvent | any case is fine |
Definition at line 487 of file ncbiapp.cpp.
DEFINE_STATIC_MUTEX | ( | s_InstanceMutex | ) |
NCBI_PARAM_DECL | ( | bool | , |
Debug | , | ||
Catch_Unhandled_Exceptions | |||
) |
NCBI_PARAM_DECL | ( | bool | , |
Log | , | ||
LogAppArguments | |||
) |
NCBI_PARAM_DECL | ( | bool | , |
Log | , | ||
LogAppEnvironment | |||
) |
NCBI_PARAM_DECL | ( | bool | , |
Log | , | ||
LogAppEnvironmentOnStop | |||
) |
NCBI_PARAM_DECL | ( | bool | , |
Log | , | ||
LogAppPath | |||
) |
NCBI_PARAM_DECL | ( | bool | , |
Log | , | ||
LogAppRegistry | |||
) |
NCBI_PARAM_DECL | ( | bool | , |
Log | , | ||
LogAppRegistryOnStop | |||
) |
NCBI_PARAM_DECL | ( | bool | , |
Log | , | ||
LogAppResUsageOnStop | |||
) |
NCBI_PARAM_DECL | ( | bool | , |
Log | , | ||
LogAppRunContext | |||
) |
NCBI_PARAM_DEF_EX | ( | bool | , |
Debug | , | ||
Catch_Unhandled_Exceptions | , | ||
true | , | ||
eParam_NoThread | , | ||
DEBUG_CATCH_UNHANDLED_EXCEPTIONS | |||
) |
NCBI_PARAM_DEF_EX | ( | bool | , |
Log | , | ||
LogAppArguments | , | ||
false | , | ||
eParam_NoThread | , | ||
DIAG_LOG_APP_ARGUMENTS | |||
) |
NCBI_PARAM_DEF_EX | ( | bool | , |
Log | , | ||
LogAppEnvironment | , | ||
false | , | ||
eParam_NoThread | , | ||
DIAG_LOG_APP_ENVIRONMENT | |||
) |
NCBI_PARAM_DEF_EX | ( | bool | , |
Log | , | ||
LogAppEnvironmentOnStop | , | ||
false | , | ||
eParam_NoThread | , | ||
DIAG_LOG_APP_ENVIRONMENT_ON_STOP | |||
) |
NCBI_PARAM_DEF_EX | ( | bool | , |
Log | , | ||
LogAppPath | , | ||
false | , | ||
eParam_NoThread | , | ||
DIAG_LOG_APP_PATH | |||
) |
NCBI_PARAM_DEF_EX | ( | bool | , |
Log | , | ||
LogAppRegistry | , | ||
false | , | ||
eParam_NoThread | , | ||
DIAG_LOG_APP_REGISTRY | |||
) |
NCBI_PARAM_DEF_EX | ( | bool | , |
Log | , | ||
LogAppRegistryOnStop | , | ||
false | , | ||
eParam_NoThread | , | ||
DIAG_LOG_APP_REGISTRY_ON_STOP | |||
) |
NCBI_PARAM_DEF_EX | ( | bool | , |
Log | , | ||
LogAppResUsageOnStop | , | ||
false | , | ||
eParam_NoThread | , | ||
DIAG_LOG_APP_RESUSAGE_ON_STOP | |||
) |
NCBI_PARAM_DEF_EX | ( | bool | , |
Log | , | ||
LogAppRunContext | , | ||
false | , | ||
eParam_NoThread | , | ||
DIAG_LOG_APP_RUN_CONTEXT | |||
) |
NCBI_PARAM_DEF_EX | ( | bool | , |
NCBI | , | ||
TerminateOnCpuIncompatibility | , | ||
false | , | ||
eParam_NoThread | , | ||
NCBI_CONFIG__TERMINATE_ON_CPU_INCOMPATIBILITY | |||
) |
typedef NCBI_PARAM_TYPE | ( | Debug | , |
Catch_Unhandled_Exceptions | |||
) |
Referenced by CNcbiApplicationAPI::x_TryInit().
typedef NCBI_PARAM_TYPE | ( | Log | , |
LogAppArguments | |||
) |
typedef NCBI_PARAM_TYPE | ( | Log | , |
LogAppEnvironment | |||
) |
typedef NCBI_PARAM_TYPE | ( | Log | , |
LogAppEnvironmentOnStop | |||
) |
typedef NCBI_PARAM_TYPE | ( | Log | , |
LogAppPath | |||
) |
typedef NCBI_PARAM_TYPE | ( | Log | , |
LogAppRegistry | |||
) |
typedef NCBI_PARAM_TYPE | ( | Log | , |
LogAppRegistryOnStop | |||
) |
typedef NCBI_PARAM_TYPE | ( | Log | , |
LogAppResUsageOnStop | |||
) |
typedef NCBI_PARAM_TYPE | ( | Log | , |
LogAppRunContext | |||
) |
bool s_HandleExceptions | ( | void | ) |
Definition at line 402 of file ncbiapp.cpp.
Referenced by CNcbiApplicationAPI::AppMain(), and CNcbiApplicationAPI::x_TryMain().
Definition at line 533 of file ncbiapp.cpp.
References rapidjson::value.
|
extern |
Definition at line 83 of file ncbiargs.cpp.
Referenced by CArgDescriptions::AddDefaultFileArguments(), CArgDescriptions::AddStdArguments(), and CNcbiApplicationAPI::AppMain().
|
extern |
Definition at line 89 of file ncbiargs.cpp.
Referenced by CNcbiApplicationAPI::AppMain(), and CArgDescriptions::x_CreateArg().
|
extern |
Definition at line 88 of file ncbiargs.cpp.
Referenced by CArgDescriptions::AddStdArguments(), and CNcbiApplicationAPI::AppMain().
|
extern |
Definition at line 85 of file ncbiargs.cpp.
Referenced by CArgDescriptions::AddStdArguments(), CNcbiApplicationAPI::AppMain(), and CCgiApplication::PreparseArgs().
|
extern |
Definition at line 87 of file ncbiargs.cpp.
Referenced by CArgDescriptions::AddStdArguments(), and CNcbiApplicationAPI::AppMain().
|
extern |
Definition at line 86 of file ncbiargs.cpp.
Referenced by CArgDescriptions::AddStdArguments(), and CNcbiApplicationAPI::AppMain().
|
extern |
Definition at line 82 of file ncbiargs.cpp.
Referenced by CArgDescriptions::AddDefaultFileArguments(), CArgDescriptions::AddStdArguments(), and CNcbiApplicationAPI::AppMain().
|
extern |
Definition at line 84 of file ncbiargs.cpp.
Referenced by CArgDescriptions::AddStdArguments(), CNcbiApplicationAPI::AppMain(), and CCgiApplication::PreparseArgs().
CSafeStatic<CIdlerWrapper> s_IdlerWrapper |
Definition at line 1850 of file ncbiapp.cpp.
Referenced by GetIdler(), RunIdler(), and SetIdler().
|
static |
Referenced by CNcbiApplicationAPI::GetInstanceLock().
Definition at line 89 of file ncbiapp.cpp.
Referenced by CNcbiApplicationAPI::AppMain(), CNcbiApplicationAPI::SetFullVersion(), and CNcbiApplicationAPI::SetVersion().