2 * Copyright (c) 2000-2001 Apple Computer, Inc. All Rights Reserved.
4 * The contents of this file constitute Original Code as defined in and are
5 * subject to the Apple Public Source License Version 1.2 (the 'License').
6 * You may not use this file except in compliance with the License. Please obtain
7 * a copy of the License at http://www.apple.com/publicsource and read it before
10 * This Original Code and all software distributed under the License are
11 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS
12 * OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, INCLUDING WITHOUT
13 * LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
14 * PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. Please see the License for the
15 * specific language governing rights and limitations under the License.
20 // cssmmds - MDS interface for CSSM & friends
26 #include <Security/globalizer.h>
28 #include <stdio.h> // @@@ for temporary MDS interface only
37 MdsComponent(const Guid
&guid
);
38 virtual ~MdsComponent();
40 const Guid
&myGuid() const { return mMyGuid
; }
42 CSSM_SERVICE_MASK
services() const { update(); return mServices
; }
43 bool supportsService(CSSM_SERVICE_TYPE t
) const { update(); return t
& mServices
; }
44 bool isThreadSafe() const { update(); return mIsThreadSafe
; }
45 const char *path() const { update(); return mPath
.c_str(); }
48 const Guid mMyGuid
; // GUID of the component
50 // information obtained about the component
51 mutable bool mIsValid
; // information is valid
52 mutable string mPath
; // module location
53 mutable CSSM_SERVICE_TYPE mServices
; // service types provided
54 mutable bool mIsThreadSafe
; // is the module thread safe?
56 void getInfo() const; // retrieve MDS information
57 void update() const { if (!mIsValid
) getInfo(); }
65 static ModuleNexus
<MDS
> mds
;