SCIRun  5.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Application.h
Go to the documentation of this file.
1 /*
2  For more information, please see: http://software.sci.utah.edu
3 
4  The MIT License
5 
6  Copyright (c) 2012 Scientific Computing and Imaging Institute,
7  University of Utah.
8 
9 
10  Permission is hereby granted, free of charge, to any person obtaining a
11  copy of this software and associated documentation files (the "Software"),
12  to deal in the Software without restriction, including without limitation
13  the rights to use, copy, modify, merge, publish, distribute, sublicense,
14  and/or sell copies of the Software, and to permit persons to whom the
15  Software is furnished to do so, subject to the following conditions:
16 
17  The above copyright notice and this permission notice shall be included
18  in all copies or substantial portions of the Software.
19 
20  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
21  OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
22  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
23  THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
24  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
25  FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
26  DEALINGS IN THE SOFTWARE.
27  */
28 
29 #ifndef CORE_APPLICATION_APPLICATION_H
30 #define CORE_APPLICATION_APPLICATION_H
31 
32 #include <boost/filesystem/path.hpp>
33 
34 #include <Core/Utils/Singleton.h>
37 #include <Core/Application/share.h>
38 
39 namespace SCIRun {
40  namespace Dataflow {
41  namespace Engine {
43  }}}
44 
45 namespace SCIRun
46 {
47 namespace Core
48 {
49 
50 /// @class Application
51 /// @brief Application is the thread that processes all the actions in the program.
52 
53 class Application;
55 typedef boost::shared_ptr<ApplicationPrivate> ApplicationPrivateHandle;
56 
57 
58 class SCISHARE Application : boost::noncopyable //: public EventHandler, public RecursiveLockable
59 {
61 
62 private:
63  Application();
64  virtual ~Application();
65 
66 public:
67  void readCommandLine(int argc, const char* argv[]);
68 
70  boost::shared_ptr<SCIRun::Dataflow::Engine::NetworkEditorController> controller();
71 
72  void executeCommandLineRequests(Commands::GlobalCommandFactoryHandle cmdFactory);
73 
74  boost::filesystem::path executablePath() const;
75  std::string commandHelpString() const;
76  std::string version() const;
77 
78  /// @todo: following will be useful later
79 #if 0
80 public:
81  void log_start();
82  void log_finish();
83 
84  bool get_user_directory( boost::filesystem::path& user_dir, bool config_path = false );
85  bool get_config_directory( boost::filesystem::path& config_dir );
86  bool get_user_desktop_directory( boost::filesystem::path& user_desktop_dir );
87  bool get_user_name( std::string& user_name );
88  bool get_application_filepath( boost::filesystem::path& app_filepath );
89  bool get_application_filename( boost::filesystem::path& app_filename );
90 
91  int get_process_id();
92 
93 public:
94  boost::signals2::signal< void () > reset_signal_;
95  boost::signals2::signal< void () > application_start_signal_;
96  boost::signals2::signal< void () > application_stop_signal_;
97 #endif
98 
99 private:
100  ApplicationPrivateHandle private_;
101 
102 //public:
103 // static bool IsApplicationThread();
104 // static
105 // static int GetMajorVersion();
106 // static int GetMinorVersion();
107 // static int GetPatchVersion();
108 // static bool Is64Bit();
109 // static bool Is32Bit();
110 // static std::string GetApplicationName();
111 // static std::string GetReleaseName();
112 // static std::string GetApplicationNameAndVersion();
113 // static std::string GetAbout();
114 };
115 
116 }}
117 
118 //#define ASSERT_IS_APPLICATION_THREAD() assert( Core::Application::IsApplicationThread() )
119 
120 #endif
Definition: NetworkEditorController.h:68
#define SCISHARE
Definition: share.h:39
boost::shared_ptr< ApplicationPrivate > ApplicationPrivateHandle
Definition: Application.h:54
Application is the thread that processes all the actions in the program.
Definition: Application.h:58
#define CORE_SINGLETON(name)
Definition: Singleton.h:59
boost::shared_ptr< GlobalCommandFactory > GlobalCommandFactoryHandle
Definition: CommandFactory.h:49
Definition: Application.cc:55
boost::shared_ptr< ApplicationParameters > ApplicationParametersHandle
Definition: CommandLine.h:60