NCBI C++ ToolKit
|
Search Toolkit Book for CBlastnApp
Public Member Functions | |
CBlastnApp () | |
@inheritDoc More... | |
~CBlastnApp () | |
Public Member Functions inherited from CNcbiApplication | |
virtual | ~CNcbiApplication (void) |
Destructor. More... | |
CNcbiApplication (const SBuildInfo &build_info=NCBI_SBUILDINFO_DEFAULT()) | |
Constructor. More... | |
Public Member Functions inherited from CNcbiApplicationAPI | |
CNcbiApplicationAPI (const SBuildInfo &build_info) | |
Constructor. More... | |
virtual | ~CNcbiApplicationAPI (void) |
Destructor. More... | |
int | AppMain (int argc, const char *const *argv, const char *const *envp=0, EAppDiagStream diag=eDS_Default, const char *conf=NcbiEmptyCStr, const string &name=NcbiEmptyString) |
Main function (entry point) for the NCBI application. More... | |
virtual int | DryRun (void) |
Test run the application. More... | |
virtual void | Exit (void) |
Cleanup on application exit. More... | |
const CNcbiArguments & | GetArguments (void) const |
Get the application's cached unprocessed command-line arguments. More... | |
virtual const CArgs & | GetArgs (void) const |
Get parsed command line arguments. More... | |
const CNcbiEnvironment & | GetEnvironment (void) const |
Get the application's cached environment. More... | |
CNcbiEnvironment & | SetEnvironment (void) |
Get a non-const copy of the application's cached environment. More... | |
void | SetEnvironment (const string &name, const string &value) |
Set a specified environment variable by name. More... | |
bool | HasLoadedConfig (void) const |
Check if the config file has been loaded. More... | |
bool | FinishedLoadingConfig (void) const |
Check if the application has finished loading config file (successfully or not). More... | |
const CNcbiRegistry & | GetConfig (void) const |
Get the application's cached configuration parameters (read-only). More... | |
CNcbiRegistry & | GetConfig (void) |
const string & | GetConfigPath (void) const |
Get the full path to the configuration file (if any) we ended up using. More... | |
bool | ReloadConfig (CMetaRegistry::TFlags flags=CMetaRegistry::fReloadIfChanged, IRegistry::TFlags reg_flags=IRegistry::fWithNcbirc) |
Reload the configuration file. More... | |
SIZE_TYPE | FlushDiag (CNcbiOstream *os, bool close_diag=false) |
Flush the in-memory diagnostic stream (for "eDS_ToMemory" case only). More... | |
const string & | GetProgramDisplayName (void) const |
Get the application's "display" name. More... | |
const string & | GetProgramExecutablePath (EFollowLinks follow_links=eIgnoreLinks) const |
Get the application's executable path. More... | |
CVersionInfo | GetVersion (void) const |
Get the program version information. More... | |
const CVersionAPI & | GetFullVersion (void) const |
Get the program version information. More... | |
bool | IsDryRun (void) const |
Check if it is a test run. More... | |
virtual bool | SetupDiag_AppSpecific (void) |
Setup application specific diagnostic stream. More... | |
template<class TFunc > | |
void | AddOnExitAction (TFunc func) |
Add callback to be executed from CNcbiApplicationAPI destructor. More... | |
Private Member Functions | |
virtual void | Init () |
@inheritDoc More... | |
virtual int | Run () |
@inheritDoc More... | |
int | x_RunMTBySplitDB () |
int | x_RunMTBySplitQuery () |
Private Attributes | |
CRef< CBlastnAppArgs > | m_CmdLineArgs |
This application's command line args. More... | |
CBlastAppDiagHandler | m_Bah |
CBlastUsageReport | m_UsageReport |
CStopWatch | m_StopWatch |
CRef< CBlastOptionsHandle > | m_OptsHndl |
Additional Inherited Members | |
Public Types inherited from CNcbiApplicationAPI | |
enum | EAppNameType { eBaseName , eFullName , eRealName } |
Static Public Member Functions inherited from CNcbiApplication | |
static CNcbiApplication * | Instance (void) |
Singleton method. More... | |
Static Public Member Functions inherited from CNcbiApplicationAPI | |
static CNcbiApplicationAPI * | Instance (void) |
Singleton method. More... | |
static CNcbiApplicationGuard | InstanceGuard (void) |
Singleton method. More... | |
static SSystemMutex & | GetInstanceMutex (void) |
Mutex for application singleton object. More... | |
static string | GetAppName (EAppNameType name_type=eBaseName, int argc=0, const char *const *argv=NULL) |
Protected Types inherited from CNcbiApplicationAPI | |
enum | EPreparseArgs { ePreparse_Continue , ePreparse_Exit } |
Result of PreparseArgs() More... | |
enum | EDisableArgDesc { fDisableStdArgs = 0x01 } |
Disable argument descriptions. More... | |
enum | EHideStdArgs { fHideLogfile = CArgDescriptions::fHideLogfile , fHideConffile = CArgDescriptions::fHideConffile , fHideVersion = CArgDescriptions::fHideVersion , fHideFullVersion = CArgDescriptions::fHideFullVersion , fHideDryRun = CArgDescriptions::fHideDryRun , fHideHelp = CArgDescriptions::fHideHelp , fHideFullHelp = CArgDescriptions::fHideFullHelp , fHideXmlHelp = CArgDescriptions::fHideXmlHelp , fHideAll = CArgDescriptions::fHideAll } |
Which standard flag's descriptions should not be displayed in the usage message. More... | |
enum | EStdioSetup { fNoSyncWithStdio = 0x01 , fDefault_CinBufferSize = 0x02 , fBinaryCin = 0x04 , fBinaryCout = 0x08 , fDefault_SyncWithStdio = 0x00 } |
Flags to adjust standard I/O streams' behaviour. More... | |
enum | EExitMode { eNoExits , eExceptionalExits , eAllExits } |
When to return a user-set exit code. More... | |
enum | EAppFlags { fSkipSafeStaticDestroy = 1 << 0 } |
typedef int | TDisableArgDesc |
Binary OR of "EDisableArgDesc". More... | |
typedef int | THideStdArgs |
Binary OR of "EHideStdArgs". More... | |
typedef int | TStdioSetupFlags |
Binary OR of "EStdioSetup". More... | |
typedef int | TAppFlags |
Protected Member Functions inherited from CNcbiApplicationAPI | |
virtual EPreparseArgs | PreparseArgs (int argc, const char *const *argv) |
Check the command line arguments before parsing them. More... | |
void | DisableArgDescriptions (TDisableArgDesc disable=fDisableStdArgs) |
void | HideStdArgs (THideStdArgs hide_mask) |
Set the hide mask for the Hide Std Flags. More... | |
void | SetStdioFlags (TStdioSetupFlags stdio_flags) |
Adjust the behavior of standard I/O streams. More... | |
void | SetVersion (const CVersionInfo &version) |
Set the version number for the program. More... | |
void | SetVersion (const CVersionInfo &version, const SBuildInfo &build_info) |
void | SetVersionByBuild (int major) |
void | SetFullVersion (CRef< CVersionAPI > version) |
Set version data for the program. More... | |
virtual void | SetupArgDescriptions (CArgDescriptions *arg_desc) |
Setup the command line argument descriptions. More... | |
const CArgDescriptions * | GetArgDescriptions (void) const |
Get argument descriptions (set by SetupArgDescriptions) More... | |
bool | SetupDiag (EAppDiagStream diag) |
Setup the application diagnostic stream. More... | |
virtual bool | LoadConfig (CNcbiRegistry ®, const string *conf, CNcbiRegistry::TFlags reg_flags) |
Load settings from the configuration file to the registry. More... | |
virtual bool | LoadConfig (CNcbiRegistry ®, const string *conf) |
Load settings from the configuration file to the registry. More... | |
CNcbiRegistry & | GetRWConfig (void) |
Get the application's cached configuration parameters, accessible for read-write for an application's internal use only. More... | |
void | SetProgramDisplayName (const string &app_name) |
Set program's display name. More... | |
virtual void | AppStart (void) |
Method to be called before application start. More... | |
virtual void | AppStop (int exit_code) |
Method to be called before application exit. More... | |
void | SetExitCode (int exit_code, EExitMode when=eExceptionalExits) |
Force the program to return a specific exit code later, either when it exits due to an exception or unconditionally. More... | |
void | SetAppFlags (TAppFlags flags) |
void | ExecuteOnExitActions () |
Should only be called from the destructors of classes derived from CNcbiApplicationAPI - if it is necessary to access their data members and virtual methods; or to dynamic_cast<> from the base app class. More... | |
void | SetPhoneHomePolicy (IPhoneHomePolicy *policy, ENcbiOwnership ownership=eNoOwnership) |
Set Phone Home Policy. More... | |
IPhoneHomePolicy * | GetPhoneHomePolicy () const |
Return pointer to current Phone Home Policy or NULL. More... | |
Static Protected Member Functions inherited from CNcbiApplicationAPI | |
static CRWLock & | GetInstanceLock (void) |
static string | FindProgramExecutablePath (int argc, const char *const *argv, string *real_path=0) |
Find the application's executable file. More... | |
Definition at line 52 of file blastn_app.cpp.
|
inline |
@inheritDoc
Definition at line 56 of file blastn_app.cpp.
References CBlastUsageReport::AddParam(), CVersion, CBlastUsageReport::eVersion, CNcbiApplicationAPI::GetVersion(), CUsageReport::IsEnabled(), m_StopWatch, m_UsageReport, Print(), CNcbiApplicationAPI::SetFullVersion(), CStopWatch::Start(), and dtl::version.
|
inline |
Definition at line 66 of file blastn_app.cpp.
References CBlastUsageReport::AddParam(), CStopWatch::Elapsed(), CBlastUsageReport::eRunTime, m_StopWatch, and m_UsageReport.
|
privatevirtual |
@inheritDoc
Reimplemented from CNcbiApplicationAPI.
Definition at line 86 of file blastn_app.cpp.
References CNcbiApplicationAPI::fHideConffile, CNcbiApplicationAPI::fHideDryRun, CNcbiApplicationAPI::fHideFullVersion, CNcbiApplicationAPI::fHideLogfile, CNcbiApplicationAPI::fHideXmlHelp, CNcbiApplicationAPI::HideStdArgs(), m_CmdLineArgs, CRef< C, Locker >::Reset(), CBlastAppArgs::SetCommandLine(), and CNcbiApplicationAPI::SetupArgDescriptions().
|
privatevirtual |
@inheritDoc
Implements CNcbiApplicationAPI.
Definition at line 116 of file blastn_app.cpp.
References CBlastUsageReport::AddParam(), BLAST_EXIT_SUCCESS, BLAST_PROF_ADD, BLAST_PROF_ADD2, CATCH_ALL, eDiag_Warning, CBlastUsageReport::eMTMode, CMTArgs::eSplitAuto, CMTArgs::eSplitByDB, CMTArgs::eSplitByQueries, CBlastAppArgs::ExecuteRemotely(), CArgs::Exist(), file, CNcbiApplicationAPI::GetArgs(), CBlastAppArgs::GetBlastDatabaseArgs(), CBlastDatabaseArgs::GetDatabaseName(), CBlastAppDiagHandler::GetMessages(), CBlastAppArgs::GetMTMode(), CBlastAppArgs::GetNumThreads(), CBlastOptionsHandle::GetOptions(), CBlastDatabaseArgs::GetSearchDatabase(), CSearchDatabase::GetSeqDb(), CSeqDB::GetTotalLength(), CBlastOptions::GetWordSize(), kArgQuery, kEmptyStr, m_Bah, m_CmdLineArgs, m_OptsHndl, m_UsageReport, MTByQueries_DBSize_Warning(), PrintErrorArchive(), RecoverSearchStrategy(), CRef< C, Locker >::Reset(), s_GetMT1Cutoffs(), SetDiagHandler(), SetDiagPostLevel(), SetDiagPostPrefix(), CBlastAppArgs::SetOptions(), CBlastAppArgs::SetOptionsForSavedStrategy(), x_RunMTBySplitDB(), and x_RunMTBySplitQuery().
|
private |
Definition at line 179 of file blastn_app.cpp.
References _ASSERT, a, CBlastUsageReport::AddParam(), CFormattingArgs::ArchiveFormatRequested(), BLAST_EXIT_SUCCESS, BLAST_PROF_ADD, BLAST_PROF_REPORT, BLAST_PROF_START, BLAST_PROF_STOP, BlastFormatter_PreFetchSequenceData(), CATCH_ALL, CDebugDumpable::DebugDumpText(), CFormattingArgs::DisplayHtmlOutput(), CBlastAppDiagHandler::DoNotSaveMessages(), CBlastUsageReport::eExitStatus, CBlastUsageReport::eNumThreads, ERR_POST, CBlastUsageReport::eTask, CBlastAppArgs::ExecuteRemotely(), CNcbiApplicationAPI::GetArgs(), CNcbiApplicationAPI::GetArguments(), CBatchSizeMixer::GetBatchSize(), CBlastAppArgs::GetBlastDatabaseArgs(), CBlastAppArgs::GetClientId(), GetCmdlineArgs(), CFormattingArgs::GetCustomDelimiter(), CFormattingArgs::GetCustomOutputFormatSpec(), CBlastOptions::GetDbGeneticCode(), CBlastFormat::GetDbTotalLength(), CLocalDbAdapter::GetFilteringAlgorithm(), CFormattingArgs::GetFormattedOutputChoice(), CBlastAppArgs::GetFormattingArgs(), CFormattingArgs::GetHitsSortOption(), CFormattingArgs::GetHspsSortOption(), CBlastAppArgs::GetInputStream(), CFormattingArgs::GetLineLength(), CBlastOptions::GetMatrixName(), CBlastOptions::GetMBIndexLoaded(), CBlastAppDiagHandler::GetMessages(), CFormattingArgs::GetNumAlignments(), CFormattingArgs::GetNumDescriptions(), CLocalBlast::GetNumExtensions(), CBlastAppArgs::GetNumThreads(), CBlastOptionsHandle::GetOptions(), CBlastAppArgs::GetOutputStream(), CQueryOptionsArgs::GetParseDeflines(), CBlastOptions::GetProgram(), CBlastnAppArgs::GetQueryBatchSize(), CBlastOptions::GetQueryGeneticCode(), CBlastAppArgs::GetQueryOptionsArgs(), CQueryOptionsArgs::GetRange(), CRemoteBlast::GetResultSet(), CQueryOptionsArgs::GetStrand(), GetSubjectFile(), CBlastOptions::GetSumStatisticsMode(), CBlastAppArgs::GetTask(), CBlastOptions::GetUseIndex(), CSetupFactory::InitializeMegablastDbIndex(), InitializeQueryDataLoaderConfiguration(), InitializeRemoteBlast(), InitializeSubject(), input(), IsIStreamEmpty(), ITERATE, kArgOutput, CBlastFormat::LogBlastSearchInfo(), LogQueryInfo(), m_Bah, m_CmdLineArgs, m_OptsHndl, m_UsageReport, NcbiCerr, NULL, CBlastFormat::PrintEpilog(), PrintErrorArchive(), CBlastFormat::PrintOneResultSet(), CBlastFormat::PrintProlog(), CBlastAppArgs::ProduceDebugOutput(), CBlastAppArgs::ProduceDebugRemoteOutput(), QueryBatchCleanup(), CQueryOptionsArgs::QueryIsProtein(), CBlastAppDiagHandler::ResetMessages(), CBlastFormat::ResetScopeHistory(), result, results, CLocalBlast::Run(), SaveSearchStrategy(), CBlastFormat::SetBaseFile(), CLocalBlast::SetBatchNumber(), CBlastFormat::SetCustomDelimiter(), CBlastFormat::SetHitsSortOption(), CBlastFormat::SetHspsSortOption(), CBlastFormat::SetLineLength(), CThreadable::SetNumberOfThreads(), CBlastOptionsHandle::SetOptions(), CBlastFormat::SetQueryRange(), CBatchSizeMixer::SetTargetHits(), CFormattingArgs::ShowGis(), SplitQuery_GetChunkSize(), CQueryOptionsArgs::UseLowercaseMasks(), UseXInclude(), Warning(), and CBlastFormat::WriteArchive().
Referenced by Run().
|
private |
Definition at line 344 of file blastn_app.cpp.
References a, CBlastUsageReport::AddParam(), BLAST_EXIT_SUCCESS, BLAST_PROF_ADD, BLAST_PROF_REPORT, BLAST_PROF_START, BLAST_PROF_STOP, CATCH_ALL, CBlastUsageReport::eExitStatus, CBlastUsageReport::eNumErrStatus, CBlastUsageReport::eNumQueries, CBlastUsageReport::eNumQueryBatches, CBlastUsageReport::eNumThreads, ERR_POST, CBlastUsageReport::eTask, CBlastUsageReport::eTotalQueryLength, CNcbiApplicationAPI::GetArgs(), CNcbiApplicationAPI::GetArguments(), CBlastMasterNode::GetBuzzer(), CBlastAppArgs::GetInputStream(), CBlastAppDiagHandler::GetMessages(), GetMTByQueriesBatchSize(), CBlastMasterNode::GetNumErrStatus(), CBlastMasterNode::GetNumOfQueries(), CBlastAppArgs::GetNumThreads(), CBlastOptionsHandle::GetOptions(), CBlastAppArgs::GetOutputStream(), CBlastOptions::GetProgram(), CBlastMasterNode::GetQueriesLength(), CBlastAppArgs::GetTask(), INFO_POST, input(), CBlastMasterNode::IsFull(), IsIStreamEmpty(), LogBlastOptions(), LogCmdOptions(), m_Bah, m_CmdLineArgs, m_OptsHndl, m_UsageReport, PrintErrorArchive(), CBlastMasterNode::Processing(), CBlastMasterNode::RegisterNode(), CBlastMasterNode::Shutdown(), t, and Warning().
Referenced by Run().
|
private |
Definition at line 80 of file blastn_app.cpp.
Referenced by Run(), x_RunMTBySplitDB(), and x_RunMTBySplitQuery().
|
private |
This application's command line args.
Definition at line 79 of file blastn_app.cpp.
Referenced by Init(), Run(), x_RunMTBySplitDB(), and x_RunMTBySplitQuery().
|
private |
Definition at line 83 of file blastn_app.cpp.
Referenced by Run(), x_RunMTBySplitDB(), and x_RunMTBySplitQuery().
|
private |
Definition at line 82 of file blastn_app.cpp.
Referenced by CBlastnApp(), and ~CBlastnApp().
|
private |
Definition at line 81 of file blastn_app.cpp.
Referenced by CBlastnApp(), Run(), x_RunMTBySplitDB(), x_RunMTBySplitQuery(), and ~CBlastnApp().