aicas logoJamaica 6.4 release 1

javax.realtime.device
Class RawMemoryFactory

java.lang.Object
  extended by javax.realtime.device.RawMemoryFactory

public class RawMemoryFactory
extends Object

This class is the hub of a system that constructs special purpose objects to access particular types and ranges of raw memory. This facility is supported by the register(RawMemoryRegionFactory) methods. An application developer can use this method to add support for any ram memory region that is not supported out of the box.

Each create method returns an object of the corresponding type, e.g., the createRawByte(RawMemoryRegion, long, int, int) method returns a reference to an object that implements the RawByte interface and supports access to the requested type of memory and address range. Each create method is permitted to optimize error checking and access based on the requested memory type and address range.

The useage pattern for raw memory, assuming the necessary factory has been registered, is ilustrated by this example.

  // Get an accessor object that can access memory starting at
  // baseAddress, for size bytes.
  RawInt memory =
    RawMemoryFactory.createRawInt(RawMemoryFactory.MEMORY_MAPPED_REGION,
                                  address, count, stride);
  // Use the accessor to load from and store to raw memory.
  int loadedData = memory.getInt(someOffset);
  memory.setInt(otherOffset, intVal);
 
When an application needs to access a class of memory that is not already supported by a registered factory, the developer must define a memory region by implementing a factory which can create objects to access memory in that region. Thus, the application must implement a factory that implements the RawMemoryRegionFactory interface.

A raw memory region factory is identified by a RawMemoryRegion that is used by each create method, e.g., createRawByte(RawMemoryRegion, long, int, int), to locate the appropriate factory. The name is not passed to register(RawMemoryRegionFactory) as an argument; the name is available to register(RawMemoryRegionFactory) through the factory's RawMemoryRegionFactory.getRegion() method.

The register(RawMemoryRegionFactory) method is only used by application code when it needs to add support for a new type of raw memory.

Whether an offset addresses the high-order or low-order byte is normally based on the value of the RealtimeSystem.BYTE_ORDER static byte variable in class RealtimeSystem. If the type of memory supported by a raw memory accessor class implements non-standard byte ordering, accessor methods in that instance continue to select bytes starting at offset from the base address and continuing toward greater addresses. The accessor instance may control the mapping of these bytes into the primitive data type. The accessor could even select bytes that are not contiguous. In each case the documentation for the raw memory access factory must document any mapping other than the "normal" one specified above.

The RawMemory class enables a realtime program to implement device drivers, memory-mapped I/O, flash memory, battery-backed RAM, and similar low-level software.

