/[pcsx2_0.9.7]/branch/r3113_0.9.7_beta/3rdparty/wxWidgets/include/wx/snglinst.h
ViewVC logotype

Contents of /branch/r3113_0.9.7_beta/3rdparty/wxWidgets/include/wx/snglinst.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 32 - (show annotations) (download)
Tue Sep 7 03:29:01 2010 UTC (9 years, 5 months ago) by william
File MIME type: text/plain
File size: 2323 byte(s)
branching from upstream revision (http://pcsx2.googlecode.com/svn/trunk
): r3113 to
https://svn.netsolutions.dnsalias.com/websvn/ps2/pcsx2/pcsx2_0.9.7/branch/r3113_0.9.7_beta
1 ///////////////////////////////////////////////////////////////////////////////
2 // Name: wx/snglinst.h
3 // Purpose: wxSingleInstanceChecker can be used to restrict the number of
4 // simultaneously running copies of a program to one
5 // Author: Vadim Zeitlin
6 // Modified by:
7 // Created: 08.06.01
8 // RCS-ID: $Id: snglinst.h 49563 2007-10-31 20:46:21Z VZ $
9 // Copyright: (c) 2001 Vadim Zeitlin <zeitlin@dptmaths.ens-cachan.fr>
10 // Licence: wxWindows licence
11 ///////////////////////////////////////////////////////////////////////////////
12
13 #ifndef _WX_SNGLINST_H_
14 #define _WX_SNGLINST_H_
15
16 #if wxUSE_SNGLINST_CHECKER
17
18 // ----------------------------------------------------------------------------
19 // wxSingleInstanceChecker
20 // ----------------------------------------------------------------------------
21
22 class WXDLLIMPEXP_BASE wxSingleInstanceChecker
23 {
24 public:
25 // default ctor, use Create() after it
26 wxSingleInstanceChecker() { Init(); }
27
28 // like Create() but no error checking (dangerous!)
29 wxSingleInstanceChecker(const wxString& name,
30 const wxString& path = wxEmptyString)
31 {
32 Init();
33 Create(name, path);
34 }
35
36 // name must be given and be as unique as possible, it is used as the mutex
37 // name under Win32 and the lock file name under Unix -
38 // wxTheApp->GetAppName() may be a good value for this parameter
39 //
40 // path is optional and is ignored under Win32 and used as the directory to
41 // create the lock file in under Unix (default is wxGetHomeDir())
42 //
43 // returns false if initialization failed, it doesn't mean that another
44 // instance is running - use IsAnotherRunning() to check it
45 bool Create(const wxString& name, const wxString& path = wxEmptyString);
46
47 // is another copy of this program already running?
48 bool IsAnotherRunning() const;
49
50 // dtor is not virtual, this class is not meant to be used polymorphically
51 ~wxSingleInstanceChecker();
52
53 private:
54 // common part of all ctors
55 void Init() { m_impl = NULL; }
56
57 // the implementation details (platform specific)
58 class WXDLLIMPEXP_FWD_BASE wxSingleInstanceCheckerImpl *m_impl;
59
60 DECLARE_NO_COPY_CLASS(wxSingleInstanceChecker)
61 };
62
63 #endif // wxUSE_SNGLINST_CHECKER
64
65 #endif // _WX_SNGLINST_H_

  ViewVC Help
Powered by ViewVC 1.1.22