public class UnsafeBufferPosition extends Position
UnsafeBuffer.| Constructor and Description |
|---|
UnsafeBufferPosition(UnsafeBuffer buffer,
int counterId)
Map a position over a buffer.
|
UnsafeBufferPosition(UnsafeBuffer buffer,
int counterId,
CountersManager countersManager)
Map a position over a buffer and this indicator owns the counter for reclamation.
|
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
long |
get()
Get the current position of a component without memory ordering semantics.
|
long |
getVolatile()
Get the current position of a component with volatile semantics
|
int |
id()
Identifier for this position.
|
boolean |
isClosed()
Has this Position been closed?
|
boolean |
proposeMax(long proposedValue)
Set the position to a new proposedValue if greater than the current value without memory ordering semantics.
|
boolean |
proposeMaxOrdered(long proposedValue)
Set the position to the new proposedValue if greater than the current value with memory ordering semantics.
|
void |
set(long value)
Sets the current position of the component without memory ordering semantics.
|
void |
setOrdered(long value)
Sets the current position of the component with ordered memory semantics.
|
void |
setVolatile(long value)
Sets the current position of the component with volatile memory semantics.
|
public UnsafeBufferPosition(UnsafeBuffer buffer, int counterId)
buffer - containing the counter.counterId - identifier of the counter.public UnsafeBufferPosition(UnsafeBuffer buffer, int counterId, CountersManager countersManager)
buffer - containing the counter.counterId - identifier of the counter.countersManager - to be used for freeing the counter when this is closed.public boolean isClosed()
Positionpublic int id()
ReadablePositionid in class ReadablePositionpublic long get()
Positionpublic long getVolatile()
ReadablePositiongetVolatile in class ReadablePositionpublic void set(long value)
Positionpublic void setOrdered(long value)
PositionsetOrdered in class Positionvalue - the current position of the component.public void setVolatile(long value)
PositionsetVolatile in class Positionvalue - the current position of the component.public boolean proposeMax(long proposedValue)
PositionproposeMax in class PositionproposedValue - for the new max.public boolean proposeMaxOrdered(long proposedValue)
PositionproposeMaxOrdered in class PositionproposedValue - for the new max.public void close()
close in interface java.lang.AutoCloseableclose in class ReadablePositionCopyright © 2014-2019 Real Logic Ltd. All Rights Reserved.