4#ifndef _Stroika_Foundation_Database_Document_ObjectCollection_h_
5#define _Stroika_Foundation_Database_Document_ObjectCollection_h_ 1
7#include "Stroika/Foundation/StroikaPreComp.h"
9#include "Stroika/Foundation/DataExchange/ObjectVariantMapper.h"
18namespace Stroika::Foundation::Database::Document::ObjectCollection {
20 using namespace Database::Document::Collection;
21 using DataExchange::ObjectVariantMapper;
35 Ptr (
const Ptr& src) =
default;
36 Ptr (
Ptr&& src)
noexcept =
default;
37 Ptr ()
noexcept =
default;
39 using inherited::inherited;
47 nonvirtual
Ptr& operator= (
const Ptr& src) =
default;
48 nonvirtual
Ptr& operator= (
Ptr&& src)
noexcept =
default;
60 nonvirtual optional<T>
GetOne (
const IDType&
id,
const optional<Projection>& projection = {});
65 nonvirtual T GetOneOrThrow (
const IDType&
id,
const optional<Projection>& projection = {});
70 nonvirtual
Sequence<T> GetAll (
const optional<Filter>& filter = {},
const optional<Projection>& projection = {});
75 using inherited::Replace;
76 nonvirtual
void Replace (
const T& newV);
82 using inherited::Update;
102#include "ObjectCollection.inl"
String is like std::u32string, except it is much easier to use, often much more space efficient,...
A generalization of a vector: a container whose elements are keyed by the natural numbers.
Set<T> is a container of T, where once an item is added, additionally adds () do nothing.
ObjectVariantMapper can be used to map C++ types to and from variant-union types, which can be transp...
nonvirtual void Update(const Document &newV)
Update the document named by 'id' - just updating fields in newV (all or ones given in argument onlyT...
nonvirtual Sequence< Document > GetAll(const optional< Filter > &filter={}, const optional< Projection > &projection={})
nonvirtual void Replace(const Document &newV)
except for issues of timing, equivalent to remove, and then add newV using id
nonvirtual IDType Add(const Document &v)
nonvirtual optional< Document > GetOne(const IDType &id, const optional< Projection > &projection={})