]>
git.saurik.com Git - apple/xnu.git/blob - libkern/c++/OSCollection.cpp
ff54175ee8978e6cced0be831063789e09d7ffe5
2 * Copyright (c) 2000 Apple Computer, Inc. All rights reserved.
4 * @APPLE_LICENSE_HEADER_START@
6 * The contents of this file constitute Original Code as defined in and
7 * are subject to the Apple Public Source License Version 1.1 (the
8 * "License"). You may not use this file except in compliance with the
9 * License. Please obtain a copy of the License at
10 * http://www.apple.com/publicsource and read it before using this file.
12 * This Original Code and all software distributed under the License are
13 * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER
14 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
15 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
16 * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the
17 * License for the specific language governing rights and limitations
20 * @APPLE_LICENSE_HEADER_END@
22 /* IOArray.h created by rsulack on Thu 11-Sep-1997 */
24 #include <libkern/OSDebug.h>
26 #include <libkern/c++/OSCollection.h>
27 #include <libkern/c++/OSDictionary.h>
29 #include <IOKit/IOKitDebug.h>
31 #define super OSObject
33 OSDefineMetaClassAndAbstractStructors(OSCollection
, OSObject
)
36 OSMetaClassDefineReservedUsed(OSCollection
, 0);
37 OSMetaClassDefineReservedUsed(OSCollection
, 1);
38 OSMetaClassDefineReservedUnused(OSCollection
, 2);
39 OSMetaClassDefineReservedUnused(OSCollection
, 3);
40 OSMetaClassDefineReservedUnused(OSCollection
, 4);
41 OSMetaClassDefineReservedUnused(OSCollection
, 5);
42 OSMetaClassDefineReservedUnused(OSCollection
, 6);
43 OSMetaClassDefineReservedUnused(OSCollection
, 7);
45 bool OSCollection::init()
55 void OSCollection::haveUpdated()
57 if ( (gIOKitDebug
& kOSLogRegistryMods
) && (fOptions
& kImmutable
) )
58 OSReportWithBacktrace("Trying to change a collection in the registry");
63 unsigned OSCollection::setOptions(unsigned options
, unsigned mask
, void *)
65 unsigned old
= fOptions
;
68 fOptions
= (old
& ~mask
) | (options
& mask
);
73 OSCollection
* OSCollection::copyCollection(OSDictionary
*cycleDict
)
76 OSObject
*obj
= cycleDict
->getObject((const OSSymbol
*) this);
80 return reinterpret_cast<OSCollection
*>(obj
);
83 // If we are here it means that there is a collection subclass that
84 // hasn't overridden the copyCollection method. In which case just
85 // return a reference to ourselves.
86 // Hopefully this collection will not be inserted into the registry