Main Page
Related Pages
Modules
Namespaces
Classes
Files
Examples
File List
File Members
art
art
Framework
Art
detail
md-summary
MetadataSummaryForModule.h
Go to the documentation of this file.
1
#ifndef art_Framework_Art_detail_md_summary_MetadataSummaryForModule_h
2
#define art_Framework_Art_detail_md_summary_MetadataSummaryForModule_h
3
4
#include "
art/Framework/Art/detail/LibraryInfoCollection.h
"
5
#include "
art/Framework/Art/detail/MetadataSummary.h
"
6
#include "
art/Framework/Art/detail/PrintFormatting.h
"
7
8
#include <iomanip>
9
#include <sstream>
10
#include <string>
11
12
namespace
art::detail
{
13
14
template
<>
15
class
MetadataSummaryFor
<
suffix_type
::
module
> :
public
MetadataSummary
{
16
public
:
17
MetadataSummaryFor
(
LibraryInfoCollection
const
& coll)
18
: coll_{coll}
19
, widths_{
std::to_string
(coll.size()).
size
(),
20
columnWidth
(coll, &
LibraryInfo::short_spec
,
"module_type"
),
21
columnWidth
(coll, &
LibraryInfo::plugin_type
,
"Type"
),
22
columnWidth
(coll, &
LibraryInfo::path
,
"Source location"
)}
23
{}
24
25
private
:
26
LibraryInfoCollection
const
&
coll_
;
27
Widths
widths_
;
28
29
Widths
const
&
30
doWidths
()
const override
31
{
32
return
widths_;
33
}
34
35
std::string
36
doHeader
()
const override
37
{
38
std::ostringstream
result
;
39
result <<
indent
(widths_[0] + 2) <<
std::setw
(widths_[1] + 4) <<
std::left
40
<<
"module_type"
<<
std::setw
(widths_[2] + 4) <<
std::left
41
<<
"Type"
<<
std::left
<<
"Source location"
;
42
return
result.str();
43
}
44
45
Summary
46
doSummary
(
LibraryInfo
const
& li, std::size_t
const
entry
)
const override
47
{
48
auto
const
count
= std::count_if(
49
coll_.cbegin(), coll_.cend(),
LibraryInfoMatch
{li.
short_spec
()});
50
bool
const
is_duplicate =
count
!= 1;
51
auto
const
dupl = is_duplicate ?
'*'
:
' '
;
52
53
std::ostringstream
result
;
54
result <<
std::setw
(widths_[0]) <<
std::right
<< entry <<
'.'
<< dupl
55
<<
std::setw
(widths_[1] + 4) <<
std::left
<< li.
short_spec
()
56
<<
std::setw
(widths_[2] + 4) <<
std::left
<< li.
plugin_type
()
57
<<
std::left
<< li.
path
() <<
"\n"
;
58
return
{result.str(), is_duplicate};
59
}
60
};
61
62
}
// namespace art::detail
63
64
#endif
/* art_Framework_Art_detail_md_summary_MetadataSummaryForModule_h */
65
66
// Local variables:
67
// mode: c++
68
// End:
art::detail::Widths
std::vector< std::size_t > Widths
Definition:
PrintFormatting.h:65
entry
QList< Entry > entry
Definition:
tclscanner.cpp:1150
result
static QCString result
Definition:
fortranscanner.cpp:56614
string
std::string string
Definition:
nybbler.cc:12
art::detail::Summary
Definition:
MetadataSummary.h:18
art::detail::columnWidth
std::size_t columnWidth(T const &coll, std::string const Elem::*cp, std::string const &header)
Definition:
PrintFormatting.h:41
PrintFormatting.h
art::detail::MetadataSummaryFor
Definition:
MetadataSummary.h:13
art::detail::MetadataSummaryFor< suffix_type::module >::doSummary
Summary doSummary(LibraryInfo const &li, std::size_t const entry) const override
Definition:
MetadataSummaryForModule.h:46
LibraryInfoCollection.h
util::size
decltype(auto) constexpr size(T &&obj)
ADL-aware version of std::size.
Definition:
StdUtils.h:92
art::detail
Definition:
AllowedConfiguration.h:76
art::detail::LibraryInfo
Definition:
LibraryInfo.h:12
art::detail::MetadataSummaryFor< suffix_type::module >::widths_
Widths widths_
Definition:
MetadataSummaryForModule.h:27
art::detail::indent
std::string indent(std::size_t const i)
Definition:
PrintFormatting.h:17
MetadataSummary.h
art::suffix_type
suffix_type
Definition:
PluginSuffixes.h:59
art::detail::MetadataSummaryFor< suffix_type::module >::doWidths
Widths const & doWidths() const override
Definition:
MetadataSummaryForModule.h:30
wirecell.validate.cmaps.right
right
Definition:
cmaps.py:84
setw
Q_EXPORT QTSManip setw(int w)
Definition:
qtextstream.h:331
art::detail::LibraryInfo::short_spec
std::string const & short_spec() const
Definition:
LibraryInfo.h:43
art::detail::MetadataSummaryFor< suffix_type::module >::MetadataSummaryFor
MetadataSummaryFor(LibraryInfoCollection const &coll)
Definition:
MetadataSummaryForModule.h:17
wirecell.validate.cmaps.left
left
Definition:
cmaps.py:84
art::detail::MetadataSummaryFor< suffix_type::module >::doHeader
std::string doHeader() const override
Definition:
MetadataSummaryForModule.h:36
art::detail::LibraryInfo::path
std::string const & path() const
Definition:
LibraryInfo.h:53
art::detail::LibraryInfo::plugin_type
std::string const & plugin_type() const
Definition:
LibraryInfo.h:68
reco_momentum_tuples.count
int count
Definition:
reco_momentum_tuples.py:202
art::detail::MetadataSummary
Definition:
MetadataSummary.h:23
art::detail::MetadataSummaryFor< suffix_type::module >::coll_
LibraryInfoCollection const & coll_
Definition:
MetadataSummaryForModule.h:26
art::suffix_type::module
art::to_string
std::string to_string(ModuleType const mt)
Definition:
ModuleType.h:34
art::detail::LibraryInfoMatch
Definition:
LibraryInfo.h:82
art::detail::LibraryInfoCollection
std::multiset< LibraryInfo > LibraryInfoCollection
Definition:
LibraryInfoCollection.h:10
Generated by
1.8.11