Package: com.multiversesocial.hyperview
Class: com.multiversesocial.hyperview.ViewMemory
Source: src/com/multiversesocial/hyperview/ViewMemory.java

ViewMemory

HyperView V3.2 — class
version V3.2 class

Summary

ViewMemory.class by Tony Swain May 18 2014. This class contains the code necessary for inter process View communication. Default is non alighned memory

Source file: ViewMemory.java

Hierarchy

Extends: InterProcessMemory

Implements: ViewMemoryConstants, MessagePortConstants, SharedMemoryListener, MemoryInitializer

Referenced HyperView classes

Media files used

Declaration & members

public class ViewMemory extends InterProcessMemory implements ViewMemoryConstants, MessagePortConstants, SharedMemoryListener, MemoryInitializer

Declared in src/com/multiversesocial/hyperview/ViewMemory.java, lines 17–585. 7 field(s), 1 constructor(s), 37 method(s). Every member has an anchor you can link to (e.g. ViewMemory.html#<id>).

Fields (7)

DeclarationValue / initializerDescriptionSource
volatile byte[] displayBufferNo comment in source; not referenced by name in this type’s methods.line 27
static volatile HyperLinkedList freedBlockList= new HyperLinkedList()No comment in source; not referenced by name in this type’s methods.line 21
volatile HyperView parentViewNo comment in source; used in toString(), updateViewData().line 26
static volatile int serverIDNo comment in source; not referenced by name in this type’s methods.line 25
static volatile HyperLinkedList viewList= new HyperLinkedList()No comment in source; used in getFreeViewBlock(); name appears in 2 other source file(s): AWTEventManager, HyperView.line 20
static ViewMemory viewMemoryBaseNo comment in source; assigned in ViewMemory(); used in toString().line 23
static volatile int viewMemoryFlagsNo comment in source; used in toString().line 24

Constructors (1)

SignatureDescriptionSource
ViewMemory(HyperView tView)10 statement(s); calls super(), InterProcessMemory.open(), System.exit(), setResident(), start().line 42

Methods (37)

SignatureDescriptionSource
static { … }Implicit default constructor generated by the compiler (not written in the source).implicit
public static ViewMemory addLocalView(HyperView tView)18 statement(s); calls ViewMemory.viewMemoryBase.lock(), ViewMemory.getFreeViewBlock(), tMappedByteBuffer.putInt(), tView.startServer(), tMappedByteBuffer.position() …; creates IllegalMemoryAccessException.line 257
public void addRemoteView(HyperView tView)1 statement(s).line 490
public void close(HyperView tView)1 statement(s); calls stop().line 77
public void erase()Better be even int boundry or cullabunga!
Overrides InterProcessMemory.erase()
line 125
public void flush()Cont ContDirtySetFullBlit / force mapped buffer to device.
Implements MessagePortConstants.flush()
line 570
public void getAtomicBlock(int[] tInt)1 statement(s); calls readInt().line 82
public static int getExternalViewNumber()3 statement(s); calls tViewMemory.readInt().line 165
public static int getFreeViewBlock()volatile static HyperLinkedList viewList = new HyperLinkedList(); //---line 351
String getHexFormat()Returns "".line 531
public static synchronized int getLocalViewNumber()4 statement(s); calls tViewMemory.readInt().line 179
public int getViewInfo(HyperView tView, int[] tInt)7 statement(s); calls lock(), tFileLock.release(), read().line 93
public void onMemoryChange(int tInt)SharedMemoryListener interface
Implements SharedMemoryListener.onMemoryChange()
line 200
public static ViewMemory open(HyperView tView)Returns new ViewMemory(tView).line 71
public void paint(Graphics tGraphics)1 statement(s); calls mappedByteBuffer.hasArray().line 472
public boolean passServerBase()Returns true.line 462
public static void removeLocalView(HyperView tView)8 statement(s); calls ViewMemory.viewMemoryBase.lock(), tMappedByteBuffer.getInt(), tMappedByteBuffer.putInt(), tView.stopServer(), tMemoryLock.release().line 380
public void removeRemoteView(HyperView tView)1 statement(s).line 496
public boolean resetServerBase()Returns true.line 457
public boolean serverBaseIsRunning()Returns true.line 447
public boolean setServerBase(HyperView tView)Returns true.line 452
public int signal(int tFlags, int tProcessID)Returns 1.line 467
public String toString()12 statement(s); calls stringBuilder.append(), stringBuilder.toString(); creates StringBuilder.
Overrides InterProcessMemory.toString()
line 503
public void updateViewData()Cont ContMemoryWindowRefresh analog: snapshot parent view into shared mem.line 537
public int write(byte tByte)Returns 1.
Overrides InterProcessMemory.write()
line 556
public int write(byte[] tByte)Returns 1.
Overrides InterProcessMemory.write()
line 557
public int write(char tChar)Returns 1.
Implements MessagePortConstants.write()
line 558
public int write(char[] tChar)Returns 1.
Implements MessagePortConstants.write()
line 559
public int write(int tInt)Returns 1.
Implements MessagePortConstants.write()
line 560
public int write(int[] tInt)Returns 1.
Implements MessagePortConstants.write()
line 561
public int writeDirect(byte tByte)Returns 1.
Overrides InterProcessMemory.writeDirect()
line 564
public int writeDirect(byte[] tByte)Returns 1.
Overrides InterProcessMemory.writeDirect()
line 565
public int writeDirect(char tChar)Returns 1.
Implements MessagePortConstants.writeDirect()
line 566
public int writeDirect(char[] tChar)Returns 1.
Implements MessagePortConstants.writeDirect()
line 567
public int writeDirect(int tInt)Returns 1.
Implements MessagePortConstants.writeDirect()
line 568
public int writeDirect(int[] tInt)Returns 1.
Implements MessagePortConstants.writeDirect()
line 569

Inherited members

Non-private members inherited from HyperView superclasses and not overridden or hidden here.

From InterProcessMemory (27 fields, 67 methods)

Fields: fieldList, file, fileChannel, fileName, fp0, fp1, graphics, indeces, index, innerParent, listenerList, listenerThread, mappedByteBuffer, memFlags, memName, memoryInitializer, memoryList, memoryMode, memoryTimer, memoryType, memSize, memSizeLong, processIndex, processNumber, startTime, totalProcesses, updateMillis

Methods: addListener(SharedMemoryListener), appendFieldList(HyperLinkedList), blockingLock(int, int), close(String), close(), disableBackupTimer(int), enableBackupTimer(int), exists(), getBitWidth(), isLoaded(), isResident(), listenerWait(), load(), loadMemoryList(), lock(), lock(int, int, int), lock(int), lockRegion(long, long), main(StringArr), notifyListeners(), open(InterProcessMemory), open(String), open(String, MemoryInitializer), open(String, int), open(String, int, MemoryInitializer), purge(), read(), read(intArr, int), read(byteArr, int, int), readDirect(), readDirect(intArr, int), readDirect(byteArr, int, int), readInt(), readInt(int), readInt(int, intArr), readIntDirect(int), readShort(), readShort(int), remakeFieldList(HyperLinkedList), removeListener(SharedMemoryListener), run(), saveToDevice(), seek(int), setBitWidth(byte), setDataAligned(), setDataUnAligned(), setFieldList(HyperLinkedList), setMemoryInitializer(MemoryInitializer), setResident(), setUpdateMillis(long), start(), stop(), unsetResident(), write(byteArr, int, int), write(String), write(String, int, int), writeDirect(byteArr, int, int), writeDirect(String), writeDirect(String, int, int), writeInt(int), writeInt(int, int), writeInt(int, intArr), writeIntDirect(int), writeIntDirect(int, int), writeRegion(byteArr, int, int), writeRegionDirect(byteArr, int, int), writeShort(int, short)

From Linkable (6 fields, 2 methods)

Fields: attachment, linkFlags, name, next, parentList, prev

Methods: inList(), setName(String)

Examples

Real usage taken from elsewhere in the HyperView 3.2 source (file and line shown; source path src/com/multiversesocial/hyperview/).

static call — HyperView.java, line 952

  952  viewMemory    =  ViewMemory.open((HyperView)this);
Hits--