Main Page
Related Pages
Modules
Namespaces
Classes
Files
Examples
File List
File Members
art
art
Framework
Art
detail
md-summary
MetadataSummaryForPlugin.h
Go to the documentation of this file.
1
#ifndef art_Framework_Art_detail_md_summary_MetadataSummaryForPlugin_h
2
#define art_Framework_Art_detail_md_summary_MetadataSummaryForPlugin_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
::
plugin
> :
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
,
"plugin_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
<<
"plugin_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_MetadataSummaryForPlugin_h */
65
66
// Local variables:
67
// mode: c++
68
// End:
art::detail::MetadataSummaryFor< suffix_type::plugin >::doSummary
Summary doSummary(LibraryInfo const &li, std::size_t const entry) const override
Definition:
MetadataSummaryForPlugin.h:46
art::detail::Widths
std::vector< std::size_t > Widths
Definition:
PrintFormatting.h:65
entry
QList< Entry > entry
Definition:
tclscanner.cpp:1150
art::suffix_type::plugin
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
LibraryInfoCollection.h
art::detail::MetadataSummaryFor< suffix_type::plugin >::doHeader
std::string doHeader() const override
Definition:
MetadataSummaryForPlugin.h:36
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::plugin >::doWidths
Widths const & doWidths() const override
Definition:
MetadataSummaryForPlugin.h:30
art::detail::MetadataSummaryFor< suffix_type::plugin >::widths_
Widths widths_
Definition:
MetadataSummaryForPlugin.h:27
art::detail::MetadataSummaryFor< suffix_type::plugin >::MetadataSummaryFor
MetadataSummaryFor(LibraryInfoCollection const &coll)
Definition:
MetadataSummaryForPlugin.h:17
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
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
wirecell.validate.cmaps.left
left
Definition:
cmaps.py:84
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::plugin >::coll_
LibraryInfoCollection const & coll_
Definition:
MetadataSummaryForPlugin.h:26
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