This file is indexed.

/usr/include/oce/PCollection_HDoubleMap.gxx is in liboce-ocaf-lite-dev 0.9.1-3.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
//-Copyright:	 Matra Datavision 1992
//-Version: 

//-History:
//  Version	Date         Purpose
//              14/12/92     Creation   

//-Language     C++2.0

//-Declarations
#include <Standard_MultiplyDefined.hxx>
#include <Standard_NoSuchObject.hxx>

//=======================================================================
// Function : HDoubleMap
//=======================================================================

PCollection_HDoubleMap::PCollection_HDoubleMap
  (
   const Standard_Integer NbBuckets ,
   const KeyHash &fhKey,
   const ItemHash &fhItem )
{

  myArrayKey = new PCollection_ArrayDoubleMap(1,NbBuckets);  
  myArrayItem = new PCollection_ArrayDoubleMap(1,NbBuckets);
  myKeyHash = fhKey;
  myItemHash = fhItem;
  myNumber = 0;

}

//=======================================================================
// Function : NbBuckets
//=======================================================================

Standard_Integer PCollection_HDoubleMap::NbBuckets() const
{
  return myArrayKey->Length();
}

//=======================================================================
// Function : Extent
//=======================================================================

Standard_Integer PCollection_HDoubleMap::Extent() const
{
  return myNumber;
}

//=======================================================================
// Function : Bind
//=======================================================================

void PCollection_HDoubleMap::Bind (const Key &aKey , const Item &anItem)
{
  Standard_Integer ResHashKey,ResHashItem;
  Handle(PCollection_DoubleMapNode) theNewNode;

  if ( IsBoundByKey(aKey) || IsBoundByItem(anItem) ) 
    Standard_MultiplyDefined::Raise();
  else {
    ResHashKey = myKeyHash.HashCode(aKey,myArrayKey->Length());
    ResHashItem = myItemHash.HashCode(anItem,myArrayItem->Length());
    theNewNode =
      new PCollection_DoubleMapNode(aKey,anItem,
				     myArrayKey->Value(ResHashKey),
				     myArrayItem->Value(ResHashItem));
    myArrayKey->SetValue(ResHashKey,theNewNode); 
    myArrayItem->SetValue(ResHashItem,theNewNode);
    myNumber++;
  }
}

//=======================================================================
// Function : FindItem
//=======================================================================

Item PCollection_HDoubleMap::FindItem ( const Key &aKey ) const
{
  Standard_Integer ResHashKey;
  Handle(PCollection_DoubleMapNode) theKeyNode;

  ResHashKey = myKeyHash.HashCode(aKey,myArrayKey->Length());
  theKeyNode = myArrayKey->Value(ResHashKey);
  while ( ! theKeyNode.IsNull() ) {
    if ( myKeyHash.Compare(theKeyNode->GetKey(),aKey) ) 
      return theKeyNode->GetItem();
    else theKeyNode = theKeyNode->NextKey();
  }
  Standard_NoSuchObject::Raise();
}

//=======================================================================
// Function : FindKey
//=======================================================================

Key PCollection_HDoubleMap::FindKey ( const Item &anItem ) const
{
  Standard_Integer ResHashItem;
  Handle(PCollection_DoubleMapNode) theItemNode;

  ResHashItem = myItemHash.HashCode(anItem,myArrayItem->Length());
  theItemNode = myArrayItem->Value(ResHashItem);
  while ( ! theItemNode.IsNull() ) {
    if ( myItemHash.Compare(theItemNode->GetItem(),anItem) ) 
      return theItemNode->GetKey();
    else theItemNode = theItemNode->NextItem();
  }
  Standard_NoSuchObject::Raise();
}

//=======================================================================
// Function : UnbindKey
//=======================================================================

void PCollection_HDoubleMap::UnbindKey ( const Key &aKey )
{
  Standard_Integer ResHashKey,ResHashItem;
  Handle(PCollection_DoubleMapNode) 
    currentKeyNode,previousKeyNode,previousItemNode,currentItemNode,nullNode;
  Standard_Boolean NoKey = Standard_True;
  Standard_Boolean NoItem = Standard_True;

  ResHashKey = myKeyHash.HashCode(aKey,myArrayKey->Length());
  currentKeyNode = myArrayKey->Value(ResHashKey);
  while ( NoKey && !currentKeyNode.IsNull() ) {
    if ( myKeyHash.Compare(currentKeyNode->GetKey(),aKey) ) 
      NoKey = Standard_False;
    else {
      previousKeyNode = currentKeyNode;
      currentKeyNode = currentKeyNode->NextKey();
    }
  }
  
  if ( NoKey ) Standard_NoSuchObject::Raise();
  else {
    ResHashItem = 
      myItemHash.HashCode(currentKeyNode->GetItem(),myArrayItem->Length());
    currentItemNode = myArrayItem->Value(ResHashItem);
    while ( NoItem && !currentItemNode.IsNull() ) {
      if ( currentItemNode == currentKeyNode ) NoItem = Standard_False;
      else {
	previousItemNode = currentItemNode;
	currentItemNode = currentItemNode->NextItem();
      }
    }
    if ( NoItem ) Standard_NoSuchObject::Raise();
    else {
      if ( previousKeyNode.IsNull() ) 
	myArrayKey->SetValue(ResHashKey,currentKeyNode->NextKey());
      else
	previousKeyNode->SetNextKey(currentKeyNode->NextKey());

      if ( previousItemNode.IsNull() )
	myArrayItem->SetValue(ResHashItem,currentItemNode->NextItem());
      else
	previousItemNode->SetNextItem(currentItemNode->NextItem());

      myNumber--;
      currentKeyNode->SetNextKey(nullNode);
      currentKeyNode->SetNextItem(nullNode);
      currentKeyNode.Delete();
    }
  }

}

