File: job.h

package info (click to toggle)
pgagent 3.4.0-3
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 356 kB
  • ctags: 211
  • sloc: cpp: 1,697; sql: 560; xml: 100; ansic: 52; makefile: 33; sh: 9
file content (57 lines) | stat: -rw-r--r-- 835 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
//////////////////////////////////////////////////////////////////////////
//
// pgAgent - PostgreSQL Tools
//
// Copyright (C) 2002 - 2014, The pgAdmin Development Team
// This software is released under the PostgreSQL Licence
//
// job.h - agent job
//
//////////////////////////////////////////////////////////////////////////


#ifndef JOB_H
#define JOB_H

#include <wx/wx.h>


class Job
{
public:
	Job(DBconn *conn, const wxString &jid);
	~Job();

	int Execute();
	bool Runnable()
	{
		return status == wxT("r");
	}

protected:
	DBconn *threadConn;
	wxString jobid, logid;
	wxString status;
};


class JobThread : public wxThread
{
public:
	JobThread(const wxString &jid);
	~JobThread();
	bool Runnable()
	{
		return runnable;
	}

	virtual void *Entry();

private:
	wxString jobid;
	bool runnable;
	Job *job;
};

#endif // JOB_H