sapling/eden/fs/store/ImportPriority.cpp
Chad Austin e309ec53aa refactor ImportPriority
Summary:
This diff improves ImportPriority in a variety of ways.

It was originally intended that ImportPriority fit in a single 64-bit
integer. Replace the bitfield with a single uint64_t and manual
shifts. Also, add a static_assert to enforce the intent.

Use semantic constants to make it clear the relative import priorities
across EdenFS.

Add some unit tests.

Reviewed By: genevievehelsel

Differential Revision: D40602313

fbshipit-source-id: 3c99249ef2863396235ff1159b10b54d7478671d
2022-11-15 16:23:30 -08:00

25 lines
528 B
C++

/*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This software may be used and distributed according to the terms of the
* GNU General Public License version 2.
*/
#include "eden/fs/store/ImportPriority.h"
namespace facebook::eden {
std::string_view ImportPriority::className() const noexcept {
switch (getClass()) {
case Class::Low:
return "Low";
case Class::Normal:
return "Normal";
case Class::High:
return "High";
}
return "Unlabeled";
}
} // namespace facebook::eden