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