LLFIO v2.00
Loading...
Searching...
No Matches
llfio_v2_xxx::algorithm::traversal_summary Struct Reference

A summary of a directory tree. More...

#include "summarize.hpp"

Inheritance diagram for llfio_v2_xxx::algorithm::traversal_summary:
llfio_v2_xxx::algorithm::comparison_summary::_lr

Public Types

template<class T >
using map_type = std::unordered_map< T, size_t >
 

Public Member Functions

 traversal_summary (const traversal_summary &o)
 
 traversal_summary (traversal_summary &&o) noexcept
 
traversal_summaryoperator= (const traversal_summary &o)
 
traversal_summaryoperator= (traversal_summary &&o) noexcept
 
traversal_summaryoperator+= (const traversal_summary &o)
 Adds another summary to this.
 

Static Public Member Functions

static constexpr stat_t::want default_metadata ()
 The default metadata summarised.
 

Public Attributes

spinlock _lock
 
size_t stats_failed {0}
 The number of handle stat's which failed.
 
size_t directory_opens_failed {0}
 The number of directories which could not be opened.
 
stat_t::want want {stat_t::want::none}
 The summary items desired.
 
map_type< uint64_t > devs
 The number of items with the given device id.
 
map_type< filesystem::file_type > types
 The number of items with the given type.
 
handle::extent_type size {0}
 The sum of maximum extents. On Windows, is for file content only.
 
handle::extent_type allocated {0}
 The sum of allocated extents. On Windows, is for file content only.
 
handle::extent_type file_blocks {0}
 The sum of file allocated blocks.
 
handle::extent_type directory_blocks {0}
 The sum of directory allocated blocks.
 
size_t max_depth {0}
 The maximum depth of the hierarchy.
 

Detailed Description

A summary of a directory tree.

Constructor & Destructor Documentation

◆ traversal_summary() [1/3]

llfio_v2_xxx::algorithm::traversal_summary::traversal_summary ( )
inline
63{}

◆ traversal_summary() [2/3]

llfio_v2_xxx::algorithm::traversal_summary::traversal_summary ( const traversal_summary o)
inline
65 : directory_opens_failed(o.directory_opens_failed)
66 , want(o.want)
67 , devs(o.devs)
68 , types(o.types)
69 , size(o.size)
70 , allocated(o.allocated)
71 , file_blocks(o.file_blocks)
72 , directory_blocks(o.directory_blocks)
73 , max_depth(o.max_depth)
74 {
75 assert(!is_lockable_locked(o._lock));
76 }
stat_t::want want
The summary items desired.
Definition summarize.hpp:54
handle::extent_type file_blocks
The sum of file allocated blocks.
Definition summarize.hpp:59
map_type< filesystem::file_type > types
The number of items with the given type.
Definition summarize.hpp:56
size_t directory_opens_failed
The number of directories which could not be opened.
Definition summarize.hpp:52
handle::extent_type directory_blocks
The sum of directory allocated blocks.
Definition summarize.hpp:60
map_type< uint64_t > devs
The number of items with the given device id.
Definition summarize.hpp:55
handle::extent_type size
The sum of maximum extents. On Windows, is for file content only.
Definition summarize.hpp:57
size_t max_depth
The maximum depth of the hierarchy.
Definition summarize.hpp:61
handle::extent_type allocated
The sum of allocated extents. On Windows, is for file content only.
Definition summarize.hpp:58

◆ traversal_summary() [3/3]

llfio_v2_xxx::algorithm::traversal_summary::traversal_summary ( traversal_summary &&  o)
inlinenoexcept
78 : directory_opens_failed(o.directory_opens_failed)
79 , want(o.want)
80 , devs(std::move(o.devs))
81 , types(std::move(o.types))
82 , size(o.size)
83 , allocated(o.allocated)
84 , file_blocks(o.file_blocks)
85 , directory_blocks(o.directory_blocks)
86 , max_depth(o.max_depth)
87 {
88 assert(!is_lockable_locked(o._lock));
89 }

