X-Git-Url: https://git.saurik.com/apple/security.git/blobdiff_plain/5dd5f9ec28f304ca377c42fd7f711d6cf12b90e1..5c19dc3ae3bd8e40a9c028b0deddd50ff337692c:/Security/libsecurity_transform/lib/SingleShotSource.cpp diff --git a/Security/libsecurity_transform/lib/SingleShotSource.cpp b/Security/libsecurity_transform/lib/SingleShotSource.cpp deleted file mode 100644 index f5121f21..00000000 --- a/Security/libsecurity_transform/lib/SingleShotSource.cpp +++ /dev/null @@ -1,61 +0,0 @@ - -#include "SingleShotSource.h" -#include - -using namespace std; - -CFStringRef gSingleShotSourceName = CFSTR("Single Shot Source"); - -SingleShotSource::SingleShotSource(CFTypeRef value, Transform* t, CFStringRef name) : - Source(gSingleShotSourceName, t, name) -{ - SetValue(value); -} - -void SingleShotSource::DoActivate() -{ - // Make sure our destination doesn't vanish while we are sending it data (or the final NULL) - CFRetain(mDestination->GetCFObject()); - - // take our value and send it on its way - mDestination->SetAttribute(mDestinationName, GetValue()); - - // send an end of stream - mDestination->SetAttribute(mDestinationName, NULL); - - CFRelease(mDestination->GetCFObject()); -} - - - -Boolean SingleShotSource::Equal(const CoreFoundationObject* obj) -{ - if (Source::Equal(obj)) - { - const SingleShotSource* sss = (const SingleShotSource*) obj; - return CFEqual(GetValue(), sss->GetValue()); - } - - return false; -} - - - -CFTypeRef SingleShotSource::Make(CFTypeRef value, Transform* t, CFStringRef name) -{ - return CoreFoundationHolder::MakeHolder(gInternalCFObjectName, new SingleShotSource(value, t, name)); -} - - - -std::string SingleShotSource::DebugDescription() -{ - string result = Source::DebugDescription() + ": SingleShotSource "; - - char buffer[256]; - snprintf(buffer, sizeof(buffer), "(value = %p)", GetValue()); - - result += buffer; - - return result; -}