//=======================================================================
// Function : UnbindItem
//=======================================================================

void PCollection_HDoubleMap::UnbindItem ( const Item &anItem ) 
{
  Standard_Integer ResHashKey,ResHashItem;
  Handle(PCollection_DoubleMapNode) 
    currentKeyNode,previousKeyNode,previousItemNode,currentItemNode,nullNode;
  Standard_Boolean NoKey = Standard_True;
  Standard_Boolean NoItem = Standard_True;

  ResHashItem = myItemHash.HashCode(anItem,myArrayItem->Length());
  currentItemNode = myArrayItem->Value(ResHashItem);
  while ( NoItem && !currentItemNode.IsNull() ) {
    if ( myItemHash.Compare(currentItemNode->GetItem(),anItem) ) 
      NoItem = Standard_False;
    else {
      previousItemNode = currentItemNode;
      currentItemNode = currentItemNode->NextItem();
    }
  }
  
  if ( NoItem ) Standard_NoSuchObject::Raise();
  else {
    ResHashKey = 
      myKeyHash.HashCode(currentItemNode->GetKey(),myArrayKey->Length());
    currentKeyNode = myArrayKey->Value(ResHashKey);
    while ( NoKey && !currentKeyNode.IsNull() ) {
      if ( currentKeyNode == currentItemNode ) NoKey = Standard_False;
      else {
	previousKeyNode = currentKeyNode;
	currentKeyNode = currentKeyNode->NextKey();
      }
    }
    if ( NoKey ) Standard_NoSuchObject::Raise();
    else {
      if ( previousItemNode.IsNull() )
	myArrayItem->SetValue(ResHashItem,currentItemNode->NextItem());
      else
	previousItemNode->SetNextItem(currentItemNode->NextItem());

      if ( previousKeyNode.IsNull() ) 
	myArrayKey->SetValue(ResHashKey,currentKeyNode->NextKey());
      else
	previousKeyNode->SetNextKey(currentKeyNode->NextKey());

      myNumber--;
      currentItemNode->SetNextItem(nullNode);
      currentItemNode->SetNextKey(nullNode);
      currentItemNode.Delete();
    }
  }

}

//=======================================================================
// Function : Clear
//=======================================================================

void PCollection_HDoubleMap::Clear () 
{
  Handle(PCollection_DoubleMapNode) nullNode,theNode,delNode;
  Standard_Integer I;

  myNumber = 0;

  for ( I = 1 ; I <= myArrayItem->Length() ; I++ ) {
    theNode = myArrayItem->Value(I);
    myArrayKey->SetValue(I,nullNode);
    myArrayItem->SetValue(I,nullNode);
    while ( !theNode.IsNull() ) {
      delNode = theNode;
      theNode = theNode->NextItem();
      delNode->SetNextKey(nullNode);
      delNode->SetNextItem(nullNode);
      delNode.Delete();
    }
  }
}

//=======================================================================
// Function : IsBoundByKey
//=======================================================================

Standard_Boolean PCollection_HDoubleMap::IsBoundByKey ( const Key &aKey ) const 
{
  Standard_Integer ResHashKey;
  Handle(PCollection_DoubleMapNode) theKeyNode;

  ResHashKey = myKeyHash.HashCode(aKey,myArrayKey->Length());
  theKeyNode = myArrayKey->Value(ResHashKey);
  while ( ! theKeyNode.IsNull() ) {
    if ( myKeyHash.Compare(theKeyNode->GetKey(),aKey) ) 
      return Standard_True;
    else theKeyNode = theKeyNode->NextKey();
  }
  return Standard_False;
}

//=======================================================================
// Function : IsBoundByItem
//=======================================================================

Standard_Boolean PCollection_HDoubleMap::IsBoundByItem(const Item &anItem) const 
{
  Standard_Integer ResHashItem;
  Handle(PCollection_DoubleMapNode) theItemNode;

  ResHashItem = myItemHash.HashCode(anItem,myArrayItem->Length());
  theItemNode = myArrayItem->Value(ResHashItem);
  while ( ! theItemNode.IsNull() ) {
    if ( myItemHash.Compare(theItemNode->GetItem(),anItem) ) 
      return Standard_True;
    else theItemNode = theItemNode->NextItem();
  }
  return Standard_False;
}

//=======================================================================
// Function : IsEmpty
//=======================================================================

Standard_Boolean PCollection_HDoubleMap::IsEmpty () const 
{
  Standard_Boolean Empty = Standard_True;

  for ( Standard_Integer I = 1 ; I <= myArrayKey->Length() && Empty ; I++ )
    if ( ! myArrayKey->Value(I).IsNull() ) Empty = Standard_False;

  return Empty;
}

//=======================================================================
// Function : GetArrayKey
//=======================================================================

Handle(PCollection_ArrayDoubleMap) PCollection_HDoubleMap::
                                               GetArrayKey () const 
{
  return myArrayKey;
}