NCBI C++ ToolKit
Public Types | Public Member Functions | Private Member Functions | Private Attributes | List of all members
CMakeBlastDBApp Class Reference

Search Toolkit Book for CMakeBlastDBApp

The main application class. More...

+ Inheritance diagram for CMakeBlastDBApp:
+ Collaboration diagram for CMakeBlastDBApp:

Public Types

enum  ESupportedInputFormats {
  eFasta , eBinaryASN , eTextASN , eBlastDb ,
  eUnsupported = 256
}
 
typedef CFormatGuess::EFormat TFormat
 Convenience typedef. More...
 
- Public Types inherited from CNcbiApplicationAPI
enum  EAppNameType { eBaseName , eFullName , eRealName }
 

Public Member Functions

 CMakeBlastDBApp ()
 @inheritDoc More...
 
 ~CMakeBlastDBApp ()
 
- 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 CNcbiArgumentsGetArguments (void) const
 Get the application's cached unprocessed command-line arguments. More...
 
virtual const CArgsGetArgs (void) const
 Get parsed command line arguments. More...
 
const CNcbiEnvironmentGetEnvironment (void) const
 Get the application's cached environment. More...
 
CNcbiEnvironmentSetEnvironment (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 CNcbiRegistryGetConfig (void) const
 Get the application's cached configuration parameters (read-only). More...
 
CNcbiRegistryGetConfig (void)
 
const stringGetConfigPath (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 stringGetProgramDisplayName (void) const
 Get the application's "display" name. More...
 
const stringGetProgramExecutablePath (EFollowLinks follow_links=eIgnoreLinks) const
 Get the application's executable path. More...
 
CVersionInfo GetVersion (void) const
 Get the program version information. More...
 
const CVersionAPIGetFullVersion (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...
 
void x_AddSequenceData (CNcbiIstream &input, TFormat fmt)
 
vector< ESupportedInputFormatsx_GuessInputType (const vector< CTempString > &filenames, vector< string > &blastdbs)
 
ESupportedInputFormats x_GetUserInputTypeHint (void)
 
TFormat x_ConvertToCFormatGuessType (ESupportedInputFormats fmt)
 
ESupportedInputFormats x_ConvertToSupportedType (TFormat fmt)
 
TFormat x_GuessFileType (CNcbiIstream &input)
 
void x_BuildDatabase ()
 
void x_AddFasta (CNcbiIstream &data)
 
void x_AddSeqEntries (CNcbiIstream &data, TFormat fmt)
 
void x_ProcessMaskData ()
 
void x_ProcessInputData (const string &paths, bool is_protein)
 
bool x_ShouldParseSeqIds (void)
 
void x_VerifyInputFilesType (const vector< CTempString > &filenames, CMakeBlastDBApp::ESupportedInputFormats input_type)
 
void x_AddCmdOptions ()
 

Private Attributes

CNcbiOstreamm_LogFile
 
CRef< CBuildDatabasem_DB
 
CRef< CMaskedRangeSetm_Ranges
 
bool m_IsModifyMode
 
bool m_SkipUnver
 
CBlastUsageReport m_UsageReport
 
CStopWatch m_StopWatch
 

Additional Inherited Members

- Static Public Member Functions inherited from CNcbiApplication
static CNcbiApplicationInstance (void)
 Singleton method. More...
 
- Static Public Member Functions inherited from CNcbiApplicationAPI
static CNcbiApplicationAPIInstance (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 CArgDescriptionsGetArgDescriptions (void) const
 Get argument descriptions (set by SetupArgDescriptions) More...
 
bool SetupDiag (EAppDiagStream diag)
 Setup the application diagnostic stream. More...
 
virtual bool LoadConfig (CNcbiRegistry &reg, const string *conf, CNcbiRegistry::TFlags reg_flags)
 Load settings from the configuration file to the registry. More...
 
virtual bool LoadConfig (CNcbiRegistry &reg, const string *conf)
 Load settings from the configuration file to the registry. More...
 
CNcbiRegistryGetRWConfig (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...
 
IPhoneHomePolicyGetPhoneHomePolicy () const
 Return pointer to current Phone Home Policy or NULL. More...
 
- Static Protected Member Functions inherited from CNcbiApplicationAPI
static CRWLockGetInstanceLock (void)
 
static string FindProgramExecutablePath (int argc, const char *const *argv, string *real_path=0)
 Find the application's executable file. More...
 

Detailed Description

The main application class.

Definition at line 75 of file makeblastdb.cpp.

Member Typedef Documentation

◆ TFormat

Convenience typedef.

Definition at line 78 of file makeblastdb.cpp.

Member Enumeration Documentation

◆ ESupportedInputFormats

Enumerator
eFasta 
eBinaryASN 
eTextASN 
eBlastDb 
eUnsupported 

Definition at line 80 of file makeblastdb.cpp.

Constructor & Destructor Documentation

◆ CMakeBlastDBApp()

CMakeBlastDBApp::CMakeBlastDBApp ( )
inline

◆ ~CMakeBlastDBApp()

CMakeBlastDBApp::~CMakeBlastDBApp ( )
inline

Member Function Documentation

◆ Init()

void CMakeBlastDBApp::Init ( void  )
privatevirtual

◆ Run()

int CMakeBlastDBApp::Run ( void  )
privatevirtual

◆ x_AddCmdOptions()

void CMakeBlastDBApp::x_AddCmdOptions ( )
private

◆ x_AddFasta()

void CMakeBlastDBApp::x_AddFasta ( CNcbiIstream data)
private

Definition at line 357 of file makeblastdb.cpp.

References CBuildDatabase::AddFasta(), data, and m_DB.

Referenced by x_AddSequenceData().

◆ x_AddSeqEntries()

void CMakeBlastDBApp::x_AddSeqEntries ( CNcbiIstream data,
TFormat  fmt 
)
private

◆ x_AddSequenceData()

void CMakeBlastDBApp::x_AddSequenceData ( CNcbiIstream input,
CMakeBlastDBApp::TFormat  fmt 
)
private

◆ x_BuildDatabase()

void CMakeBlastDBApp::x_BuildDatabase ( )
private

◆ x_ConvertToCFormatGuessType()

CMakeBlastDBApp::TFormat CMakeBlastDBApp::x_ConvertToCFormatGuessType ( CMakeBlastDBApp::ESupportedInputFormats  fmt)
private

◆ x_ConvertToSupportedType()

CMakeBlastDBApp::ESupportedInputFormats CMakeBlastDBApp::x_ConvertToSupportedType ( CMakeBlastDBApp::TFormat  fmt)
private

◆ x_GetUserInputTypeHint()

CMakeBlastDBApp::ESupportedInputFormats CMakeBlastDBApp::x_GetUserInputTypeHint ( void  )
private

◆ x_GuessFileType()

CMakeBlastDBApp::TFormat CMakeBlastDBApp::x_GuessFileType ( CNcbiIstream input)
private

◆ x_GuessInputType()

vector<ESupportedInputFormats> CMakeBlastDBApp::x_GuessInputType ( const vector< CTempString > &  filenames,
vector< string > &  blastdbs 
)
private

◆ x_ProcessInputData()

void CMakeBlastDBApp::x_ProcessInputData ( const string paths,
bool  is_protein 
)
private

◆ x_ProcessMaskData()

void CMakeBlastDBApp::x_ProcessMaskData ( )
private

◆ x_ShouldParseSeqIds()

bool CMakeBlastDBApp::x_ShouldParseSeqIds ( void  )
private

Definition at line 968 of file makeblastdb.cpp.

References CNcbiApplicationAPI::GetArgs().

Referenced by x_BuildDatabase().

◆ x_VerifyInputFilesType()

void CMakeBlastDBApp::x_VerifyInputFilesType ( const vector< CTempString > &  filenames,
CMakeBlastDBApp::ESupportedInputFormats  input_type 
)
private

Member Data Documentation

◆ m_DB

CRef<CBuildDatabase> CMakeBlastDBApp::m_DB
private

◆ m_IsModifyMode

bool CMakeBlastDBApp::m_IsModifyMode
private

Definition at line 147 of file makeblastdb.cpp.

Referenced by x_BuildDatabase(), and x_ProcessInputData().

◆ m_LogFile

CNcbiOstream* CMakeBlastDBApp::m_LogFile
private

Definition at line 141 of file makeblastdb.cpp.

Referenced by x_BuildDatabase(), and x_ProcessMaskData().

◆ m_Ranges

CRef<CMaskedRangeSet> CMakeBlastDBApp::m_Ranges
private

Definition at line 145 of file makeblastdb.cpp.

Referenced by x_ProcessMaskData().

◆ m_SkipUnver

bool CMakeBlastDBApp::m_SkipUnver
private

Definition at line 149 of file makeblastdb.cpp.

Referenced by x_AddSeqEntries(), and x_BuildDatabase().

◆ m_StopWatch

CStopWatch CMakeBlastDBApp::m_StopWatch
private

Definition at line 151 of file makeblastdb.cpp.

Referenced by CMakeBlastDBApp(), and ~CMakeBlastDBApp().

◆ m_UsageReport

CBlastUsageReport CMakeBlastDBApp::m_UsageReport
private

Definition at line 150 of file makeblastdb.cpp.

Referenced by CMakeBlastDBApp(), Run(), x_AddCmdOptions(), and ~CMakeBlastDBApp().


The documentation for this class was generated from the following file:
Modified on Wed Apr 17 13:11:05 2024 by modify_doxy.py rev. 669887