]> git.saurik.com Git - apple/security.git/blob - OSX/libsecurity_transform/lib/GroupTransform.h
Security-59306.11.20.tar.gz
[apple/security.git] / OSX / libsecurity_transform / lib / GroupTransform.h
1 #ifndef __GROUP_TRANSFORM__
2 #define __GROUP_TRANSFORM__
3
4
5 #include "Transform.h"
6 #include "TransformFactory.h"
7
8 extern CFStringRef kSecGroupTransformType;
9
10 class GroupTransform : public Transform
11 {
12 protected:
13 std::string DebugDescription();
14 virtual void FinalizePhase2();
15 virtual bool validConnectionPoint(CFStringRef attributeName);
16 GroupTransform();
17 CFMutableArrayRef mMembers;
18 dispatch_group_t mAllChildrenFinalized;
19 dispatch_group_t mPendingStartupActivity;
20
21 void RecurseForAllNodes(dispatch_group_t group, CFErrorRef *errorOut, bool parallel, bool opExecutesOnGroups, Transform::TransformOperation op);
22
23 public:
24 virtual ~GroupTransform();
25
26 static CFTypeRef Make();
27 static TransformFactory* MakeTransformFactory();
28
29 static CFTypeID GetCFTypeID();
30
31 void AddMemberToGroup(SecTransformRef member);
32 void RemoveMemberFromGroup(SecTransformRef member);
33 bool HasMember(SecTransformRef member);
34
35 void AddAllChildrenFinalizedCallback(dispatch_queue_t run_on, dispatch_block_t callback);
36 void ChildStartedFinalization(Transform *child);
37
38 SecTransformRef FindFirstTransform(); // defined as the transform to which input is attached
39 SecTransformRef FindLastTransform(); // defined as the transform to which the monitor is attached
40 SecTransformRef FindMonitor();
41 SecTransformRef GetAnyMember();
42
43 SecTransformRef FindByName(CFStringRef name);
44
45 // A group should delay destruction while excution is starting
46 void StartingExecutionInGroup();
47 void StartedExecutionInGroup(bool succesful);
48
49 virtual CFDictionaryRef Externalize(CFErrorRef* error);
50
51 CFErrorRef ForAllNodes(bool parallel, bool opExecutesOnGroups, Transform::TransformOperation op);
52 void ForAllNodesAsync(bool opExecutesOnGroups, dispatch_group_t group, Transform::TransformAsyncOperation op);
53
54 CFStringRef DotForDebugging();
55 };
56
57
58
59 #endif