blob: e56f5ef961c8db0ed2e6bb6df2631c7c178ef446 [file] [log] [blame]
// Copyright 2018 The Fuchsia Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef GARNET_BIN_ZXDB_CLIENT_JOB_IMPL_H_
#define GARNET_BIN_ZXDB_CLIENT_JOB_IMPL_H_
#include "garnet/bin/zxdb/client/job.h"
#include "garnet/public/lib/fxl/macros.h"
#include "garnet/public/lib/fxl/memory/weak_ptr.h"
namespace zxdb {
class JobContextImpl;
class JobImpl : public Job {
public:
JobImpl(JobContextImpl* job_context, uint64_t koid, const std::string& name);
~JobImpl() override;
JobContextImpl* job_context() const { return job_context_; }
// Job implementation:
JobContext* GetJobContext() const override;
uint64_t GetKoid() const override;
const std::string& GetName() const override;
private:
JobContextImpl* const job_context_; // The job_context owns |this|.
const uint64_t koid_;
std::string name_;
fxl::WeakPtrFactory<JobImpl> weak_factory_;
FXL_DISALLOW_COPY_AND_ASSIGN(JobImpl);
};
} // namespace zxdb
#endif // GARNET_BIN_ZXDB_CLIENT_JOB_IMPL_H_