1/***************************************************************************** 2 3 Licensed to Accellera Systems Initiative Inc. (Accellera) under one or 4 more contributor license agreements. See the NOTICE file distributed 5 with this work for additional information regarding copyright ownership. 6 Accellera licenses this file to you under the Apache License, Version 2.0 7 (the "License"); you may not use this file except in compliance with the 8 License. You may obtain a copy of the License at --- 9 unchanged lines hidden (view full) --- 18 *****************************************************************************/ 19 20#include <tlm_utils/instance_specific_extensions_int.h> 21 22#include <iostream> 23#include <map> 24#include <systemc> 25#include <tlm> |
26#include <typeindex> |
27 28namespace tlm 29{ 30 31template class tlm_array<tlm_utils::ispex_base *>; 32 33} // namespace tlm 34 35namespace tlm_utils 36{ 37 38namespace 39{ 40 41class ispex_registry // Copied from tlm_gp.cpp. 42{ 43 typedef unsigned int key_type; |
44 typedef std::map<std::type_index, key_type> type_map; |
45 46 public: 47 static ispex_registry & 48 instance() 49 { 50 if (!instance_) { 51 // Don't cleanup registry. 52 instance_ = new ispex_registry(); 53 } 54 return *instance_; 55 } 56 57 unsigned int |
58 register_extension(std::type_index type) |
59 { 60 type_map::const_iterator it = ids_.find(type); 61 62 if (it == ids_.end()) { 63 // New extension - generate/store ID. 64 type_map::value_type v(type, static_cast<key_type>(ids_.size())); 65 ids_.insert(v); 66 return v.second; --- 201 unchanged lines hidden --- |