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_summary & operator= (const traversal_summary &o)
traversal_summary & operator= (traversal_summary &&o) noexcept
traversal_summary & operator+= (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 : stats_failed(o.stats_failed)
66 , directory_opens_failed(o.directory_opens_failed)
67 , want(o.want)
68 , devs(o.devs)
69 , types(o.types)
70 , size(o.size)
71 , allocated(o.allocated)
72 , file_blocks(o.file_blocks)
73 , directory_blocks(o.directory_blocks)
74 , max_depth(o.max_depth)
75 {
76 assert(!is_lockable_locked(o._lock));
77 }
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
size_t stats_failed
The number of handle stat's which failed.
Definition summarize.hpp:51
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
79 : stats_failed(o.stats_failed)
80 , directory_opens_failed(o.directory_opens_failed)
81 , want(o.want)
82 , devs(std::move(o.devs))
83 , types(std::move(o.types))
84 , size(o.size)
85 , allocated(o.allocated)
86 , file_blocks(o.file_blocks)
87 , directory_blocks(o.directory_blocks)
88 , max_depth(o.max_depth)
89 {
90 assert(!is_lockable_locked(o._lock));
91 }

Member Function Documentation

◆ default_metadata()

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.

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

◆ operator=() [1/2]

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

◆ operator=() [2/2]

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

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: