public class Cube extends Object implements Serializable
Modifier and Type | Class and Description |
---|---|
static class |
Cube.Slice
This class defines methods for manipulating shared memory cube slices.
|
Modifier and Type | Field and Description |
---|---|
static String |
ID
The id of a shared memory cube.
|
Constructor and Description |
---|
Cube(String id,
String pid,
String namespace)
Defines a shared memory cube.
|
Modifier and Type | Method and Description |
---|---|
static Cube |
alloc(long size)
Allocates a shared memory cube with the given size.
|
boolean |
equals(Object obj) |
static boolean |
exists(Cube cube)
Tests whether a cube exists.
|
static void |
free(Cube cube)
Frees the shared memory cube.
|
static Principal |
getOwner(Cube cube)
Returns the owner of a cube.
|
int |
hashCode() |
String |
id()
Returns the cube id.
|
static int |
index(long offset,
int unit)
Returns the cube index of the specified offset.
|
static ByteBuffer[] |
map(Cube cube)
Maps the shared memory cube identified to the address space of the calling process.
|
static Long |
size(Cube cube)
Returns the size of a cube (in bytes).
|
String |
toPath() |
String |
toString() |
public static final String ID
public String toPath()
public static Cube alloc(long size) throws FileNotFoundException, IOException
size
- The desired size of the cube.FileNotFoundException
IOException
public static void free(Cube cube)
cube
- The shared memory cube.public String id()
public static ByteBuffer[] map(Cube cube) throws FileNotFoundException, IOException
cube
- The shared memory cube.FileNotFoundException
IOException
public static boolean exists(Cube cube) throws IOException
cube
- The shared memory cube.IOException
public static Principal getOwner(Cube cube) throws IOException
cube
- The shared memory cube.IOException
public static Long size(Cube cube) throws IOException
cube
- The shared memory cube.IOException
public static int index(long offset, int unit)
offset
- The offset.unit
- The unit size.Copyright © 2018–2020 InAccel. All rights reserved.