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

Search Toolkit Book for CEntrez2ClientApp

+ Inheritance diagram for CEntrez2ClientApp:
+ Collaboration diagram for CEntrez2ClientApp:

Public Member Functions

 CEntrez2ClientApp ()
 
virtual void Init (void)
 Initialize the application. More...
 
virtual int Run (void)
 Run the application. More...
 
- Public Member Functions inherited from CNcbiApplication
 CNcbiApplication (const SBuildInfo &build_info=SBuildInfo())
 Constructor. More...
 
virtual ~CNcbiApplication (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 CVersionGetFullVersion (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 CNcbiApplication destructor. More...
 

Private Member Functions

void x_GetInfo (CEntrez2Client &client)
 
void x_GetCount (CEntrez2Client &client, const string &query, const string &db)
 
void x_GetParsedQuery (CEntrez2Client &client, const string &query, const string &db)
 
void x_GetUids (CEntrez2Client &client, const string &query, const string &db, int start, int max_num)
 
void x_GetDocsums (CEntrez2Client &client, const string &query, const string &db, int start, int max_num)
 
void x_GetTermPos (CEntrez2Client &client, const string &query, const string &db)
 
void x_GetTermList (CEntrez2Client &client, const string &query, const string &db)
 
void x_GetTermHierarchy (CEntrez2Client &client, const string &query, const string &db)
 
void x_GetLinks (CEntrez2Client &client, const string &query, const string &db)
 
void x_GetLinked (CEntrez2Client &client, const string &query, const string &db)
 
void x_GetLinkCounts (CEntrez2Client &client, const string &query, const string &db)
 
void x_FormatReply (CEntrez2_boolean_reply &reply)
 
CEntrez2_boolean_replyx_EvalBoolean (CEntrez2Client &client, const string &query, const string &db, bool parse, bool uids, int start=-1, int max_num=-1)
 

Private Attributes

CRef< CEntrez2Clientm_Client
 
CNcbiOstreamm_Ostream
 
auto_ptr< CObjectOStreamm_ObjOstream
 

Additional Inherited Members

- Public Types inherited from CNcbiApplication
enum  EAppNameType { eBaseName, eFullName, eRealName }
 
- Static Public Member Functions inherited from CNcbiApplication
static CNcbiApplicationInstance (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 CNcbiApplication
enum  EPreparseArgs { ePreparse_Continue, ePreparse_Exit }
 Result of PreparseArgs() More...
 
enum  EDisableArgDesc { fDisableStdArgs = 0x01 }
 Disable argument descriptions. More...
 
enum  EHideStdArgs {
  fHideLogfile = 0x01, fHideConffile = 0x02, fHideVersion = 0x04, fHideFullVersion = 0x08,
  fHideDryRun = 0x10, fHideHelp = 0x20, fHideFullHelp = 0x40, fHideXmlHelp = 0x80,
  fHideAll = 0xFF
}
 Which standard flag's descriptions should not be displayed in the usage message. More...
 
enum  EStdioSetup { fDefault_SyncWithStdio = 0x01, fDefault_CinBufferSize = 0x02, fBinaryCin = 0x04, fBinaryCout = 0x08 }
 Flags to adjust standard I/O streams' behaviour. More...
 
enum  EExitMode { eNoExits, eExceptionalExits, eAllExits }
 When to return a user-set exit code. More...
 
typedef int TDisableArgDesc
 Binary OR of "EDisableArgDesc". More...
 
typedef int THideStdArgs
 Binary OR of "EHideStdArgs". More...
 
typedef int TStdioSetupFlags
 Binary OR of "EStdioSetup". More...
 
- Protected Member Functions inherited from CNcbiApplication
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< CVersion > 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 to read-write for an application 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...
 
- Static Protected Member Functions inherited from CNcbiApplication
static string FindProgramExecutablePath (int argc, const char *const *argv, string *real_path=0)
 Find the application's executable file. More...
 

Detailed Description

Definition at line 60 of file entrez2client.cpp.

Constructor & Destructor Documentation

CEntrez2ClientApp::CEntrez2ClientApp ( )

Member Function Documentation

void CEntrez2ClientApp::Init ( void  )
virtual

Initialize the application.

The default behavior of this is "do nothing". If you have special initialization logic that needs to be peformed, then you must override this method with your own logic.

Reimplemented from CNcbiApplication.

Definition at line 121 of file entrez2client.cpp.

References CArgDescriptions::eInteger, CArgDescriptions::eOutputFile, CArgDescriptions::eString, CNcbiApplication::GetArguments(), and CNcbiApplication::SetupArgDescriptions().

int CEntrez2ClientApp::Run ( void  )
virtual
CEntrez2_boolean_reply * CEntrez2ClientApp::x_EvalBoolean ( CEntrez2Client client,
const string query,
const string db,
bool  parse,
bool  uids,
int  start = -1,
int  max_num = -1 
)
private
void CEntrez2ClientApp::x_FormatReply ( CEntrez2_boolean_reply reply)
private
void CEntrez2ClientApp::x_GetCount ( CEntrez2Client client,
const string query,
const string db 
)
private

Definition at line 247 of file entrez2client.cpp.

References m_Ostream, x_EvalBoolean(), and x_FormatReply().

Referenced by Run().

void CEntrez2ClientApp::x_GetDocsums ( CEntrez2Client client,
const string query,
const string db,
int  start,
int  max_num 
)
private
void CEntrez2ClientApp::x_GetInfo ( CEntrez2Client client)
private

Definition at line 237 of file entrez2client.cpp.

References CEntrez2Client_Base::AskGet_info(), info, and m_ObjOstream.

Referenced by Run().

void CEntrez2ClientApp::x_GetLinkCounts ( CEntrez2Client client,
const string query,
const string db 
)
private
void CEntrez2ClientApp::x_GetLinked ( CEntrez2Client client,
const string query,
const string db 
)
private

Definition at line 357 of file entrez2client.cpp.

References Error(), and LOG_POST.

Referenced by Run().

void CEntrez2ClientApp::x_GetLinks ( CEntrez2Client client,
const string query,
const string db 
)
private

Definition at line 346 of file entrez2client.cpp.

References Error(), and LOG_POST.

Referenced by Run().

void CEntrez2ClientApp::x_GetParsedQuery ( CEntrez2Client client,
const string query,
const string db 
)
private

Definition at line 275 of file entrez2client.cpp.

References x_EvalBoolean(), and x_FormatReply().

Referenced by Run().

void CEntrez2ClientApp::x_GetTermHierarchy ( CEntrez2Client client,
const string query,
const string db 
)
private

Definition at line 335 of file entrez2client.cpp.

References Error(), and LOG_POST.

Referenced by Run().

void CEntrez2ClientApp::x_GetTermList ( CEntrez2Client client,
const string query,
const string db 
)
private

Definition at line 324 of file entrez2client.cpp.

References Error(), and LOG_POST.

Referenced by Run().

void CEntrez2ClientApp::x_GetTermPos ( CEntrez2Client client,
const string query,
const string db 
)
private

Definition at line 313 of file entrez2client.cpp.

References Error(), and LOG_POST.

Referenced by Run().

void CEntrez2ClientApp::x_GetUids ( CEntrez2Client client,
const string query,
const string db,
int  start,
int  max_num 
)
private

Definition at line 260 of file entrez2client.cpp.

References m_Ostream, x_EvalBoolean(), and x_FormatReply().

Referenced by Run().

Member Data Documentation

CRef<CEntrez2Client> CEntrez2ClientApp::m_Client
private

Definition at line 69 of file entrez2client.cpp.

Referenced by Run().

auto_ptr<CObjectOStream> CEntrez2ClientApp::m_ObjOstream
private

Definition at line 71 of file entrez2client.cpp.

Referenced by Run(), x_FormatReply(), x_GetDocsums(), and x_GetInfo().

CNcbiOstream* CEntrez2ClientApp::m_Ostream
private

The documentation for this class was generated from the following file:
Modified on Tue Jul 25 19:56:58 2017 by modify_doxy.py rev. 533848