+class JCR {
+private:
+ pthread_mutex_t mutex; /* jcr mutex */
+ volatile int32_t _use_count; /* use count */
+ int32_t m_JobType; /* backup, restore, verify ... */
+ int32_t m_JobLevel; /* Job level */
+public:
+ void lock() {P(mutex); };
+ void unlock() {V(mutex); };
+ void inc_use_count(void) {lock(); _use_count++; unlock(); };
+ void dec_use_count(void) {lock(); _use_count--; unlock(); };
+ int32_t use_count() const { return _use_count; };
+ void init_mutex(void) {pthread_mutex_init(&mutex, NULL); };
+ void destroy_mutex(void) {pthread_mutex_destroy(&mutex); };
+ bool is_job_canceled() {return job_canceled(this); };
+ void set_JobLevel(int32_t JobLevel) { m_JobLevel = JobLevel; };
+ void setJobLevel(int32_t JobLevel) { m_JobLevel = JobLevel; };
+ void set_JobType(int32_t JobType) { m_JobType = JobType; };
+ void setJobType(int32_t JobType) { m_JobType = JobType; };
+ int32_t getJobType() const { return m_JobType; };
+ int32_t getJobLevel() const { return m_JobLevel; };
+ int32_t getJobStatus() const { return JobStatus; };
+ bool no_client_used() const {
+ return (m_JobType == JT_MIGRATE || m_JobType == JT_COPY ||
+ m_JobLevel == L_VIRTUAL_FULL);
+ };
+ const char *get_OperationName(); /* in lib/jcr.c */
+ const char *get_ActionName(bool past); /* in lib/jcr.c */
+ void setJobStatus(int JobStatus); /* in lib/jcr.c */
+ bool JobReads(); /* in lib/jcr.c */
+
+