blob: 49f1001689a1a86e0a1277ebd0ea54236d0d9d19 [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 "src/developer/debug/zxdb/client/job.h"
#include "src/lib/fxl/macros.h"
#include "src/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_