Deleted Added
sdiff udiff text old ( 13516:315f10e2567b ) 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

--- 7 unchanged lines hidden (view full) ---

16 permissions and limitations under the License.
17
18 *****************************************************************************/
19
20#include <cstring> // std::memcpy et.al.
21#include <map>
22#include <systemc>
23#include <tlm>
24
25using sc_core::sc_type_index;
26
27namespace tlm
28{
29
30template class tlm_array<tlm_extension_base *>;
31
32//---------------------------------------------------------------------------
33// Classes for the extension mechanism
34//---------------------------------------------------------------------------
35
36namespace
37{
38
39class tlm_extension_registry
40{
41 typedef unsigned int key_type;
42 typedef std::map<sc_core::sc_type_index, key_type> type_map;
43 public:
44 static tlm_extension_registry &
45 instance()
46 {
47 if (!instance_) {
48 // Don't cleanup registry.
49 instance_ = new tlm_extension_registry();
50 }
51 return *instance_;
52 }
53
54 unsigned int
55 register_extension(sc_type_index type)
56 {
57 type_map::const_iterator it = ids_.find(type);
58
59 if (it == ids_.end()) {
60 // New extension - generate/store ID.
61 type_map::value_type v(type, static_cast<key_type>(ids_.size()));
62 ids_.insert(v);
63 return v.second;

--- 292 unchanged lines hidden ---