Stroika Library 3.0d23
 
Loading...
Searching...
No Matches
SharedByValue.h File Reference
#include "Stroika/Foundation/StroikaPreComp.h"
#include <functional>
#include <memory>
#include "Stroika/Foundation/Common/Common.h"
#include "Stroika/Foundation/Common/Concepts.h"
#include "Stroika/Foundation/Common/Empty.h"
#include "Stroika/Foundation/Common/StdCompat.h"
#include "SharedByValue.inl"

Go to the source code of this file.

Classes

struct  Stroika::Foundation::Memory::SharedByValueSupport::DefaultValueCopier_FunctionObject< T, SHARED_IMPL >
 DefaultValueCopier_FunctionObject same as DefaultValueCopier, but as a function object. More...
 
struct  Stroika::Foundation::Memory::SharedByValueSupport::ExplicitTraits< T, SHARED_IMPL, DEFAULT_COPIER_TYPE, DEFAULT_COPIER, INSTANCE_COPIER_TYPE >
 ExplicitTraits is a utility struct to provide parameterized TRAITS support for SharedByValue<> More...
 
class  Stroika::Foundation::Memory::SharedByValue< T, TRAITS >
 SharedByValue is a utility class to implement Copy-On-Write (aka COW) - sort of halfway between unique_ptr and shared_ptr. More...
 

Namespaces

namespace  Stroika::Foundation
 
namespace  Stroika::Foundation::Memory::SharedByValueSupport
 Support types and concepts for SharedByValue template.
 

Concepts

concept  Stroika::Foundation::Memory::SharedByValueSupport::ICopier
 
concept  Stroika::Foundation::Memory::SharedByValueSupport::IOptionalCopier
 
concept  Stroika::Foundation::Memory::SharedByValueSupport::ITraits
 

Typedefs

using Stroika::Foundation::Memory::SharedByValueSupport::MissingCopierTypeSentinel = nullptr_t
 
template<typename T , auto COPIER_INSTANCE = &DefaultValueCopier<T, shared_ptr<T>>>
using Stroika::Foundation::Memory::SharedByValueSupport::DefaultTraits_NoInstanceCopier = ExplicitTraits< T, shared_ptr< T >, decltype(COPIER_INSTANCE), COPIER_INSTANCE, MissingCopierTypeSentinel >
 Unified DefaultTraits_NoInstanceCopier - works with both function objects and function pointers.
 
template<typename T , typename COPIER_TYPE = function<shared_ptr<T> (const T&)>>
using Stroika::Foundation::Memory::SharedByValueSupport::DefaultTraits_InstanceCopierOnly = ExplicitTraits< T, invoke_result_t< COPIER_TYPE, T >, MissingCopierTypeSentinel, MissingCopierTypeSentinel{}, COPIER_TYPE >
 SharedByValue traits object for per-instance constructor specification of shared_ptr copier only.
 
template<typename T , typename DEFAULT_COPIER_TYPE = DefaultValueCopier_FunctionObject<T, shared_ptr<T>>, typename INSTANCE_COPIER_TYPE = function<shared_ptr<T> (const T&)>>
using Stroika::Foundation::Memory::SharedByValueSupport::DefaultTraits_DefaultAndInstanceCopiers = ExplicitTraits< T, invoke_result_t< INSTANCE_COPIER_TYPE, T >, DEFAULT_COPIER_TYPE, DEFAULT_COPIER_TYPE{}, INSTANCE_COPIER_TYPE >
 Both a default copier, and a function<sharedimp(T)> instance copier.
 
template<typename T , auto COPIER_INSTANCE = &DefaultValueCopier<T, shared_ptr<T>>>
using Stroika::Foundation::Memory::SharedByValueSupport::DefaultTraits = DefaultTraits_NoInstanceCopier< T, COPIER_INSTANCE >
 DefaultTraits is a utility struct to provide parameterized support for SharedByValue<>
 

Enumerations

enum class  Stroika::Foundation::Memory::SharedByValueSupport::SharingState
 

Functions

template<typename T , typename SHARED_IMPL = shared_ptr<T>>
SHARED_IMPL Stroika::Foundation::Memory::SharedByValueSupport::DefaultValueCopier (const T &t)
 DefaultValueCopier is the default value-copier for copying SharedByValue (thing that clones a shared_ptr)
 

Detailed Description

Note
Code-Status: Beta

TODO:

Definition in file SharedByValue.h.