X-Git-Url: https://git.saurik.com/apple/security.git/blobdiff_plain/72a12576750f52947eb043106ba5c12c0d07decf..b1ab9ed8d0e0f1c3b66d7daa8fd5564444c56195:/libsecurity_transform/lib/GroupTransform.h diff --git a/libsecurity_transform/lib/GroupTransform.h b/libsecurity_transform/lib/GroupTransform.h new file mode 100644 index 00000000..342c124d --- /dev/null +++ b/libsecurity_transform/lib/GroupTransform.h @@ -0,0 +1,59 @@ +#ifndef __GROUP_TRANSFORM__ +#define __GROUP_TRANSFORM__ + + +#include "Transform.h" +#include "TransformFactory.h" + +extern CFStringRef kSecGroupTransformType; + +class GroupTransform : public Transform +{ +protected: + std::string DebugDescription(); + virtual void FinalizePhase2(); + virtual bool validConnectionPoint(CFStringRef attributeName); + GroupTransform(); + CFMutableArrayRef mMembers; + dispatch_group_t mAllChildrenFinalized; + dispatch_group_t mPendingStartupActivity; + + void RecurseForAllNodes(dispatch_group_t group, CFErrorRef *errorOut, bool parallel, bool opExecutesOnGroups, Transform::TransformOperation op); + +public: + virtual ~GroupTransform(); + + static CFTypeRef Make(); + static TransformFactory* MakeTransformFactory(); + + static CFTypeID GetCFTypeID(); + + void AddMemberToGroup(SecTransformRef member); + void RemoveMemberFromGroup(SecTransformRef member); + bool HasMember(SecTransformRef member); + + void AddAllChildrenFinalizedCallback(dispatch_queue_t run_on, dispatch_block_t callback); + void ChildStartedFinalization(Transform *child); + + SecTransformRef FindFirstTransform(); // defined as the transform to which input is attached + SecTransformRef FindLastTransform(); // defined as the transform to which the monitor is attached + SecTransformRef FindMonitor(); + SecTransformRef GetAnyMember(); + + SecTransformRef FindByName(CFStringRef name); + + // A group should delay destruction while excution is starting + void StartingExecutionInGroup(); + void StartedExecutionInGroup(bool succesful); + + virtual CFDictionaryRef Externalize(CFErrorRef* error); + + CFErrorRef ForAllNodes(bool parallel, bool opExecutesOnGroups, Transform::TransformOperation op); + void ForAllNodesAsync(bool opExecutesOnGroups, dispatch_group_t group, Transform::TransformAsyncOperation op); + + CFStringRef DotForDebugging(); +}; + + + +#endif