A raw memory region cannot contain references to Java objects. Such a capability would be unsafe (since it could be used to defeat Java's type checking) and error prone (since it is sensitive to the specific representational choices made by the Java compiler).

Atomic loads and stores on raw memory are defined in terms of physical memory. This memory may be accessible to threads outside the JVM and to non-programmed access (e.g., DMA), consequently atomic access must be supported by hardware. This specification is written with the assumption that all suitable hardware platforms support atomic loads from raw memory for aligned bytes, shorts, and ints. Atomic access beyond the specified minimum may be supported by the implementation.

Storing values into raw memory is more hardware-dependent than loading values. Many processor architectures do not support atomic stores of variables except for aligned stores of the processor's word size. For instance, storing a byte into memory might require reading a 32-bit quantity into a processor register, updating the register to reflect the new byte value, then re-storing the whole 32-bit quantity. Changes to other bytes in the 32-bit quantity that take place between the load and the store are lost.

Some processors have mechanisms that can be used to implement an atomic store of a byte, but those mechanisms are often slow and not universally supported.

This class need not support unaligned access to data; but if it does, it is not require the implementation to make such access atomic. Accesses to data aligned on its natural boundary will be atomic if the processor implements atomic loads and stores of that data size.

Except where noted, accesses to raw memory are not atomic with respect to the memory or with respect to schedulable objects. A raw memory region could be updated by another schedulable object, or even unmapped in the middle of an access method, or even removed mid method.

The characteristics of raw-memory access are necessarily platform dependent. This specification provides a minimum requirement for the RTSJ platform, but it also supports optional system properties that identify a platform's level of support for atomic raw put and get. The properties represent a four-dimensional sparse array with boolean values indicating whether that combination of access attributes is atomic. The default value for array entries is false. The dimension are

Attribute
Values
Comment
Access type read, write  
Data type
  • byte,
  • short,
  • int,
  • long,
  • float,
  • double
 
Alignment 0 to 7

For each data type, the possible alignments range from

  • 0 == aligned
  • to data size - 1 == only the first byte of the data is alignment bytes away from natural alignment.
Atomicity
  • processor,
  • smp,
  • memory
  • processor means access is atomic with respect to other schedulable objects on that processor.
  • smp means that access is processor atomic, and atomic with respect across the processors in an SMP.
  • memory means that access is smp atomic, and atomic with respect to all access to the memory including DMA.
The true values in the table are represented by properties of the following form. javax.realtime.atomicaccess_<access>_<type>_<alignment>_atomicity=true for example,
  javax.realtime.atomicaccess_read_byte_0_memory=true
 
Table entries with a value of false may be explicitly represented, but since false is the default value, such properties are redundant.

All raw memory access is treated as volatile, and serialized. The runtime must be forced to read memory or write to memory on each call to a raw memory objects's getter or setter method, and to complete the reads and writes in the order they appear in the program order.

Since:
RTSJ 2.0

Field Summary
static RawMemoryRegion IO_PORT_MAPPED_REGION
          This raw memory name is used to request access to memory mapped I/O devices.
static RawMemoryRegion MEMORY_MAPPED_REGION
          This raw memory name is used to request access to I/O device space implemented by processor instructions.
 
Constructor Summary
RawMemoryFactory()
          Create an application specific factory.
 
Method Summary
 RawByte createRawByte(RawMemoryRegion region, long base, int count, int stride)
          Create an instance of a class that implements RawByte and accesses memory of region in the address range described by base, stride, and count.
 RawByteReader createRawByteReader(RawMemoryRegion region, long base, int count, int stride)
          Create an instance of a class that implements RawByteReader and accesses memory of region in the address range described by base, stride, and count.
 RawByteWriter createRawByteWriter(RawMemoryRegion region, long base, int count, int stride)
          Create an instance of a class that implements RawByteWriter and accesses memory of region in the address range described by base, stride, and count.
 RawDouble createRawDouble(RawMemoryRegion region, long base, int count, int stride)
          Create an instance of a class that implements RawDouble and accesses memory of region in the address range described by base, stride, and count.
 RawDoubleReader createRawDoubleReader(RawMemoryRegion region, long base, int count, int stride)
          Create an instance of a class that implements RawDoubleReader and accesses memory of region in the address range described by base, stride, and count.
 RawDoubleWriter createRawDoubleWriter(RawMemoryRegion region, long base, int count, int stride)
          Create an instance of a class that implements RawDoubleWriter and accesses memory of region in the address range described by base, stride, and count.
 RawFloat createRawFloat(RawMemoryRegion region, long base, int count, int stride)
          Create an instance of a class that implements RawFloat and accesses memory of region in the address range described by base, stride, and count.
 RawFloatReader createRawFloatReader(RawMemoryRegion region, long base, int count, int stride)
          Create an instance of a class that implements RawFloatReader and accesses memory of region in the address range described by base, stride, and count.
 RawFloatWriter createRawFloatWriter(RawMemoryRegion region, long base, int count, int stride)
          Create an instance of a class that implements RawFloatWriter and accesses memory of region in the address range described by base, stride, and count.
 RawInt createRawInt(RawMemoryRegion region, long base, int count, int stride)
          Create an instance of a class that implements RawInt and accesses memory of region in the address range described by base, stride, and count.
 RawIntReader createRawIntReader(RawMemoryRegion region, long base, int count, int stride)
          Create an instance of a class that implements RawIntReader and accesses memory of region in the address range described by base, stride, and count.
 RawIntWriter createRawIntWriter(RawMemoryRegion region, long base, int count, int stride)
          Create an instance of a class that implements RawIntWriter and accesses memory of region in the address range described by base, stride, and count.
 RawLong createRawLong(RawMemoryRegion region, long base, int count, int stride)
          Create an instance of a class that implements RawLong and accesses memory of region in the address range described by base, stride, and count.
 RawLongReader createRawLongReader(RawMemoryRegion region, long base, int count, int stride)
          Create an instance of a class that implements RawLongReader and accesses memory of region in the address range described by base, stride, and count.
 RawLongWriter createRawLongWriter(RawMemoryRegion region, long base, int count, int stride)
          Create an instance of a class that implements RawLongWriter and accesses memory of region in the address range described by base, stride, and count.
 RawShort createRawShort(RawMemoryRegion region, long base, int count, int stride)
          Create an instance of a class that implements RawShort and accesses memory of region in the address range described by base, stride, and count.
 RawShortReader createRawShortReader(RawMemoryRegion region, long base, int count, int stride)
          Create an instance of a class that implements RawShortReader and accesses memory of region in the address range described by base, stride, and count.
 RawShortWriter createRawShortWriter(RawMemoryRegion region, long base, int count, int stride)
          Create an instance of a class that implements RawShortWriter and accesses memory of region in the address range described by base, stride, and count.
 void deregister(RawMemoryRegionFactory factory)
          Deregister a region factory for the region of the given factory.
static RawMemoryFactory getDefaultFactory()
          Get the default factory.
 void register(RawMemoryRegionFactory factory)
          Register a region factory for the region of the given factory.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MEMORY_MAPPED_REGION

public static final RawMemoryRegion MEMORY_MAPPED_REGION
This raw memory name is used to request access to I/O device space implemented by processor instructions.

Since:
RTSJ 2.0

IO_PORT_MAPPED_REGION

public static final RawMemoryRegion IO_PORT_MAPPED_REGION
This raw memory name is used to request access to memory mapped I/O devices.

Since:
RTSJ 2.0
Constructor Detail

RawMemoryFactory

public RawMemoryFactory()
Create an application specific factory.

Method Detail

getDefaultFactory

public static RawMemoryFactory getDefaultFactory()
Get the default factory. Create when it has not already been created. Ensure that at least the RawMemoryRegionFactory is registered in the default factory.


register

public void register(RawMemoryRegionFactory factory)
              throws RegistrationException,
                     NullPointerException
Register a region factory for the region of the given factory.

Parameters:
factory - is a memory region factory.
Throws:
RegistrationException - when another factory is already registered for the region.
NullPointerException - when factory is null.

deregister

public void deregister(RawMemoryRegionFactory factory)
Deregister a region factory for the region of the given factory.

Parameters:
factory - is a memory region factory.
Throws:
DegistrationException - when the given factory is not registered.
NullPointerException - when factory is null.

createRawByte

public RawByte createRawByte(RawMemoryRegion region,
                             long base,
                             int count,
                             int stride)
                      throws SecurityException,
                             OffsetOutOfBoundsException,
                             SizeOutOfBoundsException,
                             MemoryTypeConflictException,
                             UnsupportedRawMemoryRegionException
Create an instance of a class that implements RawByte and accesses memory of region in the address range described by base, stride, and count. The actual extent of the memory addressed by the object is (stride - 1) × size of byte × count. The object is allocated in the current memory area of the calling thread.

Parameters:
base - The starting physical address accessible through the returned instance.
count - The number of memory elements accessible through the returned instance.
stride - The distance to the next element in mulitple of element size.
Returns:
an object that implements RawByte and supports access to the specified range in the memory region.
Throws:
IllegalArgumentException - when base is negative, or count is not greater than zero.
SecurityException - when the caller does not have permissions to access the given memory region or the specified range of addresses.
OffsetOutOfBoundsException - when base is invalid.
SizeOutOfBoundsException - when the memory addressed by the object would extend into an invalid range of memory.
MemoryTypeConflictException - when base does not point to memory that matches the type served by this factory.
UnsupportedRawMemoryRegionException
Since:
RTSJ 2.0

createRawByteReader

public RawByteReader createRawByteReader(RawMemoryRegion region,
                                         long base,
                                         int count,
                                         int stride)
                                  throws SecurityException,
                                         OffsetOutOfBoundsException,
                                         SizeOutOfBoundsException,
                                         MemoryTypeConflictException,
                                         UnsupportedRawMemoryRegionException
Create an instance of a class that implements RawByteReader and accesses memory of region in the address range described by base, stride, and count. The actual extent of the memory addressed by the object is (stride - 1) × size of byte × count. The object is allocated in the current memory area of the calling thread.

Parameters:
base - The starting physical address accessible through the returned instance.
count - The number of memory elements accessible through the returned instance.
stride - The distance to the next element in mulitple of element size.
Returns:
an object that implements RawByteReader and supports access to the specified range in the memory region.
Throws:
IllegalArgumentException - when base is negative, or count is not greater than zero.
SecurityException - when the caller does not have permissions to access the given memory region or the specified range of addresses.
OffsetOutOfBoundsException - when base is invalid.
SizeOutOfBoundsException - when the memory addressed by the object would extend into an invalid range of memory.
MemoryTypeConflictException - when base does not point to memory that matches the type served by this factory.
UnsupportedRawMemoryRegionException
Since:
RTSJ 2.0

createRawByteWriter

public RawByteWriter createRawByteWriter(RawMemoryRegion region,
                                         long base,
                                         int count,
                                         int stride)
                                  throws SecurityException,
                                         OffsetOutOfBoundsException,
                                         SizeOutOfBoundsException,
                                         MemoryTypeConflictException,
                                         UnsupportedRawMemoryRegionException
Create an instance of a class that implements RawByteWriter and accesses memory of region in the address range described by base, stride, and count. The actual extent of the memory addressed by the object is (stride - 1) × size of byte × count. The object is allocated in the current memory area of the calling thread.

Parameters:
base - The starting physical address accessible through the returned instance.
count - The number of memory elements accessible through the returned instance.
stride - The distance to the next element in mulitple of element size.
Returns:
an object that implements RawByteWriter and supports access to the specified range in the memory region.
Throws:
IllegalArgumentException - when base is negative, or count is not greater than zero.
SecurityException - when the caller does not have permissions to access the given memory region or the specified range of addresses.
OffsetOutOfBoundsException - when base is invalid.
SizeOutOfBoundsException - when the memory addressed by the object would extend into an invalid range of memory.
MemoryTypeConflictException - when base does not point to memory that matches the type served by this factory.
UnsupportedRawMemoryRegionException
Since:
RTSJ 2.0

createRawShort

public RawShort createRawShort(RawMemoryRegion region,
                               long base,
                               int count,
                               int stride)
                        throws SecurityException,
                               OffsetOutOfBoundsException,
                               SizeOutOfBoundsException,
                               MemoryTypeConflictException,
                               UnsupportedRawMemoryRegionException
Create an instance of a class that implements RawShort and accesses memory of region in the address range described by base, stride, and count. The actual extent of the memory addressed by the object is (stride - 1) × size of short × count. The object is allocated in the current memory area of the calling thread.

Parameters:
base - The starting physical address accessible through the returned instance.
count - The number of memory elements accessible through the returned instance.
stride - The distance to the next element in mulitple of element size.
Returns:
an object that implements RawShort and supports access to the specified range in the memory region.
Throws:
IllegalArgumentException - when base is negative, or count is not greater than zero.
SecurityException - when the caller does not have permissions to access the given memory region or the specified range of addresses.
OffsetOutOfBoundsException - when base is invalid.
SizeOutOfBoundsException - when the memory addressed by the object would extend into an invalid range of memory.
MemoryTypeConflictException - when base does not point to memory that matches the type served by this factory.
UnsupportedRawMemoryRegionException
Since:
RTSJ 2.0

createRawShortReader

public RawShortReader createRawShortReader(RawMemoryRegion region,
                                           long base,
                                           int count,
                                           int stride)
                                    throws SecurityException,
                                           OffsetOutOfBoundsException,
                                           SizeOutOfBoundsException,
                                           MemoryTypeConflictException,
                                           UnsupportedRawMemoryRegionException
Create an instance of a class that implements RawShortReader and accesses memory of region in the address range described by base, stride, and count. The actual extent of the memory addressed by the object is (stride - 1) × size of short × count. The object is allocated in the current memory area of the calling thread.

Parameters:
base - The starting physical address accessible through the returned instance.
count - The number of memory elements accessible through the returned instance.
stride - The distance to the next element in mulitple of element size.
Returns:
an object that implements RawShortReader and supports access to the specified range in the memory region.
Throws:
IllegalArgumentException - when base is negative, or count is not greater than zero.
SecurityException - when the caller does not have permissions to access the given memory region or the specified range of addresses.
OffsetOutOfBoundsException - when base is invalid.
SizeOutOfBoundsException - when the memory addressed by the object would extend into an invalid range of memory.
MemoryTypeConflictException - when base does not point to memory that matches the type served by this factory.
UnsupportedRawMemoryRegionException
Since:
RTSJ 2.0

createRawShortWriter

public RawShortWriter createRawShortWriter(RawMemoryRegion region,
                                           long base,
                                           int count,
                                           int stride)
                                    throws SecurityException,
                                           OffsetOutOfBoundsException,
                                           SizeOutOfBoundsException,
                                           MemoryTypeConflictException,
                                           UnsupportedRawMemoryRegionException
Create an instance of a class that implements RawShortWriter and accesses memory of region in the address range described by base, stride, and count. The actual extent of the memory addressed by the object is (stride - 1) × size of short × count. The object is allocated in the current memory area of the calling thread.

Parameters:
base - The starting physical address accessible through the returned instance.
count - The number of memory elements accessible through the returned instance.
stride - The distance to the next element in mulitple of element size.
Returns:
an object that implements RawShortWriter and supports access to the specified range in the memory region.
Throws:
IllegalArgumentException - when base is negative, or count is not greater than zero.
SecurityException - when the caller does not have permissions to access the given memory region or the specified range of addresses.
OffsetOutOfBoundsException - when base is invalid.
SizeOutOfBoundsException - when the memory addressed by the object would extend into an invalid range of memory.
MemoryTypeConflictException - when base does not point to memory that matches the type served by this factory.
UnsupportedRawMemoryRegionException
Since:
RTSJ 2.0

createRawInt

public RawInt createRawInt(RawMemoryRegion region,
                           long base,
                           int count,
                           int stride)
                    throws SecurityException,
                           OffsetOutOfBoundsException,
                           SizeOutOfBoundsException,
                           MemoryTypeConflictException,
                           UnsupportedRawMemoryRegionException
Create an instance of a class that implements RawInt and accesses memory of region in the address range described by base, stride, and count. The actual extent of the memory addressed by the object is (stride - 1) × size of int × count. The object is allocated in the current memory area of the calling thread.

Parameters:
base - The starting physical address accessible through the returned instance.
count - The number of memory elements accessible through the returned instance.
stride - The distance to the next element in mulitple of element size.
Returns:
an object that implements RawInt and supports access to the specified range in the memory region.
Throws:
IllegalArgumentException - when base is negative, or count is not greater than zero.
SecurityException - when the caller does not have permissions to access the given memory region or the specified range of addresses.
OffsetOutOfBoundsException - when base is invalid.
SizeOutOfBoundsException - when the memory addressed by the object would extend into an invalid range of memory.
MemoryTypeConflictException - when base does not point to memory that matches the type served by this factory.
UnsupportedRawMemoryRegionException
Since:
RTSJ 2.0

createRawIntReader

public RawIntReader createRawIntReader(RawMemoryRegion region,
                                       long base,
                                       int count,
                                       int stride)
                                throws SecurityException,
                                       OffsetOutOfBoundsException,
                                       SizeOutOfBoundsException,
                                       MemoryTypeConflictException,
                                       UnsupportedRawMemoryRegionException
Create an instance of a class that implements RawIntReader and accesses memory of region in the address range described by base, stride, and count. The actual extent of the memory addressed by the object is (stride - 1) × size of int × count. The object is allocated in the current memory area of the calling thread.

Parameters:
base - The starting physical address accessible through the returned instance.
count - The number of memory elements accessible through the returned instance.
stride - The distance to the next element in mulitple of element size.
Returns:
an object that implements RawIntReader and supports access to the specified range in the memory region.
Throws:
IllegalArgumentException - when base is negative, or count is not greater than zero.
SecurityException - when the caller does not have permissions to access the given memory region or the specified range of addresses.
OffsetOutOfBoundsException - when base is invalid.
SizeOutOfBoundsException - when the memory addressed by the object would extend into an invalid range of memory.
MemoryTypeConflictException - when base does not point to memory that matches the type served by this factory.
UnsupportedRawMemoryRegionException
Since:
RTSJ 2.0

createRawIntWriter

public RawIntWriter createRawIntWriter(RawMemoryRegion region,
                                       long base,
                                       int count,
                                       int stride)
                                throws SecurityException,
                                       OffsetOutOfBoundsException,
                                       SizeOutOfBoundsException,
                                       MemoryTypeConflictException,
                                       UnsupportedRawMemoryRegionException
Create an instance of a class that implements RawIntWriter and accesses memory of region in the address range described by base, stride, and count. The actual extent of the memory addressed by the object is (stride - 1) × size of int × count. The object is allocated in the current memory area of the calling thread.

Parameters:
base - The starting physical address accessible through the returned instance.
count - The number of memory elements accessible through the returned instance.
stride - The distance to the next element in mulitple of element size.
Returns:
an object that implements RawIntWriter and supports access to the specified range in the memory region.
Throws:
IllegalArgumentException - when base is negative, or count is not greater than zero.
SecurityException - when the caller does not have permissions to access the given memory region or the specified range of addresses.
OffsetOutOfBoundsException - when base is invalid.
SizeOutOfBoundsException - when the memory addressed by the object would extend into an invalid range of memory.
MemoryTypeConflictException - when base does not point to memory that matches the type served by this factory.
UnsupportedRawMemoryRegionException
Since:
RTSJ 2.0

createRawLong

public RawLong createRawLong(RawMemoryRegion region,
                             long base,
                             int count,
                             int stride)
                      throws SecurityException,
                             OffsetOutOfBoundsException,
                             SizeOutOfBoundsException,
                             MemoryTypeConflictException,
                             UnsupportedRawMemoryRegionException
Create an instance of a class that implements RawLong and accesses memory of region in the address range described by base, stride, and count. The actual extent of the memory addressed by the object is (stride - 1) × size of long × count. The object is allocated in the current memory area of the calling thread.

Parameters:
base - The starting physical address accessible through the returned instance.
count - The number of memory elements accessible through the returned instance.
stride - The distance to the next element in mulitple of element size.
Returns:
an object that implements RawLong and supports access to the specified range in the memory region.
Throws:
IllegalArgumentException - when base is negative, or count is not greater than zero.
SecurityException - when the caller does not have permissions to access the given memory region or the specified range of addresses.
OffsetOutOfBoundsException - when base is invalid.
SizeOutOfBoundsException - when the memory addressed by the object would extend into an invalid range of memory.
MemoryTypeConflictException - when base does not point to memory that matches the type served by this factory.
UnsupportedRawMemoryRegionException
Since:
RTSJ 2.0

createRawLongReader

public RawLongReader createRawLongReader(RawMemoryRegion region,
                                         long base,
                                         int count,
                                         int stride)
                                  throws SecurityException,
                                         OffsetOutOfBoundsException,
                                         SizeOutOfBoundsException,
                                         MemoryTypeConflictException,
                                         UnsupportedRawMemoryRegionException
Create an instance of a class that implements RawLongReader and accesses memory of region in the address range described by base, stride, and count. The actual extent of the memory addressed by the object is (stride - 1) × size of long × count. The object is allocated in the current memory area of the calling thread.

Parameters:
base - The starting physical address accessible through the returned instance.
count - The number of memory elements accessible through the returned instance.
stride - The distance to the next element in mulitple of element size.
Returns:
an object that implements RawLongReader and supports access to the specified range in the memory region.
Throws:
IllegalArgumentException - when base is negative, or count is not greater than zero.
SecurityException - when the caller does not have permissions to access the given memory region or the specified range of addresses.
OffsetOutOfBoundsException - when base is invalid.
SizeOutOfBoundsException - when the memory addressed by the object would extend into an invalid range of memory.
MemoryTypeConflictException - when base does not point to memory that matches the type served by this factory.
UnsupportedRawMemoryRegionException
Since:
RTSJ 2.0

createRawLongWriter

public RawLongWriter createRawLongWriter(RawMemoryRegion region,
                                         long base,
                                         int count,
                                         int stride)
                                  throws SecurityException,
                                         OffsetOutOfBoundsException,
                                         SizeOutOfBoundsException,
                                         MemoryTypeConflictException,
                                         UnsupportedRawMemoryRegionException
Create an instance of a class that implements RawLongWriter and accesses memory of region in the address range described by base, stride, and count. The actual extent of the memory addressed by the object is (stride - 1) × size of long × count. The object is allocated in the current memory area of the calling thread.

Parameters:
base - The starting physical address accessible through the returned instance.
count - The number of memory elements accessible through the returned instance.
stride - The distance to the next element in mulitple of element size.
Returns:
an object that implements RawLongWriter and supports access to the specified range in the memory region.
Throws:
IllegalArgumentException - when base is negative, or count is not greater than zero.
SecurityException - when the caller does not have permissions to access the given memory region or the specified range of addresses.
OffsetOutOfBoundsException - when base is invalid.
SizeOutOfBoundsException - when the memory addressed by the object would extend into an invalid range of memory.
MemoryTypeConflictException - when base does not point to memory that matches the type served by this factory.
UnsupportedRawMemoryRegionException
Since:
RTSJ 2.0

createRawFloat

public RawFloat createRawFloat(RawMemoryRegion region,
                               long base,
                               int count,
                               int stride)
                        throws SecurityException,
                               OffsetOutOfBoundsException,
                               SizeOutOfBoundsException,
                               MemoryTypeConflictException,
                               UnsupportedRawMemoryRegionException
Create an instance of a class that implements RawFloat and accesses memory of region in the address range described by base, stride, and count. The actual extent of the memory addressed by the object is (stride - 1) × size of float × count. The object is allocated in the current memory area of the calling thread.

Parameters:
base - The starting physical address accessible through the returned instance.
count - The number of memory elements accessible through the returned instance.
stride - The distance to the next element in mulitple of element size.
Returns:
an object that implements RawFloat and supports access to the specified range in the memory region.
Throws:
IllegalArgumentException - when base is negative, or count is not greater than zero.
SecurityException - when the caller does not have permissions to access the given memory region or the specified range of addresses.
OffsetOutOfBoundsException - when base is invalid.
SizeOutOfBoundsException - when the memory addressed by the object would extend into an invalid range of memory.
MemoryTypeConflictException - when base does not point to memory that matches the type served by this factory.
UnsupportedRawMemoryRegionException
Since:
RTSJ 2.0

createRawFloatReader

public RawFloatReader createRawFloatReader(RawMemoryRegion region,
                                           long base,
                                           int count,
                                           int stride)
                                    throws SecurityException,
                                           OffsetOutOfBoundsException,
                                           SizeOutOfBoundsException,
                                           MemoryTypeConflictException,
                                           UnsupportedRawMemoryRegionException
Create an instance of a class that implements RawFloatReader and accesses memory of region in the address range described by base, stride, and count. The actual extent of the memory addressed by the object is (stride - 1) × size of float × count. The object is allocated in the current memory area of the calling thread.

Parameters:
base - The starting physical address accessible through the returned instance.
count - The number of memory elements accessible through the returned instance.
stride - The distance to the next element in mulitple of element size.
Returns:
an object that implements RawFloatReader and supports access to the specified range in the memory region.
Throws:
IllegalArgumentException - when base is negative, or count is not greater than zero.
SecurityException - when the caller does not have permissions to access the given memory region or the specified range of addresses.
OffsetOutOfBoundsException - when base is invalid.
SizeOutOfBoundsException - when the memory addressed by the object would extend into an invalid range of memory.
MemoryTypeConflictException - when base does not point to memory that matches the type served by this factory.
UnsupportedRawMemoryRegionException
Since:
RTSJ 2.0

createRawFloatWriter

public RawFloatWriter createRawFloatWriter(RawMemoryRegion region,
                                           long base,
                                           int count,
                                           int stride)
                                    throws SecurityException,
                                           OffsetOutOfBoundsException,
                                           SizeOutOfBoundsException,
                                           MemoryTypeConflictException,
                                           UnsupportedRawMemoryRegionException
Create an instance of a class that implements RawFloatWriter and accesses memory of region in the address range described by base, stride, and count. The actual extent of the memory addressed by the object is (stride - 1) × size of float × count. The object is allocated in the current memory area of the calling thread.

Parameters:
base - The starting physical address accessible through the returned instance.
count - The number of memory elements accessible through the returned instance.
stride - The distance to the next element in mulitple of element size.
Returns:
an object that implements RawFloatWriter and supports access to the specified range in the memory region.
Throws:
IllegalArgumentException - when base is negative, or count is not greater than zero.
SecurityException - when the caller does not have permissions to access the given memory region or the specified range of addresses.
OffsetOutOfBoundsException - when base is invalid.
SizeOutOfBoundsException - when the memory addressed by the object would extend into an invalid range of memory.
MemoryTypeConflictException - when base does not point to memory that matches the type served by this factory.
UnsupportedRawMemoryRegionException
Since:
RTSJ 2.0

createRawDouble

public RawDouble createRawDouble(RawMemoryRegion region,
                                 long base,
                                 int count,
                                 int stride)
                          throws SecurityException,
                                 OffsetOutOfBoundsException,
                                 SizeOutOfBoundsException,
                                 MemoryTypeConflictException,
                                 UnsupportedRawMemoryRegionException
Create an instance of a class that implements RawDouble and accesses memory of region in the address range described by base, stride, and count. The actual extent of the memory addressed by the object is (stride - 1) × size of double × count. The object is allocated in the current memory area of the calling thread.

Parameters:
base - The starting physical address accessible through the returned instance.
count - The number of memory elements accessible through the returned instance.
stride - The distance to the next element in mulitple of element size.
Returns:
an object that implements RawDouble and supports access to the specified range in the memory region.
Throws:
IllegalArgumentException - when base is negative, or count is not greater than zero.
SecurityException - when the caller does not have permissions to access the given memory region or the specified range of addresses.
OffsetOutOfBoundsException - when base is invalid.
SizeOutOfBoundsException - when the memory addressed by the object would extend into an invalid range of memory.
MemoryTypeConflictException - when base does not point to memory that matches the type served by this factory.
UnsupportedRawMemoryRegionException
Since:
RTSJ 2.0

createRawDoubleReader

public RawDoubleReader createRawDoubleReader(RawMemoryRegion region,
                                             long base,
                                             int count,
                                             int stride)
                                      throws SecurityException,
                                             OffsetOutOfBoundsException,
                                             SizeOutOfBoundsException,
                                             MemoryTypeConflictException,
                                             UnsupportedRawMemoryRegionException
Create an instance of a class that implements RawDoubleReader and accesses memory of region in the address range described by base, stride, and count. The actual extent of the memory addressed by the object is (stride - 1) × size of double × count. The object is allocated in the current memory area of the calling thread.

Parameters:
base - The starting physical address accessible through the returned instance.
count - The number of memory elements accessible through the returned instance.
stride - The distance to the next element in mulitple of element size.
Returns:
an object that implements RawDoubleReader and supports access to the specified range in the memory region.
Throws:
IllegalArgumentException - when base is negative, or count is not greater than zero.
SecurityException - when the caller does not have permissions to access the given memory region or the specified range of addresses.
OffsetOutOfBoundsException - when base is invalid.
SizeOutOfBoundsException - when the memory addressed by the object would extend into an invalid range of memory.
MemoryTypeConflictException - when base does not point to memory that matches the type served by this factory.
UnsupportedRawMemoryRegionException
Since:
RTSJ 2.0

createRawDoubleWriter

public RawDoubleWriter createRawDoubleWriter(RawMemoryRegion region,
                                             long base,
                                             int count,
                                             int stride)
                                      throws SecurityException,
                                             OffsetOutOfBoundsException,
                                             SizeOutOfBoundsException,
                                             MemoryTypeConflictException,
                                             UnsupportedRawMemoryRegionException
Create an instance of a class that implements RawDoubleWriter and accesses memory of region in the address range described by base, stride, and count. The actual extent of the memory addressed by the object is (stride - 1) × size of double × count. The object is allocated in the current memory area of the calling thread.

Parameters:
base - The starting physical address accessible through the returned instance.
count - The number of memory elements accessible through the returned instance.
stride - The distance to the next element in mulitple of element size.
Returns:
an object that implements RawDoubleWriter and supports access to the specified range in the memory region.
Throws:
IllegalArgumentException - when base is negative, or count is not greater than zero.
SecurityException - when the caller does not have permissions to access the given memory region or the specified range of addresses.
OffsetOutOfBoundsException - when base is invalid.
SizeOutOfBoundsException - when the memory addressed by the object would extend into an invalid range of memory.
MemoryTypeConflictException - when base does not point to memory that matches the type served by this factory.
UnsupportedRawMemoryRegionException
Since:
RTSJ 2.0

aicas logoJamaica 6.4 release 1

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