File: job.h

package info (click to toggle)
pgagent 4.2.3-5
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 492 kB
  • sloc: cpp: 1,913; sql: 1,739; xml: 100; ansic: 58; makefile: 31; sh: 18
file content (48 lines) | stat: -rw-r--r-- 780 bytes parent folder | download | duplicates (2)
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
//////////////////////////////////////////////////////////////////////////
//
// pgAgent - PostgreSQL Tools
//
// Copyright (C) 2002 - 2024, The pgAdmin Development Team
// This software is released under the PostgreSQL Licence
//
// job.h - agent job
//
//////////////////////////////////////////////////////////////////////////


#ifndef JOB_H
#define JOB_H

#include <boost/thread.hpp>

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

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

protected:
	DBconn      *m_threadConn;
	std::string  m_jobid, m_logid;
	std::string  m_status;
};

class JobThread
{
public:
	JobThread(const std::string &jid);
	~JobThread();
	void operator()();

private:
	std::string  m_jobid;
};

#endif // JOB_H