Skip to content

Latest commit

 

History

History
26 lines (18 loc) · 757 Bytes

README.md

File metadata and controls

26 lines (18 loc) · 757 Bytes

ofxSharedMemory

Shared Memory addon for OpenFrameworks 0.11/0.12, using kyr0/libsharedmemory.

Usage

  • ofApp.h

    std::shared_ptr<lsm::SharedMemoryReadStream> reader;
    std::shared_ptr<lsm::SharedMemoryWriteStream> writer;
  • ofApp.cpp

    std::string dataToTransfer = "Hello World!";
        
    writer = std::make_shared<SharedMemoryWriteStream>("strPipe", 65535, false); // name, size, isPersistent
    writer->write(dataToTransfer);
    ofLogNotice() << "Data wrote: " << dataToTransfer;
    
    reader = std::make_shared<SharedMemoryReadStream>("strPipe", 65535, false);
    std::string data = reader->readString();
    ofLogNotice() << "Data read: " << data;