|
![]() |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface RawLongWriter
A marker for a long accessor object encapsulating the protocol for writing longs from raw memory. A long accessor can always access at least one long. Each long is transfered in a single atomic operation. Groups of longs may be transfered together; however, this is not required.
Objects of this type are created with the method
RawMemoryFactory.createRawLongWriter(javax.realtime.device.RawMemoryRegion, long, int, int)
and
RawMemoryFactory.createRawLong(javax.realtime.device.RawMemoryRegion, long, int, int)
. Each object references
a range of elements in the RawMemoryRegion
starting at the
base address provided to the factory method. The size provided
to the factor method determines the number of elements accessable.
Caching of the memory access is controlled by the factory that created this object. If the memory is not cached, this method guarantees serialized access. In other words, the memory access at the memory occurs in the same order as in the program. Multiple writes to the same location may not be coalesced.
Method Summary | |
---|---|
int |
set(int offset,
long[] values)
Copy values to the raw memory starting at the address
referenced by this instance plus the offset scaled by the
element size in bytes and the objects stride. |
int |
set(int offset,
long[] values,
int start,
int count)
Copy values to the memory region, where
offset is first long in the memory region to write and
start is the first index in values from
which to read. |
void |
setLong(int offset,
long value)
Set the value of the nth element referenced by this instance, where n is offset and the
address is base address + offset
× size of Long. |
void |
setLong(long value)
Set the value at the first position referenced by this instance, i.e., the value at its start address. |
Methods inherited from interface javax.realtime.device.RawMemory |
---|
getAddress, getSize, getStride |
Method Detail |
---|
void setLong(long value)
void setLong(int offset, long value) throws OffsetOutOfBoundsException
n
is offset
and the
address is base address + offset
× size of Long. This operation must be atomic with
respect to all other raw memory accesses to the address. When an
exception is thrown, no data is transfered.
offset
- of long in the memory region.
OffsetOutOfBoundsException
- when offset
is
negative or greater than or equal to the number of elements in the
raw memory region.int set(int offset, long[] values) throws OffsetOutOfBoundsException, NullPointerException
values
to the raw memory starting at the address
referenced by this instance plus the offset
scaled by the
element size in bytes and the objects stride. Only the longs
in the intersection of values
and the end of the memory
region are transfered. When an exception is thrown, no data is transfered.
values
OffsetOutOfBoundsException
- when offset
is
negative or greater than or equal to the number of elements in the
raw memory region.
NullPointerException
- when values
is null.int set(int offset, long[] values, int start, int count) throws OffsetOutOfBoundsException, ArrayIndexOutOfBoundsException, IllegalArgumentException, NullPointerException
values
to the memory region, where
offset
is first long in the memory region to write and
start
is the first index in values
from
which to read. The number of bytes transfered is the minimum of
count
, the size of the memory region minus
offset
, and length of values
minus
start
. When an exception is thrown, no data is transfered.
offset
- of the first long in the memory region to transferevalues
- the array to received the longsstart
- the first index in array to fillcount
- the maximum number of longs to copy
OffsetOutOfBoundsException
- when offset
is
negative or greater than or equal to the number of elements in the
raw memory area.
ArrayIndexOutOfBoundsException
- when start
is
negative or either start
or start + count
is greater than or equal to the size of values.
IllegalArgumentException
- when count
is negative.
NullPointerException
- when values
is null.
|
![]() |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |