Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions retinify/include/retinify/constraints.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
// SPDX-FileCopyrightText: Copyright (c) 2025 Sensui Yagi. All rights reserved.
// SPDX-License-Identifier: Apache-2.0

#pragma once

namespace retinify
{
/// @brief
/// Base class that disables copy and move operations for derived classes.
class NoCopyMove
{
protected:
NoCopyMove() = default;
~NoCopyMove() = default;
NoCopyMove(const NoCopyMove &) = delete;
auto operator=(const NoCopyMove &) -> NoCopyMove & = delete;
NoCopyMove(NoCopyMove &&) = delete;
auto operator=(NoCopyMove &&) -> NoCopyMove & = delete;
};
} // namespace retinify
2 changes: 1 addition & 1 deletion retinify/include/retinify/logging.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ RETINIFY_API void SetLogLevel(LogLevel level) noexcept;

/// @brief
/// Logging source location options
enum class LogLocation
enum class LogLocation : std::uint8_t
{
/// @brief
/// No source location
Expand Down
7 changes: 2 additions & 5 deletions retinify/include/retinify/pipeline.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

#pragma once

#include "retinify/constraints.hpp"
#include "retinify/geometry.hpp"
#include "retinify/status.hpp"

Expand Down Expand Up @@ -41,15 +42,11 @@ enum class DepthMode : std::uint8_t

/// @brief
/// A `retinify::Pipeline` provides an interface for running a stereo matching
class RETINIFY_API Pipeline
class RETINIFY_API Pipeline : private NoCopyMove
{
public:
Pipeline() noexcept;
~Pipeline() noexcept;
Pipeline(const Pipeline &) = delete;
auto operator=(const Pipeline &) noexcept -> Pipeline & = delete;
Pipeline(Pipeline &&) noexcept = delete;
auto operator=(Pipeline &&) noexcept -> Pipeline & = delete;

/// @brief
/// Initializes the stereo matching pipeline with the given image dimensions
Expand Down
7 changes: 2 additions & 5 deletions retinify/src/mat.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
#include "stream.hpp"

#include "retinify/attributes.hpp"
#include "retinify/constraints.hpp"
#include "retinify/status.hpp"

#include <array>
Expand All @@ -23,15 +24,11 @@ enum class MatLocation
HOST,
};

class RETINIFY_API Mat
class RETINIFY_API Mat : public NoCopyMove
{
public:
Mat() noexcept = default;
~Mat() noexcept;
Mat(const Mat &) = delete;
auto operator=(const Mat &) -> Mat & = delete;
Mat(Mat &&other) noexcept = delete;
auto operator=(Mat &&other) noexcept -> Mat & = delete;
[[nodiscard]] auto Allocate(std::size_t rows, std::size_t cols, std::size_t channels, std::size_t bytesPerElement, MatLocation location) noexcept -> Status;
[[nodiscard]] auto Free() noexcept -> Status;
[[nodiscard]] auto Upload(const void *hostData, std::size_t hostStride, Stream &stream) const noexcept -> Status;
Expand Down
7 changes: 2 additions & 5 deletions retinify/src/session.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
#include "mat.hpp"
#include "stream.hpp"

#include "retinify/constraints.hpp"
#include "retinify/status.hpp"

#include <array>
Expand All @@ -30,15 +31,11 @@ constexpr int kEngineOptWidth = 640;
constexpr int kEngineMaxHeight = 720;
constexpr int kEngineMaxWidth = 1280;

class RETINIFY_API Session
class RETINIFY_API Session : public NoCopyMove
{
public:
Session() noexcept = default;
~Session() noexcept = default;
Session(const Session &) = delete;
auto operator=(const Session &) noexcept -> Session & = delete;
Session(Session &&other) noexcept = delete;
auto operator=(Session &&other) noexcept -> Session & = delete;
[[nodiscard]] auto Initialize(const char *modelPath) noexcept -> Status;
[[nodiscard]] auto BindInput(const char *name, const Mat &mat) const noexcept -> Status;
[[nodiscard]] auto BindOutput(const char *name, const Mat &mat) const noexcept -> Status;
Expand Down
7 changes: 2 additions & 5 deletions retinify/src/stream.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#pragma once

#include "retinify/attributes.hpp"
#include "retinify/constraints.hpp"
#include "retinify/status.hpp"

#ifdef BUILD_WITH_TENSORRT
Expand All @@ -15,15 +16,11 @@

namespace retinify
{
class RETINIFY_API Stream
class RETINIFY_API Stream : public NoCopyMove
{
public:
Stream() noexcept = default;
~Stream() noexcept;
Stream(const Stream &) = delete;
auto operator=(const Stream &) noexcept -> Stream & = delete;
Stream(Stream &&) noexcept = delete;
auto operator=(Stream &&) noexcept -> Stream & = delete;
[[nodiscard]] auto Create() noexcept -> Status;
[[nodiscard]] auto Destroy() noexcept -> Status;
[[nodiscard]] auto Synchronize() const noexcept -> Status;
Expand Down