AAFRESULT ImplAAFSegment::FindSubSegment(aafPosition_t offset, aafPosition_t *sequPosPtr, ImplAAFSegment **subseg, aafBool *found) { aafLength_t segLen; aafPosition_t begPos, endPos, zero; XPROTECT( ) { CHECK(GetLength(&segLen)); begPos = 0; zero = 0; endPos = begPos; endPos += segLen; if ((begPos <= offset) && (offset < endPos)) { *found = kAAFTrue; *subseg = this; // We are returning a reference to this object so bump the ref count AcquireReference(); *sequPosPtr = 0; } else if ((begPos == endPos) && (offset == zero)) //JeffB: Handle zero-length sourceClips { *found = kAAFTrue; *subseg = this; // We are returning a reference to this object so bump the ref count AcquireReference(); *sequPosPtr = 0; } else { *found = kAAFFalse; *subseg = NULL; *sequPosPtr = 0; } } /* XPROTECT */ XEXCEPT { } XEND; return(AAFRESULT_SUCCESS); }
Int32 CursorWindow::GetNumRows() { AcquireReference(); //try { Int32 num = NativeGetNumRows(); //} finally { ReleaseReference(); //} return num; }
Boolean CursorWindow::AllocRow() { AcquireReference(); //try { Boolean result = NativeAllocRow(); //} finally { ReleaseReference(); //} return result; }
ECode CursorWindow::FreeLastRow() { AcquireReference(); //try { NativeFreeLastRow(); //} finally { ReleaseReference(); //} return NOERROR; }
Boolean CursorWindow::SetNumColumns( /* [in] */ Int32 columnNum) { AcquireReference(); //try { Boolean result = NativeSetNumColumns(columnNum); //} finally { ReleaseReference(); //} return result; }
ECode CursorWindow::Clear() { AcquireReference(); //try { mStartPos = 0; NativeClear(); //} finally { ReleaseReference(); //} return NOERROR; }
Boolean CursorWindow::PutNull( /* [in] */ Int32 row, /* [in] */ Int32 col) { AcquireReference(); //try { Boolean result = NativePutNull(row - mStartPos, col); //} finally { ReleaseReference(); //} return result; }
Boolean CursorWindow::IsNull( /* [in] */ Int32 row, /* [in] */ Int32 col) { AcquireReference(); //try { Boolean isNull = NativeIsNull(row - mStartPos, col); //} finally { ReleaseReference(); //} return isNull; }
status_t CreateThreadEvent::Fire() { bool wasPending = atomic_get_and_set(&fPendingDPC, 1) != 0; if (wasPending) return B_BUSY; AcquireReference(); DPCQueue::DefaultQueue(B_NORMAL_PRIORITY)->Add(this); return B_OK; }
ECode CursorWindow::GetBlob( /* [in] */ Int32 row, /* [in] */ Int32 col, /* [out] */ ArrayOf<Byte>** blob) { AcquireReference(); //try { ECode ec = NativeGetBlob(row - mStartPos, col, blob); //} finally { ReleaseReference(); //} return ec; }
Boolean CursorWindow::PutBlob( /* [in] */ const ArrayOf<Byte> & value, /* [in] */ Int32 row, /* [in] */ Int32 col) { AcquireReference(); //try { Boolean result = NativePutBlob(value, row - mStartPos, col); //} finally { ReleaseReference(); //} return result; }
ECode CursorWindow::IsString( /* [in] */ Int32 row, /* [in] */ Int32 col, /* [out] */ Boolean* isString) { AcquireReference(); //try { ECode ec = NativeIsString(row - mStartPos, col, isString); //} finally { ReleaseReference(); //} return ec; }
ECode CursorWindow::GetDouble( /* [in] */ Int32 row, /* [in] */ Int32 col, /* [out] */ Double* value) { AcquireReference(); //try { ECode ec = NativeGetDouble(row - mStartPos, col, value); //} finally { ReleaseReference(); //} return ec; }
ECode CursorWindow::GetString( /* [in] */ Int32 row, /* [in] */ Int32 col, /* [out] */ String* str) { AcquireReference(); //try { ECode ec = NativeGetString(row - mStartPos, col, str); //} finally { ReleaseReference(); //} return ec; }
// ReadVNode status_t VirtualVolume::ReadVNode(vnode_id vnid, char reenter, Node** node) { if (vnid != GetRootID()) return B_BAD_VALUE; AutoLocker<Locker> _(fLock); fRootNode->SetKnownToVFS(true); *node = fRootNode; // add a volume reference for the node AcquireReference(); return B_OK; }
ECode CursorWindow::GetFloat( /* [in] */ Int32 row, /* [in] */ Int32 col, /* [out] */ Float* value) { AcquireReference(); //try { Double dValue; ECode ec = NativeGetDouble(row - mStartPos, col, &dValue); *value = dValue; //} finally { ReleaseReference(); //} return ec; }
ECode CursorWindow::GetInt32( /* [in] */ Int32 row, /* [in] */ Int32 col, /* [out] */ Int32* value) { AcquireReference(); //try { Int64 i64Value; ECode ec = NativeGetInt64(row - mStartPos, col, &i64Value); *value = (Int32)i64Value; //} finally { ReleaseReference(); //} return ec; }
status_t SignalEvent::Fire() { bool wasPending = atomic_get_and_set(&fPendingDPC, 1) != 0; if (wasPending) return B_BUSY; if (fSignal->MarkUsed()) { atomic_set(&fPendingDPC, 0); return B_BUSY; } AcquireReference(); DPCQueue::DefaultQueue(B_NORMAL_PRIORITY)->Add(this); return B_OK; }
// AddChildVolume status_t VirtualVolume::AddChildVolume(Volume* volume) { if (!volume) return B_BAD_VALUE; // don't add anything, if we are already unmounting AutoLocker<Locker> locker(fLock); if (fUnmounting) return B_BAD_VALUE; // get and check the node name char name[B_FILE_NAME_LENGTH]; int32 nameLen = strlen(volume->GetName()); if (nameLen == 0 || nameLen >= B_FILE_NAME_LENGTH) return B_BAD_VALUE; strcpy(name, volume->GetName()); // add the volume's root node status_t error = fRootNode->AddEntry(name, volume->GetRootNode()); if (error != B_OK) return error; // set the volume's parent volume volume->SetParentVolume(this); AcquireReference(); // send out a notification vnode_id dirID = fRootNode->GetID(); vnode_id nodeID = volume->GetRootID(); locker.Unlock(); NotifyListener(B_ENTRY_CREATED, fVolumeManager->GetID(), dirID, 0, nodeID, name); return B_OK; }