~ubuntu-branches/ubuntu/utopic/pgadmin3/utopic-proposed

« back to all changes in this revision

Viewing changes to pgadmin/include/pgscript/utilities/pgsThread.h

  • Committer: Bazaar Package Importer
  • Author(s): Gerfried Fuchs
  • Date: 2011-06-07 23:03:54 UTC
  • mfrom: (1.3.1 upstream) (13 sid)
  • mto: This revision was merged to the branch mainline in revision 14.
  • Revision ID: james.westby@ubuntu.com-20110607230354-3td4j9y71u4ahcvj
Tags: 1.14.0~beta1-1
* New upstream development release, adding Build-Depends on
  postgresql-server-dev-all >= 117~.
* Add Build-Depends on quilt, (un)patch to debian/rules and patch for fixing
  the include for kwlist.h in pgadmin/db/keywords.c.
* Add pg_config --includedir-server output to CPPFLAGS.
* Remove unrecognized configure options: --with-wx-config,
  --with-pgsql-include, --enable-gtk2, --enable-unicode.
* Clean up manually the files that are left behind after the broken
  distclean.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
//////////////////////////////////////////////////////////////////////////
2
2
//
3
3
// pgScript - PostgreSQL Tools
4
 
// 
5
 
// Copyright (C) 2002 - 2010, The pgAdmin Development Team
 
4
//
 
5
// Copyright (C) 2002 - 2011, The pgAdmin Development Team
6
6
// This software is released under the PostgreSQL Licence
7
7
//
8
8
//////////////////////////////////////////////////////////////////////////
22
22
 
23
23
class pgsThread : public wxThread
24
24
{
25
 
        
 
25
 
26
26
private:
27
 
        
 
27
 
28
28
        /** Symbol table (memory variables). */
29
 
        pgsVarMap & m_vars;
30
 
        
 
29
        pgsVarMap &m_vars;
 
30
 
31
31
        /** In order to have only one thread at once. */
32
 
        wxSemaphore & m_mutex;
33
 
        
 
32
        wxSemaphore &m_mutex;
 
33
 
34
34
        /** Connection to the database. */
35
 
        pgConn * m_connection;
36
 
        
 
35
        pgConn *m_connection;
 
36
 
37
37
        /** Either the file to parse or the string. */
38
38
        wxString m_data;
39
 
        
 
39
 
40
40
        /** Where to write the output. */
41
 
        pgsOutputStream & m_out;
42
 
        
 
41
        pgsOutputStream &m_out;
 
42
 
43
43
        /** The calling application. */
44
 
        pgsApplication & m_app; 
45
 
        
 
44
        pgsApplication &m_app;
 
45
 
46
46
        /** If set it is the encoding used in the file to parse. */
47
 
        wxMBConv * m_conv;
48
 
        
 
47
        wxMBConv *m_conv;
 
48
 
49
49
        /** Location of the last error if there was one otherwise -1 */
50
50
        int m_last_error_line;
51
 
        
 
51
 
52
52
public:
53
 
        
 
53
 
54
54
        /** Parses a file with the provided encoding. */
55
 
        pgsThread(pgsVarMap & vars, wxSemaphore & mutex, pgConn * connection,
56
 
                        const wxString & file, pgsOutputStream & out,
57
 
                        pgsApplication & app, wxMBConv * conv);
58
 
        
 
55
        pgsThread(pgsVarMap &vars, wxSemaphore &mutex, pgConn *connection,
 
56
                  const wxString &file, pgsOutputStream &out,
 
57
                  pgsApplication &app, wxMBConv *conv);
 
58
 
59
59
        /** Parses a wxString. */
60
 
        pgsThread(pgsVarMap & vars, wxSemaphore & mutex, pgConn * connection,
61
 
                        const wxString & string, pgsOutputStream & out, pgsApplication & app);
62
 
        
 
60
        pgsThread(pgsVarMap &vars, wxSemaphore &mutex, pgConn *connection,
 
61
                  const wxString &string, pgsOutputStream &out, pgsApplication &app);
 
62
 
63
63
        /** Destructor. */
64
64
        ~pgsThread();
65
 
        
 
65
 
66
66
        /** Thread main code. */
67
 
        virtual void * Entry();
68
 
        
 
67
        virtual void *Entry();
 
68
 
69
69
        /** Retrieves the connection to the database. */
70
 
        pgConn * connection();
71
 
        
 
70
        pgConn *connection();
 
71
 
72
72
        /** Gets a lock on the output stream. */
73
73
        void LockOutput();
74
 
        
 
74
 
75
75
        /** Releases the lock on the output stream. */
76
76
        void UnlockOutput();
77
 
        
 
77
 
78
78
        /** Set the position (line) of the last error. */
79
79
        void last_error_line(int line);
80
 
        
 
80
 
81
81
        /** Get the position (line) of the last error. */
82
82
        int last_error_line() const;
83
 
        
 
83
 
84
84
private:
85
 
        
86
 
        pgsThread(const pgsThread & that);
87
 
 
88
 
        pgsThread & operator=(const pgsThread & that);
89
 
        
 
85
 
 
86
        pgsThread(const pgsThread &that);
 
87
 
 
88
        pgsThread &operator=(const pgsThread &that);
 
89
 
90
90
};
91
91
 
92
92
#endif /*PGSTHREAD_H_*/