AFIO  v2.00 late alpha
afio_v2_xxx::algorithm Namespace Reference

Collection of file system based algorithms. More...

Namespaces

 impl
 Does not exist in the actual source code, purely here to workaround doxygen limitations.
 
 shared_fs_mutex
 Algorithms for protecting a shared filing system resource from racy modification.
 

Classes

class  cached_parent_handle_adapter
 Adapts any construct()-able implementation to cache its parent directory handle in a process wide cache. More...
 
class  mapped_view
 Provides a typed mapped view of a section_handle suitable for feeding to STL algorithms or the Ranges TS by wrapping a map_handle into a span<T>. More...
 
class  trivial_vector
 Provides a constant time capacity expanding move-only STL vector. Requires T to be trivially copyable. More...
 

Functions

template<class T , class... Args>
result< cached_parent_handle_adapter< T > > cache_parent (Args &&... args) noexcept
 Constructs a T adapted into a parent handle caching implementation. More...
 
template<class T >
bool operator== (const trivial_vector< T > &a, const trivial_vector< T > &b)
 Compare.
 
template<class T >
bool operator!= (const trivial_vector< T > &a, const trivial_vector< T > &b)
 Compare.
 
template<class T >
bool operator< (const trivial_vector< T > &a, const trivial_vector< T > &b)
 Compare.
 
template<class T >
bool operator<= (const trivial_vector< T > &a, const trivial_vector< T > &b)
 Compare.
 
template<class T >
bool operator> (const trivial_vector< T > &a, const trivial_vector< T > &b)
 Compare.
 
template<class T >
bool operator>= (const trivial_vector< T > &a, const trivial_vector< T > &b)
 Compare.
 
template<class T >
void swap (trivial_vector< T > &a, trivial_vector< T > &b) noexcept
 Swap.
 

Detailed Description

Collection of file system based algorithms.

Function Documentation

◆ cache_parent()

template<class T , class... Args>
result<cached_parent_handle_adapter<T> > afio_v2_xxx::algorithm::cache_parent ( Args &&...  args)
inlinenoexcept

Constructs a T adapted into a parent handle caching implementation.

This function works via the construct<T>() free function framework for which your handle implementation must have registered its construction details.

170  {
171  construct<T> constructor{std::forward<Args>(args)...};
172  OUTCOME_TRY(h, constructor());
173  try
174  {
175  return cached_parent_handle_adapter<T>(std::move(h), constructor.base, constructor._path);
176  }
177  catch(...)
178  {
179  return error_from_exception();
180  }
181  }