Deleted Added
sdiff udiff text old ( 13514:75569a60a0be ) new ( 13523:de27641700bb )
full compact
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
27namespace tlm
28{
29
30template class tlm_array<tlm_utils::ispex_base *>;
31
32} // namespace tlm
33
34namespace tlm_utils
35{
36
37namespace
38{
39
40class ispex_registry // Copied from tlm_gp.cpp.
41{
42 typedef unsigned int key_type;
43 typedef std::map<sc_core::sc_type_index, key_type> type_map;
44
45 public:
46 static ispex_registry &
47 instance()
48 {
49 if (!instance_) {
50 // Don't cleanup registry.
51 instance_ = new ispex_registry();
52 }
53 return *instance_;
54 }
55
56 unsigned int
57 register_extension(sc_core::sc_type_index type)
58 {
59 type_map::const_iterator it = ids_.find(type);
60
61 if (it == ids_.end()) {
62 // New extension - generate/store ID.
63 type_map::value_type v(type, static_cast<key_type>(ids_.size()));
64 ids_.insert(v);
65 return v.second;

--- 201 unchanged lines hidden ---