public bool HasFlags( ResultFlags hasFlags, bool all ) { return(FlagOps.HasFlags(flags, hasFlags, all)); }
public ReadRangeAck(ObjectIdentifier objectIdentifier, PropertyIdentifier propertyIdentifier, UnsignedInteger propertyArrayIndex, ResultFlags resultFlags, UnsignedInteger itemCount, SequenceOf itemData, UnsignedInteger firstSequenceNumber) { ObjectIdentifier = objectIdentifier; PropertyIdentifier = propertyIdentifier; PropertyArrayIndex = propertyArrayIndex; ResultFlags = resultFlags; ItemCount = itemCount; ItemData = itemData; FirstSequenceNumber = firstSequenceNumber; }
/// <summary> /// Creates a new instance of <see cref="ReadResult"/> setting <see cref="IsCanceled"/> and <see cref="IsCompleted"/> flags. /// </summary> public ReadResult(ReadOnlySequence <byte> buffer, bool isCanceled, bool isCompleted) { _resultBuffer = buffer; _resultFlags = ResultFlags.None; if (isCompleted) { _resultFlags |= ResultFlags.Completed; } if (isCanceled) { _resultFlags |= ResultFlags.Canceled; } }
public ReadResult(ReadableBuffer buffer, bool isCancelled, bool isCompleted) { ResultBuffer = buffer; ResultFlags = ResultFlags.None; if (isCompleted) { ResultFlags |= ResultFlags.Completed; } if (isCancelled) { ResultFlags |= ResultFlags.Cancelled; } }
/// <summary> /// Creates a new instance of <see cref="FlushResult"/> setting <see cref="IsCanceled"/> and <see cref="IsCompleted"/> flags /// </summary> public FlushResult(bool isCanceled, bool isCompleted) { _resultFlags = ResultFlags.None; if (isCanceled) { _resultFlags |= ResultFlags.Canceled; } if (isCompleted) { _resultFlags |= ResultFlags.Completed; } }
public ResultFlags SetFlags( ResultFlags flags, bool set ) { if (set) { return(this.flags |= flags); } else { return(this.flags &= ~flags); } }
/////////////////////////////////////////////////////////////////////// public static bool HasFlags( ResultFlags flags, ResultFlags hasFlags, bool all ) { if (all) { return((flags & hasFlags) == hasFlags); } else { return((flags & hasFlags) != ResultFlags.None); } }
public void Clear() { // // NOTE: Clear the error information only. // returnCode = ReturnCode.Ok; previousReturnCode = ReturnCode.Ok; errorLine = 0; errorCode = null; errorInfo = null; exception = null; flags &= ~ResultFlags.Error; // we cleared error info. }
public bool Save( Interpreter interpreter ) { if (interpreter != null) { returnCode = interpreter.ReturnCode; previousReturnCode = returnCode; errorLine = interpreter.ErrorLine; /* EXEMPT */ errorCode = interpreter.ErrorCode; errorInfo = interpreter.ErrorInfo; flags |= ResultFlags.Error; // we now have error info. return(true); } return(false); }
public void Reset( bool full ) { // // NOTE: If we are doing a "full" reset then clear // all the error information as well. // if (full) { Clear(); } // // NOTE: For this object, we always null out the fields (i.e. the // NoValue and NoClientData constants are defined to be null) // because: // // 1. Typical usage of this method would be to recycle this // object for use in an object pool, which really requires // totally cleaned out (null) field values. // // 2. The existing semantics of this object do not offer any // kind of guarantee that an uninitialized instance will // convert to an empty string (unlike the Argument object). // value = NoValue; clientData = NoClientData; // // NOTE: We no longer have a string result. // flags &= ~ResultFlags.String; #if CACHE_RESULT_TOSTRING // // NOTE: We no longer have a cached string representation. // @string = null; #endif }