Stroika Library 3.0d18
 
Loading...
Searching...
No Matches
Projection.inl
1/*
2 * Copyright(c) Sophist Solutions, Inc. 1990-2025. All rights reserved
3 */
4
5namespace Stroika::Foundation::Database::Document {
6
7 /*
8 ********************************************************************************
9 ***************************** Document::Projection *****************************
10 ********************************************************************************
11 */
12 inline Projection::Projection (Flag f, const Set<String>& fields)
13 : fFields_{f == eOmit ? MyVariant_{in_place_index<0>, fields} : MyVariant_{in_place_index<1>, fields}}
14 {
15 }
16 inline auto Projection::GetFields () const -> tuple<Flag, Set<String>>
17 {
18 if (auto i0 = get_if<0> (&fFields_)) {
19 return make_tuple (eOmit, *i0);
20 }
21 if (auto i1 = get_if<1> (&fFields_)) {
22 return make_tuple (eInclude, *i1);
23 }
25 return make_tuple (eOmit, Set<String>{});
26 }
27
28}
#define AssertNotReached()
Definition Assertions.h:355