JUCE-7.0.12-0-g4f43011b96 JUCE-7.0.12-0-g4f43011b96
JUCE — C++ application framework with suport for VST, VST3, LV2 audio plug-ins

« « « Anklang Documentation
Loading...
Searching...
No Matches
Classes | Public Member Functions | List of all members
juce::NamedPipe Class Referencefinal

A cross-process pipe that can have data written to and read from it. More...

#include "juce_NamedPipe.h"

Classes

class  Pimpl
 

Public Member Functions

 NamedPipe ()
 Creates a NamedPipe.
 
 ~NamedPipe ()
 Destructor.
 
bool openExisting (const String &pipeName)
 Tries to open a pipe that already exists.
 
bool createNewPipe (const String &pipeName, bool mustNotExist=false)
 Tries to create a new pipe.
 
void close ()
 Closes the pipe, if it's open.
 
bool isOpen () const
 True if the pipe is currently open.
 
String getName () const
 Returns the last name that was used to try to open this pipe.
 
int read (void *destBuffer, int maxBytesToRead, int timeOutMilliseconds)
 Reads data from the pipe.
 
int write (const void *sourceBuffer, int numBytesToWrite, int timeOutMilliseconds)
 Writes some data to the pipe.
 

Detailed Description

A cross-process pipe that can have data written to and read from it.

Two processes can use NamedPipe objects to exchange blocks of data.

See also
InterprocessConnection

@tags{Core}

Definition at line 36 of file juce_NamedPipe.h.

Constructor & Destructor Documentation

◆ NamedPipe()

juce::NamedPipe::NamedPipe ( )

Creates a NamedPipe.

Definition at line 28 of file juce_NamedPipe.cpp.

◆ ~NamedPipe()

juce::NamedPipe::~NamedPipe ( )

Destructor.

Definition at line 30 of file juce_NamedPipe.cpp.

Member Function Documentation

◆ close()

void juce::NamedPipe::close ( )

Closes the pipe, if it's open.

Definition at line 247 of file juce_NamedPipe_posix.cpp.

◆ createNewPipe()

bool juce::NamedPipe::createNewPipe ( const String pipeName,
bool  mustNotExist = false 
)

Tries to create a new pipe.

Returns true if it succeeds. If mustNotExist is true then it will fail if a pipe is already open with the same name.

Definition at line 50 of file juce_NamedPipe.cpp.

◆ getName()

String juce::NamedPipe::getName ( ) const

Returns the last name that was used to try to open this pipe.

Definition at line 59 of file juce_NamedPipe.cpp.

◆ isOpen()

bool juce::NamedPipe::isOpen ( ) const

True if the pipe is currently open.

Definition at line 44 of file juce_NamedPipe.cpp.

◆ openExisting()

bool juce::NamedPipe::openExisting ( const String pipeName)

Tries to open a pipe that already exists.

Returns true if it succeeds.

Definition at line 35 of file juce_NamedPipe.cpp.

◆ read()

int juce::NamedPipe::read ( void destBuffer,
int  maxBytesToRead,
int  timeOutMilliseconds 
)

Reads data from the pipe.

This will block until another thread has written enough data into the pipe to fill the number of bytes specified, or until another thread calls the cancelPendingReads() method.

If the operation fails, it returns -1, otherwise, it will return the number of bytes read.

If timeOutMilliseconds is less than zero, it will wait indefinitely, otherwise this is a maximum timeout for reading from the pipe.

Definition at line 296 of file juce_NamedPipe_posix.cpp.

◆ write()

int juce::NamedPipe::write ( const void sourceBuffer,
int  numBytesToWrite,
int  timeOutMilliseconds 
)

Writes some data to the pipe.

Returns
the number of bytes written, or -1 on failure.

Definition at line 302 of file juce_NamedPipe_posix.cpp.


The documentation for this class was generated from the following files: