/** * Read int and move the cursor forward * @param pipe Pipe source * @return int value */ public static <S extends MessageSchema<S>> int takeInt(Pipe<S> pipe) { return readValue(pipe.slabRing, pipe.slabMask, pipe.slabRingTail.workingTailPos.value++); }
/** * Read int and move the cursor forward * @param pipe Pipe source * @return int value */ public static <S extends MessageSchema<S>> int takeInt(Pipe<S> pipe) { return readValue(pipe.slabRing, pipe.slabMask, pipe.slabRingTail.workingTailPos.value++); }
/** * Read int and move the cursor forward * @param pipe Pipe source * @return int value */ public static <S extends MessageSchema<S>> int takeInt(Pipe<S> pipe) { return readValue(pipe.slabRing, pipe.slabMask, pipe.slabRingTail.workingTailPos.value++); }
/** * Checks pipe to see if message does not equal expected * @param pipe to be checked * @param expected1 used for comparison * @param expected2 used for comparison * @return <code>true</code> if message != expected1 and message != expected2, else <code>false</code> */ public static boolean peekNotMsg(Pipe pipe, int expected1, int expected2) { return StackStateWalker.hasContentToRead(pipe) && (expected1 != Pipe.readValue(Pipe.slab(pipe),pipe.slabMask,pipe.ringWalker.nextWorkingTail)) && (expected2 != Pipe.readValue(Pipe.slab(pipe),pipe.slabMask,pipe.ringWalker.nextWorkingTail)); }
/** * Checks pipe to see if message does not equal expected * @param pipe to be checked * @param expected1 used for comparison * @param expected2 used for comparison * @return <code>true</code> if message != expected1 and message != expected2, else <code>false</code> */ public static boolean peekNotMsg(Pipe pipe, int expected1, int expected2) { return StackStateWalker.hasContentToRead(pipe) && (expected1 != Pipe.readValue(Pipe.slab(pipe),pipe.slabMask,pipe.ringWalker.nextWorkingTail)) && (expected2 != Pipe.readValue(Pipe.slab(pipe),pipe.slabMask,pipe.ringWalker.nextWorkingTail)); }
/** * Checks pipe to see if message does not equal expected * @param pipe to be checked * @param expected1 used for comparison * @param expected2 used for comparison * @return <code>true</code> if message != expected1 && message != expected2, else <code>false</code> */ public static boolean peekNotMsg(Pipe pipe, int expected1, int expected2) { return StackStateWalker.hasContentToRead(pipe) && (expected1 != Pipe.readValue(Pipe.slab(pipe),pipe.slabMask,pipe.ringWalker.nextWorkingTail)) && (expected2 != Pipe.readValue(Pipe.slab(pipe),pipe.slabMask,pipe.ringWalker.nextWorkingTail)); }
/** * Gets the index of a message in the pipe * @param pipe pipe to check * @return message index */ public static <S extends MessageSchema<S>> int takeMsgIdx(Pipe<S> pipe) { assert(PipeMonitor.monitor(pipe, pipe.slabRingTail.workingTailPos.value, Pipe.bytesReadBase(pipe) )); return pipe.lastMsgIdx = readValue(pipe.slabRing, pipe.slabMask, pipe.slabRingTail.workingTailPos.value++); }
/** * Checks pipe to see if message does not equal expected * @param pipe to be checked * @param expected used for comparison * @return <code>true</code> if message != expected, else <code>false</code> */ public static boolean peekNotMsg(Pipe pipe, int expected) { return StackStateWalker.hasContentToRead(pipe) && (expected != Pipe.readValue(Pipe.slab(pipe),pipe.slabMask,pipe.ringWalker.nextWorkingTail)); }
/** * Checks pipe to see if message does not equal expected * @param pipe to be checked * @param expected used for comparison * @return <code>true</code> if message != expected, else <code>false</code> */ public static boolean peekNotMsg(Pipe pipe, int expected) { return StackStateWalker.hasContentToRead(pipe) && (expected != Pipe.readValue(Pipe.slab(pipe),pipe.slabMask,pipe.ringWalker.nextWorkingTail)); }
/** * Checks pipe to see if message does not equal expected * @param pipe to be checked * @param expected used for comparison * @return <code>true</code> if message != expected, else <code>false</code> */ public static boolean peekNotMsg(Pipe pipe, int expected) { return StackStateWalker.hasContentToRead(pipe) && (expected != Pipe.readValue(Pipe.slab(pipe),pipe.slabMask,pipe.ringWalker.nextWorkingTail)); }
/** * Checks pipe to see if message equals expected * @param pipe to be checked * @param expected1 used for comparison with message * @param expected2 used for comparison with message * @return <code>true</code> if message == expected1 and expected2, else <code>false</code> */ public static boolean peekMsg(Pipe pipe, int expected1, int expected2) { assert(Pipe.singleThreadPerPipeRead(pipe.id)); return StackStateWalker.hasContentToRead(pipe) && ( (expected1 == Pipe.readValue(Pipe.slab(pipe),pipe.slabMask,pipe.ringWalker.nextWorkingTail)) || (expected2 == Pipe.readValue(Pipe.slab(pipe),pipe.slabMask,pipe.ringWalker.nextWorkingTail)) ); }
/** * Checks pipe to see if message equals expected * @param pipe to be checked * @param expected used for comparison with message * @return <code>true</code> if message == expected, else <code>false</code> */ public static boolean peekMsg(Pipe pipe, int expected) { assert(Pipe.singleThreadPerPipeRead(pipe.id)); return StackStateWalker.hasContentToRead(pipe) && (expected == Pipe.readValue(Pipe.slab(pipe),pipe.slabMask,pipe.ringWalker.nextWorkingTail)); }
/** * Checks pipe to see if message equals expected * @param pipe to be checked * @param expected used for comparison with message * @return <code>true</code> if message == expected, else <code>false</code> */ public static boolean peekMsg(Pipe pipe, int expected) { assert(Pipe.singleThreadPerPipeRead(pipe.id)); return StackStateWalker.hasContentToRead(pipe) && (expected == Pipe.readValue(Pipe.slab(pipe),pipe.slabMask,pipe.ringWalker.nextWorkingTail)); }
/** * Checks pipe to see if message equals expected * @param pipe to be checked * @param expected used for comparison with message * @return <code>true</code> if message == expected, else <code>false</code> */ public static boolean peekMsg(Pipe pipe, int expected) { assert(Pipe.singleThreadPerPipeRead(pipe.id)); return StackStateWalker.hasContentToRead(pipe) && (expected == Pipe.readValue(Pipe.slab(pipe),pipe.slabMask,pipe.ringWalker.nextWorkingTail)); }
/** * Peeks ahead to specified field in pipe before Trie parsing is done * @param pipe pipe to read * @param loc field to peek in * @return int data in that field */ public static int peekInt(Pipe pipe, int loc) { assert(PipeReader.hasContentToRead(pipe)) : "results would not be repeatable, before peek hasContentToRead must be called."; assert(LOCUtil.isLocOfAnyType(loc, TypeMask.IntegerSigned, TypeMask.IntegerSignedOptional, TypeMask.IntegerUnsigned, TypeMask.IntegerUnsignedOptional, TypeMask.GroupLength)): "Value found "+LOCUtil.typeAsString(loc); return Pipe.readValue(Pipe.slab(pipe),pipe.slabMask,pipe.ringWalker.nextWorkingTail+(OFF_MASK&loc)); }
/** * Peeks ahead to specified field in pipe before Trie parsing is done * @param pipe pipe to read * @param loc field to peek in * @return int data in that field */ public static int peekInt(Pipe pipe, int loc) { assert(PipeReader.hasContentToRead(pipe)) : "results would not be repeatable, before peek hasContentToRead must be called."; assert(LOCUtil.isLocOfAnyType(loc, TypeMask.IntegerSigned, TypeMask.IntegerSignedOptional, TypeMask.IntegerUnsigned, TypeMask.IntegerUnsignedOptional, TypeMask.GroupLength)): "Value found "+LOCUtil.typeAsString(loc); return Pipe.readValue(Pipe.slab(pipe),pipe.slabMask,pipe.ringWalker.nextWorkingTail+(OFF_MASK&loc)); }
/** * @param pipe * @param loc * @param expected * @return true if the value exists and matches the expected, when false is returned it does not mean not equals but rather undetermined. */ public static boolean peekEquals(Pipe pipe, int loc, int expected) { assert(LOCUtil.isLocOfAnyType(loc, TypeMask.IntegerSigned, TypeMask.IntegerSignedOptional, TypeMask.IntegerUnsigned, TypeMask.IntegerUnsignedOptional, TypeMask.GroupLength)): "Value found "+LOCUtil.typeAsString(loc); return StackStateWalker.hasContentToRead(pipe) && (expected == Pipe.readValue(Pipe.slab(pipe),pipe.slabMask,pipe.ringWalker.nextWorkingTail+(OFF_MASK&loc))); }
/** * @param pipe * @param loc * @param expected * @return true if the value exists and matches the expected, when false is returned it does not mean not equals but rather undetermined. */ public static boolean peekEquals(Pipe pipe, int loc, int expected) { assert(LOCUtil.isLocOfAnyType(loc, TypeMask.IntegerSigned, TypeMask.IntegerSignedOptional, TypeMask.IntegerUnsigned, TypeMask.IntegerUnsignedOptional, TypeMask.GroupLength)): "Value found "+LOCUtil.typeAsString(loc); return StackStateWalker.hasContentToRead(pipe) && (expected == Pipe.readValue(Pipe.slab(pipe),pipe.slabMask,pipe.ringWalker.nextWorkingTail+(OFF_MASK&loc))); }
/** * @param pipe * @param loc * @param expected * @return true if the value exists and matches the expected, when false is returned it does not mean not equals but rather undetermined. */ public static boolean peekEquals(Pipe pipe, int loc, int expected) { assert(LOCUtil.isLocOfAnyType(loc, TypeMask.IntegerSigned, TypeMask.IntegerSignedOptional, TypeMask.IntegerUnsigned, TypeMask.IntegerUnsignedOptional, TypeMask.GroupLength)): "Value found "+LOCUtil.typeAsString(loc); return StackStateWalker.hasContentToRead(pipe) && (expected == Pipe.readValue(Pipe.slab(pipe),pipe.slabMask,pipe.ringWalker.nextWorkingTail+(OFF_MASK&loc))); }
/** * Peeks ahead to specified field in pipe before Trie parsing is done * @param pipe pipe to read * @param loc field to peek in * @return int data in that field */ public static int peekInt(Pipe pipe, int loc) { assert(PipeReader.hasContentToRead(pipe)) : "results would not be repeatable, before peek hasContentToRead must be called."; assert(LOCUtil.isLocOfAnyType(loc, TypeMask.IntegerSigned, TypeMask.IntegerSignedOptional, TypeMask.IntegerUnsigned, TypeMask.IntegerUnsignedOptional, TypeMask.GroupLength)): "Value found "+LOCUtil.typeAsString(loc); return Pipe.readValue(Pipe.slab(pipe),pipe.slabMask,pipe.ringWalker.nextWorkingTail+(OFF_MASK&loc)); }