Initial commit
This commit is contained in:
Executable
+32
@@ -0,0 +1,32 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <wfr/common/eventsystem/EventListener.h>
|
||||
#include <ostream>
|
||||
|
||||
|
||||
namespace wfr {
|
||||
namespace eventsystem {
|
||||
|
||||
// forward declarations
|
||||
class Event;
|
||||
class WorkflowStatusEvent;
|
||||
class ActivityStatusEvent;
|
||||
class ActivityInstanceStatusEvent;
|
||||
|
||||
/**
|
||||
* Logs events to a std::ostream (e.g. std::cout).
|
||||
**/
|
||||
class OStreamLogger: public wfr::eventsystem::EventListener {
|
||||
private:
|
||||
std::ostream& oStream;
|
||||
|
||||
public:
|
||||
OStreamLogger(std::ostream& oStream) : oStream(oStream) {};
|
||||
|
||||
virtual void notifyEvent(const std::shared_ptr<Event>& event) noexcept override;
|
||||
};
|
||||
|
||||
} /* namespace eventsystem */
|
||||
} /* namespace wfr */
|
||||
|
||||
Executable
+105
@@ -0,0 +1,105 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <wfr/common/eventsystem/EventListener.h>
|
||||
#include <wfr/common/types/WfrTypes.h>
|
||||
#include <wfr/common/types/WfsTypes.h>
|
||||
#include <string>
|
||||
#include <map>
|
||||
#include <thread>
|
||||
#include <memory>
|
||||
#include <queue>
|
||||
#include <mutex>
|
||||
#include <condition_variable>
|
||||
|
||||
#include <odb/database.hxx>
|
||||
#include <odb/transaction.hxx>
|
||||
#include <odb/session.hxx>
|
||||
|
||||
#include <odb/sqlite/database.hxx>
|
||||
|
||||
|
||||
|
||||
namespace wfr {
|
||||
namespace wfs {
|
||||
class Workflow;
|
||||
class Activity;
|
||||
class ActivityInstance;
|
||||
}
|
||||
}
|
||||
|
||||
namespace wfr {
|
||||
namespace eventsystem {
|
||||
|
||||
namespace odbmodel {
|
||||
|
||||
class Workflow;
|
||||
class Activity;
|
||||
class ActivityInstance;
|
||||
|
||||
}
|
||||
|
||||
class Event;
|
||||
class WorkflowStatusEvent;
|
||||
class ActivityStatusEvent;
|
||||
class ActivityInstanceStatusEvent;
|
||||
class ComputingResourceStatusEvent;
|
||||
class ComponentStatusEvent;
|
||||
|
||||
class SQLiteLogger : public EventListener {
|
||||
protected:
|
||||
static void dbwriterfunc(SQLiteLogger* logger);
|
||||
|
||||
std::unique_ptr<std::thread> loggerThread;
|
||||
bool threadRunning = false;
|
||||
bool threadBreakFlag = false;
|
||||
std::mutex threadMutex;
|
||||
std::condition_variable threadCondition;
|
||||
std::queue<std::shared_ptr<Event>> eventQueue;
|
||||
|
||||
std::string filename;
|
||||
std::unique_ptr<odb::sqlite::database> dbHandle;
|
||||
bool readyFlag = false;
|
||||
|
||||
int statProcessedEvents;
|
||||
int statWrittenEvents;
|
||||
|
||||
/*typedef std::map<wfr_id_t, std::shared_ptr<odbmodel::Workflow>> workflowMap_t;
|
||||
typedef std::map<wfr_id_t, std::shared_ptr<odbmodel::Activity>> activityMap_t;
|
||||
typedef std::map<wfr_id_t, std::shared_ptr<odbmodel::ActivityInstance>> activityInstanceMap_t;
|
||||
|
||||
workflowMap_t workflowMap;
|
||||
activityMap_t activityMap;
|
||||
activityInstanceMap_t activityInstanceMap;*/
|
||||
|
||||
/*void handleWorkflowStatusEvent(WorkflowStatusEvent &event);
|
||||
void handleActicityStatusEvent(ActivityStatusEvent &event);
|
||||
void handleActicityInstanceStatusEvent(ActivityInstanceStatusEvent &event);
|
||||
void handleComputingResourceStatusEvent(ComputingResourceStatusEvent &event);
|
||||
void handleComponentStatusEvent(ComponentStatusEvent &event);
|
||||
|
||||
std::shared_ptr<odbmodel::Workflow> getWorkflowFromWfsMap(wfs::Workflow& wf);
|
||||
void persistWorkflow(std::shared_ptr<odbmodel::Workflow>& wfp, wfs::Workflow& wf);
|
||||
std::shared_ptr<odbmodel::Activity> getActivityFromWfsMap(wfs::Activity& act);
|
||||
void persistActivity(std::shared_ptr<odbmodel::Activity>& ap, wfs::Activity& a);
|
||||
std::shared_ptr<odbmodel::ActivityInstance> getActivityInstanceFromWfsMap(wfs::ActivityInstance& act);
|
||||
void persistActivityInstance(std::shared_ptr<odbmodel::ActivityInstance>& ap, wfs::ActivityInstance& a);
|
||||
|
||||
void writeWorkflowStatus(std::shared_ptr<odbmodel::Workflow>& pWf, WorkflowStatusEvent &event);
|
||||
void writeActivityStatus(std::shared_ptr<odbmodel::Activity>& pA, ActivityStatusEvent &event);
|
||||
void writeActivityInstanceStatus(std::shared_ptr<odbmodel::ActivityInstance>& pA, ActivityInstanceStatusEvent &event);
|
||||
void writeComputingResourceStatus(std::shared_ptr<odbmodel::Workflow>& pwf, std::shared_ptr<odbmodel::ActivityInstance>& pai, ComputingResourceStatusEvent &event);
|
||||
void writeComponentStatus(std::shared_ptr<odbmodel::Workflow>& pwf, ComponentStatusEvent &event);*/
|
||||
|
||||
public:
|
||||
SQLiteLogger(std::string filename);
|
||||
virtual ~SQLiteLogger();
|
||||
|
||||
bool isReady() { return readyFlag; }
|
||||
|
||||
virtual void notifyEvent(const std::shared_ptr<Event>& event) noexcept;
|
||||
};
|
||||
|
||||
} /* namespace eventsystem */
|
||||
} /* namespace wfr */
|
||||
|
||||
+650
@@ -0,0 +1,650 @@
|
||||
/*
|
||||
* SimpleDBModel.h
|
||||
*
|
||||
* Created on: 09.05.2014
|
||||
* Author: matthias
|
||||
*/
|
||||
|
||||
#ifndef SIMPLEDBMODEL_H_
|
||||
#define SIMPLEDBMODEL_H_
|
||||
|
||||
#include <wfr/common/types/WfsTypes.h>
|
||||
#include <odb/core.hxx>
|
||||
#include <vector>
|
||||
#include <memory>
|
||||
#include <string>
|
||||
|
||||
namespace wfr {
|
||||
namespace eventsystem {
|
||||
#pragma db namespace session
|
||||
namespace odbmodel {
|
||||
|
||||
class Workflow;
|
||||
class Activity;
|
||||
class ActivityInstance;
|
||||
class WorkflowStatusEvent;
|
||||
class ActivityStatusEvent;
|
||||
class ActivityInstanceStatusEvent;
|
||||
|
||||
|
||||
#pragma db value(wfr_id_t) type("BigInt")
|
||||
#pragma db value(wfr_size_t) type("BigInt")
|
||||
|
||||
|
||||
#pragma db object pointer(std::shared_ptr)
|
||||
class Workflow {
|
||||
|
||||
friend class odb::access;
|
||||
|
||||
private:
|
||||
#pragma db id auto
|
||||
uint32_t oid;
|
||||
|
||||
wfr_id_t wfid;
|
||||
|
||||
std::string uuid;
|
||||
|
||||
std::string name;
|
||||
|
||||
#pragma db inverse(parentWorkflow)
|
||||
std::vector<std::weak_ptr<Activity>> activities;
|
||||
|
||||
std::weak_ptr<Activity> toplevelActivity;
|
||||
|
||||
#pragma db inverse(parentWorkflow)
|
||||
std::vector<std::weak_ptr<WorkflowStatusEvent>> statusEvents;
|
||||
|
||||
|
||||
public:
|
||||
Workflow() : oid(0), wfid(0) {}
|
||||
|
||||
Workflow(wfr_id_t wfid, std::string uuid) : oid(0), wfid(wfid), uuid(uuid) {}
|
||||
|
||||
std::vector<std::weak_ptr<Activity> >& getActivities() {
|
||||
return activities;
|
||||
}
|
||||
|
||||
const std::string& getName() const {
|
||||
return name;
|
||||
}
|
||||
|
||||
void setName(const std::string& name) {
|
||||
this->name = name;
|
||||
}
|
||||
|
||||
const std::weak_ptr<Activity>& getToplevelActivity() const {
|
||||
return toplevelActivity;
|
||||
}
|
||||
|
||||
void setToplevelActivity(const std::weak_ptr<Activity>& toplevelActivity) {
|
||||
this->toplevelActivity = toplevelActivity;
|
||||
}
|
||||
|
||||
wfr_id_t getOid() const {
|
||||
return oid;
|
||||
}
|
||||
|
||||
const std::string& getUuid() const {
|
||||
return uuid;
|
||||
}
|
||||
|
||||
wfr_id_t getWfid() const {
|
||||
return wfid;
|
||||
}
|
||||
|
||||
void setWfid(wfr_id_t wfid) {
|
||||
this->wfid = wfid;
|
||||
}
|
||||
};
|
||||
|
||||
#pragma db object pointer(std::shared_ptr)
|
||||
class WorkflowStatusEvent {
|
||||
|
||||
friend class odb::access;
|
||||
|
||||
private:
|
||||
#pragma db id auto
|
||||
uint32_t oid;
|
||||
|
||||
#pragma db not_null
|
||||
std::shared_ptr<Workflow> parentWorkflow;
|
||||
|
||||
std::string newStatus;
|
||||
|
||||
std::string oldStatus;
|
||||
|
||||
uint64_t timestamp;
|
||||
|
||||
public:
|
||||
WorkflowStatusEvent() : oid(0), timestamp(0) {}
|
||||
|
||||
const std::string& getNewStatus() {
|
||||
return newStatus;
|
||||
}
|
||||
|
||||
void setNewStatus(const std::string& newStatus) {
|
||||
this->newStatus = newStatus;
|
||||
}
|
||||
|
||||
wfr_id_t getOid() {
|
||||
return oid;
|
||||
}
|
||||
|
||||
const std::string& getOldStatus() {
|
||||
return oldStatus;
|
||||
}
|
||||
|
||||
void setOldStatus(const std::string& oldStatus) {
|
||||
this->oldStatus = oldStatus;
|
||||
}
|
||||
|
||||
const std::shared_ptr<Workflow>& getParentWorkflow() {
|
||||
return parentWorkflow;
|
||||
}
|
||||
|
||||
void setParentWorkflow(const std::shared_ptr<Workflow>& parentWorkflow) {
|
||||
this->parentWorkflow = parentWorkflow;
|
||||
}
|
||||
|
||||
uint64_t getTimestamp() {
|
||||
return timestamp;
|
||||
}
|
||||
|
||||
void setTimestamp(uint64_t timestamp) {
|
||||
this->timestamp = timestamp;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
||||
#pragma db object pointer(std::shared_ptr)
|
||||
class Activity {
|
||||
|
||||
friend class odb::access;
|
||||
|
||||
private:
|
||||
#pragma db id auto
|
||||
uint32_t oid;
|
||||
|
||||
wfr_id_t actid;
|
||||
|
||||
std::string name;
|
||||
|
||||
#pragma db not_null
|
||||
std::shared_ptr<Workflow> parentWorkflow;
|
||||
|
||||
std::shared_ptr<Activity> parent;
|
||||
|
||||
#pragma db inverse(parentActivity)
|
||||
std::vector<std::weak_ptr<ActivityStatusEvent>> statusEvents;
|
||||
|
||||
std::string type;
|
||||
|
||||
wfr_id_t branchID;
|
||||
|
||||
#pragma db inverse(baseActivity)
|
||||
std::vector<std::weak_ptr<ActivityInstance>> instances;
|
||||
|
||||
std::vector<std::weak_ptr<Activity>> successors;
|
||||
|
||||
std::vector<std::weak_ptr<Activity>> predecessors;
|
||||
|
||||
public:
|
||||
Activity() : oid(0), actid(0), branchID(0) {}
|
||||
|
||||
Activity(wfr_id_t actid, wfr_id_t branchid) : oid(0), actid(actid), branchID(branchid) {}
|
||||
|
||||
wfr_id_t getBranchId() const {
|
||||
return branchID;
|
||||
}
|
||||
|
||||
std::vector<std::weak_ptr<ActivityInstance> >& getInstances() {
|
||||
return instances;
|
||||
}
|
||||
|
||||
const std::string& getName() const {
|
||||
return name;
|
||||
}
|
||||
|
||||
void setName(const std::string& name) {
|
||||
this->name = name;
|
||||
}
|
||||
|
||||
const std::shared_ptr<Workflow>& getParentWorkflow() const {
|
||||
return parentWorkflow;
|
||||
}
|
||||
|
||||
void setParentWorkflow(const std::shared_ptr<Workflow>& parentWorkflow) {
|
||||
this->parentWorkflow = parentWorkflow;
|
||||
}
|
||||
|
||||
const std::shared_ptr<Activity>& getParent() const {
|
||||
return parent;
|
||||
}
|
||||
|
||||
void setParent(const std::shared_ptr<Activity>& parent) {
|
||||
this->parent = parent;
|
||||
}
|
||||
|
||||
std::vector<std::weak_ptr<Activity> >& getPredecessors() {
|
||||
return predecessors;
|
||||
}
|
||||
|
||||
std::vector<std::weak_ptr<Activity> >& getSuccessors() {
|
||||
return successors;
|
||||
}
|
||||
|
||||
const std::string& getType() const {
|
||||
return type;
|
||||
}
|
||||
|
||||
void setType(const std::string& type) {
|
||||
this->type = type;
|
||||
}
|
||||
|
||||
wfr_id_t getOid() const {
|
||||
return oid;
|
||||
}
|
||||
|
||||
wfr_id_t getActid() const {
|
||||
return actid;
|
||||
}
|
||||
|
||||
void setActid(wfr_id_t actid) {
|
||||
this->actid = actid;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
#pragma db object pointer(std::shared_ptr)
|
||||
class ActivityStatusEvent {
|
||||
|
||||
friend class odb::access;
|
||||
|
||||
private:
|
||||
#pragma db id auto
|
||||
uint32_t oid;
|
||||
|
||||
#pragma db not_null
|
||||
std::shared_ptr<Activity> parentActivity;
|
||||
|
||||
std::string newStatus;
|
||||
|
||||
std::string oldStatus;
|
||||
|
||||
uint64_t timestamp;
|
||||
|
||||
public:
|
||||
ActivityStatusEvent() : oid(0), timestamp(0) {}
|
||||
|
||||
const std::string& getNewStatus() {
|
||||
return newStatus;
|
||||
}
|
||||
|
||||
void setNewStatus(const std::string& newStatus) {
|
||||
this->newStatus = newStatus;
|
||||
}
|
||||
|
||||
wfr_id_t getOid() {
|
||||
return oid;
|
||||
}
|
||||
|
||||
const std::string& getOldStatus() {
|
||||
return oldStatus;
|
||||
}
|
||||
|
||||
void setOldStatus(const std::string& oldStatus) {
|
||||
this->oldStatus = oldStatus;
|
||||
}
|
||||
|
||||
const std::shared_ptr<Activity>& getParentActivity() {
|
||||
return parentActivity;
|
||||
}
|
||||
|
||||
void setParentActivity(const std::shared_ptr<Activity>& parentActivity) {
|
||||
this->parentActivity = parentActivity;
|
||||
}
|
||||
|
||||
uint64_t getTimestamp() {
|
||||
return timestamp;
|
||||
}
|
||||
|
||||
void setTimestamp(uint64_t timestamp) {
|
||||
this->timestamp = timestamp;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
#pragma db object pointer(std::shared_ptr)
|
||||
class ActivityInstance {
|
||||
|
||||
friend class odb::access;
|
||||
|
||||
private:
|
||||
#pragma db id auto
|
||||
uint32_t oid;
|
||||
|
||||
wfr_id_t instid;
|
||||
|
||||
wfr_id_t iterationID;
|
||||
|
||||
std::vector<std::weak_ptr<ActivityInstance>> successors;
|
||||
|
||||
std::vector<std::weak_ptr<ActivityInstance>> predecessors;
|
||||
|
||||
#pragma db not_null
|
||||
std::shared_ptr<Activity> baseActivity;
|
||||
|
||||
#pragma db not_null
|
||||
std::shared_ptr<Workflow> parentWorkflow;
|
||||
|
||||
std::shared_ptr<ActivityInstance> parentInstance;
|
||||
|
||||
#pragma db inverse(parentInstance)
|
||||
std::vector<std::weak_ptr<ActivityInstanceStatusEvent>> statusEvents;
|
||||
|
||||
public:
|
||||
ActivityInstance() : oid(0), instid(0), iterationID(0) {}
|
||||
|
||||
ActivityInstance(wfr_id_t instid, wfr_id_t iterationID) : oid(0), instid(instid), iterationID(iterationID) {}
|
||||
|
||||
wfr_id_t getInstid() {
|
||||
return instid;
|
||||
}
|
||||
|
||||
void setInstid(wfr_id_t instid) {
|
||||
this->instid = instid;
|
||||
}
|
||||
|
||||
wfr_id_t getIterationId() {
|
||||
return iterationID;
|
||||
}
|
||||
|
||||
void setIterationId(wfr_id_t iterationId) {
|
||||
iterationID = iterationId;
|
||||
}
|
||||
|
||||
wfr_id_t getOid() {
|
||||
return oid;
|
||||
}
|
||||
|
||||
std::shared_ptr<Activity>& getBaseActivity() {
|
||||
return baseActivity;
|
||||
}
|
||||
|
||||
void setBaseActivity(std::shared_ptr<Activity>& parentActivity) {
|
||||
this->baseActivity = parentActivity;
|
||||
}
|
||||
|
||||
std::vector<std::weak_ptr<ActivityInstance> >& getPredecessors() {
|
||||
return predecessors;
|
||||
}
|
||||
|
||||
std::vector<std::weak_ptr<ActivityInstance> >& getSuccessors() {
|
||||
return successors;
|
||||
}
|
||||
|
||||
const std::shared_ptr<ActivityInstance>& getParentInstance() const {
|
||||
return parentInstance;
|
||||
}
|
||||
|
||||
void setParentInstance(
|
||||
const std::shared_ptr<ActivityInstance>& parentInstance) {
|
||||
this->parentInstance = parentInstance;
|
||||
}
|
||||
|
||||
std::shared_ptr<Workflow>& getParentWorkflow() {
|
||||
return parentWorkflow;
|
||||
}
|
||||
|
||||
void setParentWorkflow(std::shared_ptr<Workflow>& parentWorkflow) {
|
||||
this->parentWorkflow = parentWorkflow;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
#pragma db object pointer(std::shared_ptr)
|
||||
class ActivityInstanceStatusEvent {
|
||||
|
||||
friend class odb::access;
|
||||
|
||||
private:
|
||||
#pragma db id auto
|
||||
uint32_t oid;
|
||||
|
||||
#pragma db not_null
|
||||
std::shared_ptr<ActivityInstance> parentInstance;
|
||||
|
||||
std::string newStatus;
|
||||
|
||||
std::string oldStatus;
|
||||
|
||||
uint64_t timestamp;
|
||||
|
||||
public:
|
||||
ActivityInstanceStatusEvent() : oid(0), timestamp(0) {}
|
||||
|
||||
const std::string& getNewStatus() {
|
||||
return newStatus;
|
||||
}
|
||||
|
||||
void setNewStatus(const std::string& newStatus) {
|
||||
this->newStatus = newStatus;
|
||||
}
|
||||
|
||||
wfr_id_t getOid() {
|
||||
return oid;
|
||||
}
|
||||
|
||||
const std::string& getOldStatus() {
|
||||
return oldStatus;
|
||||
}
|
||||
|
||||
void setOldStatus(const std::string& oldStatus) {
|
||||
this->oldStatus = oldStatus;
|
||||
}
|
||||
|
||||
const std::shared_ptr<ActivityInstance>& getParentInstance() {
|
||||
return parentInstance;
|
||||
}
|
||||
|
||||
void setParentInstance(const std::shared_ptr<ActivityInstance>& parentActivity) {
|
||||
this->parentInstance = parentActivity;
|
||||
}
|
||||
|
||||
uint64_t getTimestamp() {
|
||||
return timestamp;
|
||||
}
|
||||
|
||||
void setTimestamp(uint64_t timestamp) {
|
||||
this->timestamp = timestamp;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
#pragma db object pointer(std::shared_ptr)
|
||||
class DeviceInstanceStatusEvent {
|
||||
|
||||
friend class odb::access;
|
||||
|
||||
private:
|
||||
#pragma db id auto
|
||||
uint32_t oid;
|
||||
|
||||
std::shared_ptr<Workflow> parentWorkflow;
|
||||
|
||||
std::string deviceType;
|
||||
|
||||
wfr_id_t deviceID;
|
||||
|
||||
std::string newStatus;
|
||||
|
||||
std::string oldStatus;
|
||||
|
||||
uint64_t timestamp;
|
||||
|
||||
std::shared_ptr<ActivityInstance> executedInstance;
|
||||
|
||||
wfr_id_t executedImplID;
|
||||
|
||||
wfr_size_t deviceSlotCount;
|
||||
|
||||
public:
|
||||
DeviceInstanceStatusEvent() : oid(0), deviceID(0), timestamp(0), executedImplID(0), deviceSlotCount(0) {}
|
||||
|
||||
const std::string& getNewStatus() {
|
||||
return newStatus;
|
||||
}
|
||||
|
||||
void setNewStatus(const std::string& newStatus) {
|
||||
this->newStatus = newStatus;
|
||||
}
|
||||
|
||||
wfr_id_t getOid() {
|
||||
return oid;
|
||||
}
|
||||
|
||||
const std::string& getOldStatus() {
|
||||
return oldStatus;
|
||||
}
|
||||
|
||||
void setOldStatus(const std::string& oldStatus) {
|
||||
this->oldStatus = oldStatus;
|
||||
}
|
||||
|
||||
const std::shared_ptr<Workflow>& getParentWorkflow() {
|
||||
return parentWorkflow;
|
||||
}
|
||||
|
||||
void setParentWorkflow(const std::shared_ptr<Workflow>& parentWorkflow) {
|
||||
this->parentWorkflow = parentWorkflow;
|
||||
}
|
||||
|
||||
uint64_t getTimestamp() {
|
||||
return timestamp;
|
||||
}
|
||||
|
||||
void setTimestamp(uint64_t timestamp) {
|
||||
this->timestamp = timestamp;
|
||||
}
|
||||
|
||||
wfr_id_t getDeviceId() {
|
||||
return deviceID;
|
||||
}
|
||||
|
||||
void setDeviceId(wfr_id_t deviceId) {
|
||||
deviceID = deviceId;
|
||||
}
|
||||
|
||||
wfr_size_t getDeviceSlotCount() {
|
||||
return deviceSlotCount;
|
||||
}
|
||||
|
||||
void setDeviceSlotCount(wfr_size_t deviceSlotCount) {
|
||||
this->deviceSlotCount = deviceSlotCount;
|
||||
}
|
||||
|
||||
const std::string& getDeviceType() {
|
||||
return deviceType;
|
||||
}
|
||||
|
||||
void setDeviceType(const std::string& deviceType) {
|
||||
this->deviceType = deviceType;
|
||||
}
|
||||
|
||||
wfr_id_t getExecutedImplId() {
|
||||
return executedImplID;
|
||||
}
|
||||
|
||||
void setExecutedImplId(wfr_id_t executedImplId) {
|
||||
executedImplID = executedImplId;
|
||||
}
|
||||
|
||||
const std::shared_ptr<ActivityInstance>& getExecutedInstance() {
|
||||
return executedInstance;
|
||||
}
|
||||
|
||||
void setExecutedInstance(const std::shared_ptr<ActivityInstance>& executedInstance) {
|
||||
this->executedInstance = executedInstance;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
#pragma db object pointer(std::shared_ptr)
|
||||
class ComponentStatusEvent {
|
||||
|
||||
friend class odb::access;
|
||||
|
||||
private:
|
||||
#pragma db id auto
|
||||
uint32_t oid;
|
||||
|
||||
std::shared_ptr<Workflow> workflow;
|
||||
|
||||
std::string componentType;
|
||||
|
||||
std::string newStatus;
|
||||
|
||||
std::string oldStatus;
|
||||
|
||||
uint64_t timestamp;
|
||||
|
||||
public:
|
||||
ComponentStatusEvent() : oid(0), timestamp(0) {}
|
||||
|
||||
std::string& getComponentType() {
|
||||
return componentType;
|
||||
}
|
||||
|
||||
void setComponentType(const std::string& componentType) {
|
||||
this->componentType = componentType;
|
||||
}
|
||||
|
||||
std::string& getNewStatus() {
|
||||
return newStatus;
|
||||
}
|
||||
|
||||
void setNewStatus(const std::string& newStatus) {
|
||||
this->newStatus = newStatus;
|
||||
}
|
||||
|
||||
wfr_id_t getOid() {
|
||||
return oid;
|
||||
}
|
||||
|
||||
std::string& getOldStatus() {
|
||||
return oldStatus;
|
||||
}
|
||||
|
||||
void setOldStatus(const std::string& oldStatus) {
|
||||
this->oldStatus = oldStatus;
|
||||
}
|
||||
|
||||
uint64_t getTimestamp() {
|
||||
return timestamp;
|
||||
}
|
||||
|
||||
void setTimestamp(uint64_t timestamp) {
|
||||
this->timestamp = timestamp;
|
||||
}
|
||||
|
||||
std::shared_ptr<Workflow>& getWorkflow() {
|
||||
return workflow;
|
||||
}
|
||||
|
||||
void setWorkflow(const std::shared_ptr<Workflow>& workflow) {
|
||||
this->workflow = workflow;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
} /* namespace odbmodel */
|
||||
} /* namespace eventsystem */
|
||||
} /* namespace wfr */
|
||||
|
||||
|
||||
|
||||
#endif /* SIMPLEDBMODEL_H_ */
|
||||
Reference in New Issue
Block a user