// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #pragma once #include "componentguard.h" namespace search { template ComponentGuard::ComponentGuard() = default; template ComponentGuard::ComponentGuard(const Component & component) : _component(component), _generationGuard(valid() ? _component->takeGenerationGuard() : Guard()) { } template ComponentGuard::ComponentGuard(const ComponentGuard &) = default; template ComponentGuard::ComponentGuard(ComponentGuard &&) = default; template ComponentGuard & ComponentGuard::operator = (ComponentGuard &&) = default; template ComponentGuard & ComponentGuard::operator = (const ComponentGuard & rhs) { ComponentGuard tmp(rhs); *this = std::move(tmp); return *this; } template ComponentGuard::~ComponentGuard() = default; }