]> git.saurik.com Git - apple/security.git/blob - OSX/libsecurity_transform/lib/TransformFactory.h
Security-59754.41.1.tar.gz
[apple/security.git] / OSX / libsecurity_transform / lib / TransformFactory.h
1 #ifndef __TRANSFORM_FACTORY__
2 #define __TRANSFORM_FACTORY__
3
4 #include "Transform.h"
5 #include "LinkedList.h"
6
7 class TransformFactory
8 {
9 protected:
10 static void Register(TransformFactory* tf);
11 static dispatch_once_t gSetup;
12 static dispatch_queue_t gRegisteredQueue;
13 static CFMutableDictionaryRef gRegistered;
14
15 CFStringRef mCFType;
16
17 static TransformFactory* FindTransformFactoryByType(CFStringRef type);
18 static void RegisterTransforms();
19 static void RegisterTransform(TransformFactory* tf, CFStringRef cfname = NULL);
20 static void Setup(void *);
21
22 private:
23 static bool RegisterTransform_prelocked(TransformFactory* tf, CFStringRef name);
24
25 public:
26 static SecTransformRef MakeTransformWithType(CFStringRef type, CFErrorRef* baseError) CF_RETURNS_RETAINED;
27
28 TransformFactory(CFStringRef type, bool registerGlobally = false, CFStringRef cftype = NULL);
29 static void Setup();
30 virtual CFTypeRef Make() = 0;
31 CFStringRef GetTypename() { return mCFType; };
32 };
33
34
35
36 #endif