Skip to content

Commit

Permalink
dird: add or delete default copy constructors and assign operators
Browse files Browse the repository at this point in the history
- SchedulerJobItem and SchedulerJobItemQueue
  • Loading branch information
franku committed Nov 21, 2019
1 parent 859d591 commit ad12e9a
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
14 changes: 14 additions & 0 deletions core/src/dird/scheduler_job_item_queue.h
Expand Up @@ -34,7 +34,14 @@ class JobResource;
struct SchedulerJobItemQueuePrivate;

struct SchedulerJobItem {
~SchedulerJobItem() = default;

SchedulerJobItem() = default;
SchedulerJobItem(const SchedulerJobItem& other) = default;
SchedulerJobItem(SchedulerJobItem&& other) = default;
SchedulerJobItem& operator=(const SchedulerJobItem& other) = default;
SchedulerJobItem& operator=(SchedulerJobItem&& other) = default;

SchedulerJobItem(JobResource* job_in,
RunResource* run_in,
time_t runtime_in,
Expand All @@ -43,11 +50,13 @@ struct SchedulerJobItem {
{
is_valid = job && runtime;
};

bool operator==(const SchedulerJobItem& rhs) const
{
return runtime == rhs.runtime && job == rhs.job &&
priority == rhs.priority && run == rhs.run;
}

bool operator!=(const SchedulerJobItem& rhs) const { return !(*this == rhs); }

JobResource* job{nullptr};
Expand All @@ -68,6 +77,11 @@ class SchedulerJobItemQueue {
bool Empty() const;
void Clear();

SchedulerJobItemQueue(const SchedulerJobItemQueue& other) = delete;
SchedulerJobItemQueue(SchedulerJobItemQueue&& other) = delete;
SchedulerJobItemQueue& operator=(const SchedulerJobItemQueue& other) = delete;
SchedulerJobItemQueue& operator=(SchedulerJobItemQueue&& other) = delete;

private:
static constexpr int default_priority{10};
std::unique_ptr<SchedulerJobItemQueuePrivate> impl_;
Expand Down
1 change: 0 additions & 1 deletion core/src/dird/scheduler_private.h
Expand Up @@ -37,7 +37,6 @@ class SchedulerTimeAdapter;
class SchedulerPrivate {
public:
~SchedulerPrivate();

SchedulerPrivate();

SchedulerPrivate(const SchedulerPrivate& other) = delete;
Expand Down

0 comments on commit ad12e9a

Please sign in to comment.