Hurricane VLSI Database


Name.h
1 // ****************************************************************************************************
2 // File: ./hurricane/Name.h
3 // Authors: R. Escassut
4 // Copyright (c) BULL S.A. 2000-2018, All Rights Reserved
5 //
6 // This file is part of Hurricane.
7 //
8 // Hurricane is free software: you can redistribute it and/or modify it under the terms of the GNU
9 // Lesser General Public License as published by the Free Software Foundation, either version 3 of the
10 // License, or (at your option) any later version.
11 //
12 // Hurricane is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even
13 // the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the Lesser GNU
14 // General Public License for more details.
15 //
16 // You should have received a copy of the Lesser GNU General Public License along with Hurricane. If
17 // not, see <http://www.gnu.org/licenses/>.
18 // ****************************************************************************************************
19 
20 
21 #pragma once
22 #include "hurricane/Commons.h"
23 #include "hurricane/Names.h"
24 
25 namespace Hurricane {
26 
27 class SharedName;
28 
29 
30 
31 // ****************************************************************************************************
32 // Name declaration
33 // ****************************************************************************************************
34 
35 class Name {
36 // *******
37 
38  private: static const Name _emptyName;
39  public: static const Name& emptyName () { return _emptyName; };
40 
41 // Attributes
42 // **********
43 
44  private: SharedName* _sharedName;
45 
46 // Constructors
47 // ************
48 
49  public: Name();
50 
51  public: Name(const char* c);
52  public: Name(const string& s);
53 
54  public: Name(const Name& name);
55 
56 // Destructor
57 // **********
58 
59  public: ~Name();
60 
61 // Operators
62 // *********
63 
64  public: Name& operator=(const Name& name);
65 
66  public: bool operator==(const Name& name) const;
67  public: bool operator!=(const Name& name) const;
68  public: bool operator<(const Name& name) const;
69  public: bool operator<=(const Name& name) const;
70  public: bool operator>(const Name& name) const;
71  public: bool operator>=(const Name& name) const;
72 
73  public: char operator[](unsigned index) const;
74 
75 // Predicates
76 // **********
77 
78  public: bool isEmpty() const;
79  public: size_t size() const;
80 
81 // Others
82 // ******
83 
84  public: string _getTypeName() const { return _TName("Name"); };
85  public: string _getString() const;
86  public: Record* _getRecord() const;
87  public: SharedName* _getSharedName() const {return _sharedName;};
88 
89 };
90 
91 
92 } // End of Hurricane namespace.
93 
94 
95 //template<> inline std::string getString<Hurricane::Name&>( Hurricane::Name& data )
96 //{ return data._getString(); }
97 //
98 //template<> inline std::string getString<const Hurricane::Name&>( const Hurricane::Name& data )
99 //{ return data._getString(); }
100 //
101 //
102 //template<> inline std::string getString<Hurricane::Name>( Hurricane::Name data )
103 //{ return data._getString(); }
104 //
105 //template<> inline std::string getString<const Hurricane::Name>( const Hurricane::Name data )
106 //{ return data._getString(); }
107 //
108 //
109 //inline std::ostream& operator<< ( std::ostream& o, Hurricane::Name& d )
110 //{ return o << getString<Hurricane::Name&>(d); }
111 //
112 //inline std::ostream& operator<< ( std::ostream& o, const Hurricane::Name& d )
113 //{ return o << getString<const Hurricane::Name&>(d); }
114 //
115 //
116 //template<> inline Hurricane::Record* getRecord<Hurricane::Name&>( Hurricane::Name& data )
117 //{ return data._getRecord(); }
118 //
119 //template<> inline Hurricane::Record* getRecord<const Hurricane::Name&>( const Hurricane::Name& data )
120 //{ return data._getRecord(); }
121 
122 
123 INSPECTOR_PR_SUPPORT(Hurricane::Name);
124 
125 inline void jsonWrite ( JsonWriter* w, Hurricane::Name name )
126 { w->write( getString(name).c_str() ); }
127 
128 inline void jsonWrite ( JsonWriter* w, const std::string& key, Hurricane::Name name )
129 { w->key( key ); w->write( getString(name).c_str() ); }
130 
131 
132 // ****************************************************************************************************
133 // Copyright (c) BULL S.A. 2000-2018, All Rights Reserved
134 // ****************************************************************************************************
Name description (API)
Definition: Name.h:35
bool operator>=(const Name &name) const
char operator[](unsigned index) const
bool operator>(const Name &name) const
bool operator==(const Name &name) const
Name(const string &s)
Name(const Name &name)
bool isEmpty() const
Name(const char *c)
bool operator<=(const Name &name) const
bool operator<(const Name &name) const
Name & operator=(const Name &name)
bool operator!=(const Name &name) const
The namespace dedicated to Hurricane.
Definition: Generalities.dox:5


Generated by doxygen 1.9.1 on Thu Aug 11 2022 Return to top of page
Hurricane VLSI Database Copyright © 2000-2020 Bull S.A. All rights reserved