19 map<size_t, string> name_cache{};
25 TypeID::~TypeID() noexcept =
default;
26 TypeID::TypeID() noexcept = default;
27 TypeID::TypeID(TypeID
const&) noexcept = default;
28 TypeID::TypeID(TypeID&) noexcept = default;
29 TypeID& TypeID::operator=(TypeID
const&) noexcept = default;
30 TypeID& TypeID::operator=(TypeID&) noexcept = default;
32 TypeID::TypeID(type_info
const& ti) noexcept : ti_{&ti} {}
33 TypeID::TypeID(type_info
const* ti) noexcept : ti_{ti} {}
36 TypeID::typeInfo()
const 50 auto hash_code = typeInfo().hash_code();
51 std::lock_guard sentry{cache_mutex};
53 if (
entry == name_cache.end()) {
61 TypeID::friendlyClassName()
const 69 return ti_->before(*rhs.
ti_);
75 return *ti_ == *rhs.
ti_;
78 TypeID::operator
bool()
const {
return ti_ !=
nullptr; }
87 TypeID::print(ostream& os)
const 121 auto comma_count = 0ul;
122 auto template_level = 0ul;
123 auto arg_start = string::npos;
125 pos = template_instance.find_first_of(
"<>,",
pos);
126 while (
pos != string::npos) {
127 switch (template_instance[
pos]) {
130 if ((desired_arg == 0ul) && (template_level == 1ul)) {
137 if ((desired_arg == comma_count) && (template_level == 0ul)) {
141 template_instance.find_last_not_of(
" \t", pos - 1) + 1;
142 result = template_instance.substr(arg_start, arg_end - arg_start);
147 if (template_level != 1ul) {
151 if (comma_count == desired_arg) {
153 result = template_instance.substr(arg_start, pos - arg_start);
157 if (comma_count == desired_arg) {
164 pos = template_instance.find_first_of(
"<>,", pos);
176 static string const assns_start =
"art::Assns<"s;
180 result = assns_start + arg1 +
',' + arg0 +
',' + arg2 +
'>';
192 static string const assns_start =
"art::Assns<"s;
208 <<
"-- attempted to get unwrapped product from non-instance of art::Wrapper."s;
static QCString className
string name_of_assns_partner(string assns_type_name)
int find(const type *d) const
ostream & operator<<(ostream &os, TypeID const &tid)
string name_of_unwrapped_product(string const &wrapped_name)
QCollection::Item first()
void print(std::ostream &) const
bool operator<(ProductInfo const &a, ProductInfo const &b)
std::string uniform_type_name(std::type_info const &tid)
string name_of_assns_base(string assns_type_name)
bool is_instantiation_of(std::string const &type_name, std::string const &template_name)
string name_of_template_arg(string const &template_instance, size_t desired_arg)
std::string friendlyName(std::string const &iFullName)
cet::coded_exception< errors::ErrorCodes, ExceptionDetail::translate > Exception
bool operator!=(TypeID const &a, TypeID const &b)
bool operator>(TypeID const &a, TypeID const &b)
void swap(TypeID &left, TypeID &right)
bool is_assns(std::string const &type_name)
std::type_info const * ti_
bool operator==(ModuleKeyAndType const &a, ModuleKeyAndType const &b) noexcept