aicas logoJamaica 6.4 release 1

javax.realtime.device
Interface RawLongWriter

All Superinterfaces:
RawMemory
All Known Subinterfaces:
RawLong

public interface RawLongWriter
extends RawMemory

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.

Since:
RTSJ 2.0

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

setLong

void setLong(long value)
Set the value at the first position referenced by this instance, i.e., the value at its start address. 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.


setLong

void setLong(int offset,
             long value)
             throws OffsetOutOfBoundsException
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. 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.

Parameters:
offset - of long in the memory region.
Throws:
OffsetOutOfBoundsException - when offset is negative or greater than or equal to the number of elements in the raw memory region.

set

int set(int offset,
        long[] values)
        throws OffsetOutOfBoundsException,
               NullPointerException
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. 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.

Returns:
the number of elements copied to values
Throws:
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.

set

int set(int offset,
        long[] values,
        int start,
        int count)
        throws OffsetOutOfBoundsException,
               ArrayIndexOutOfBoundsException,
               IllegalArgumentException,
               NullPointerException
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. 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.

Parameters:
offset - of the first long in the memory region to transfere
values - the array to received the longs
start - the first index in array to fill
count - the maximum number of longs to copy
Returns:
the number of longs actually transfered.
Throws:
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.

aicas logoJamaica 6.4 release 1

aicas GmbH, Karlsruhe, Germany —www.aicas.com
Copyright © 2001-2015 aicas GmbH. All Rights Reserved.