-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathretrieve.hpp
37 lines (32 loc) · 1.07 KB
/
retrieve.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
//
// Retrieved by Rakesh on 17/12/2024.
//
#pragma once
#if defined __has_include
#if __has_include("../../../common/visit_struct/visit_struct_intrusive.hpp")
#include "../../../common/visit_struct/visit_struct_intrusive.hpp"
#include "../../../common/util/serialise.hpp"
#else
#include <mongo-service/common/visit_struct/visit_struct_intrusive.hpp>
#include <mongo-service/common/util/serialise.hpp>
#endif
#endif
namespace spt::mongoservice::api::model::response
{
template <util::Visitable Document>
requires std::is_same_v<decltype(Document::id), bsoncxx::oid>
struct Retrieve
{
explicit Retrieve( bsoncxx::document::view document ) { util::unmarshall( *this, document ); }
Retrieve() = default;
~Retrieve() = default;
Retrieve(Retrieve&&) = default;
Retrieve& operator=(Retrieve&&) = default;
Retrieve(const Retrieve&) = delete;
Retrieve& operator=(const Retrieve&) = delete;
BEGIN_VISITABLES(Retrieve);
VISITABLE(std::optional<Document>, result);
VISITABLE(std::vector<Document>, results);
END_VISITABLES;
};
}