Member Function Documentation

◆ default_metadata()

static constexpr stat_t::want llfio_v2_xxx::algorithm::traversal_summary::default_metadata ( )
inlinestaticconstexpr

The default metadata summarised.

46 {
47 return stat_t::want::dev | stat_t::want::type | stat_t::want::size | stat_t::want::allocated | stat_t::want::blocks;
48 }

◆ operator+=()

traversal_summary & llfio_v2_xxx::algorithm::traversal_summary::operator+= ( const traversal_summary o)
inline

Adds another summary to this.

124 {
125 lock_guard<spinlock> g(_lock);
126 directory_opens_failed += o.directory_opens_failed;
127 for(auto &i : o.devs)
128 {
129 devs[i.first] += i.second;
130 }
131 for(auto &i : o.types)
132 {
133 types[i.first] += i.second;
134 }
135 size += o.size;
136 allocated += o.allocated;
137 file_blocks += o.file_blocks;
138 directory_blocks += o.directory_blocks;
139 max_depth = std::max(max_depth, o.max_depth);
140 return *this;
141 }

◆ operator=() [1/2]

traversal_summary & llfio_v2_xxx::algorithm::traversal_summary::operator= ( const traversal_summary o)
inline
91 {
92 if(this != &o)
93 {
94 directory_opens_failed = o.directory_opens_failed;
95 want = o.want;
96 devs = o.devs;
97 types = o.types;
98 size = o.size;
99 allocated = o.allocated;
100 file_blocks = o.file_blocks;
101 directory_blocks = o.directory_blocks;
102 max_depth = o.max_depth;
103 }
104 return *this;
105 }

◆ operator=() [2/2]

traversal_summary & llfio_v2_xxx::algorithm::traversal_summary::operator= ( traversal_summary &&  o)
inlinenoexcept
107 {
108 if(this != &o)
109 {
110 directory_opens_failed = o.directory_opens_failed;
111 want = o.want;
112 devs = std::move(o.devs);
113 types = std::move(o.types);
114 size = o.size;
115 allocated = o.allocated;
116 file_blocks = o.file_blocks;
117 directory_blocks = o.directory_blocks;
118 max_depth = o.max_depth;
119 }
120 return *this;
121 }

Member Data Documentation

◆ allocated

handle::extent_type llfio_v2_xxx::algorithm::traversal_summary::allocated {0}

The sum of allocated extents. On Windows, is for file content only.

58{0}; //!< The sum of allocated extents. On Windows, is for file content only.

◆ directory_blocks

handle::extent_type llfio_v2_xxx::algorithm::traversal_summary::directory_blocks {0}

The sum of directory allocated blocks.

60{0}; //!< The sum of directory allocated blocks.

◆ directory_opens_failed

size_t llfio_v2_xxx::algorithm::traversal_summary::directory_opens_failed {0}

The number of directories which could not be opened.

52{0}; //!< The number of directories which could not be opened.

◆ file_blocks

handle::extent_type llfio_v2_xxx::algorithm::traversal_summary::file_blocks {0}

The sum of file allocated blocks.

59{0}; //!< The sum of file allocated blocks.

◆ max_depth

size_t llfio_v2_xxx::algorithm::traversal_summary::max_depth {0}

The maximum depth of the hierarchy.

61{0}; //!< The maximum depth of the hierarchy

◆ size

handle::extent_type llfio_v2_xxx::algorithm::traversal_summary::size {0}

The sum of maximum extents. On Windows, is for file content only.

57{0}; //!< The sum of maximum extents. On Windows, is for file content only.

◆ stats_failed

size_t llfio_v2_xxx::algorithm::traversal_summary::stats_failed {0}

The number of handle stat's which failed.

51{0}; //!< The number of handle stat's which failed.

◆ want

stat_t::want llfio_v2_xxx::algorithm::traversal_summary::want {stat_t::want::none}

The summary items desired.

54{stat_t::want::none}; //!< The summary items desired

The documentation for this struct was generated from the following file: