chromium/third_party/fuzztest/src/fuzztest/internal/domains/domain.h

// Copyright 2022 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//      http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

// IWYU pragma: private, include "fuzztest/fuzztest.h"
// IWYU pragma: friend fuzztest/.*

#ifndef FUZZTEST_FUZZTEST_INTERNAL_DOMAINS_DOMAIN_H_
#define FUZZTEST_FUZZTEST_INTERNAL_DOMAINS_DOMAIN_H_

#include <cstddef>
#include <cstdint>
#include <memory>
#include <optional>

#include "absl/functional/function_ref.h"
#include "absl/random/bit_gen_ref.h"
#include "absl/status/status.h"
#include "absl/strings/string_view.h"
#include "./fuzztest/internal/domains/domain_base.h"
#include "./fuzztest/internal/domains/domain_type_erasure.h"  // IWYU pragma: export
#include "./fuzztest/internal/printer.h"
#include "./fuzztest/internal/serialization.h"

namespace fuzztest {
namespace internal {

// Generic printer used by `Domain<T>` and `UntypedDomain` that delegates
// printing to the actual printers through `UntypedDomainConcept`.
struct GenericPrinter {};

}  // namespace internal

// `Domain<T>` is the type-erased domain interface.
//
// It can be constructed from any object derived from `DomainBase` that
// implements the domain methods for the value type `T`.
template <typename T>
class Domain {};

// `UntypedDomain` is the version of the domain interface where the user value
// type is also type-erased. For now, this only has the minimal interface needed
// by the FuzzTest runtime.
class UntypedDomain {};

}  // namespace fuzztest

#endif  // FUZZTEST_FUZZTEST_INTERNAL_DOMAINS_DOMAIN_H_