# DBus-C++

## Desktop Communication Bus System

libdbus-c-- Documentation 0.9.0

- Files
- Data Structures
- Globals
- Main Page

Public Member Functions | Private Member Functions | Private Attributes | Friends | List of all members
DBus::Pipe Class Reference

`#include <pipe.h>`

## Public Member Functions

void | write (const void *buffer, unsigned int nbytes)
ssize_t | read (void *buffer, unsigned int &nbytes)
void | signal ()

## Private Member Functions

| Pipe (void(*handler)(const void *data, void *buffer, unsigned int nbyte), const void *data)
| ~Pipe ()

## Private Attributes

void(* | _handler )(const void *data, void *buffer, unsigned int nbyte)
int | _fd_write
int | _fd_read
const void * | _data

## Friends

class | BusDispatcher

## Detailed Description

Definition at line 36 of file pipe.h.

## Constructor & Destructor Documentation

## ◆ Pipe()

Pipe::Pipe | ( | void(* | handler )(const void *data, void *buffer, unsigned int nbyte),
|  | const void * | data )

private

Definition at line 43 of file pipe.cpp.

References _data, _fd_read, _fd_write, _handler, and DBus::toString().

## ◆ ~Pipe()

DBus::Pipe::~Pipe | ( |  | ) |

inline private

Definition at line 63 of file pipe.h.

## Member Function Documentation

## ◆ read()

ssize_t Pipe::read | ( | void * | buffer,
|  | unsigned int & | nbytes )

Definition at line 73 of file pipe.cpp.

References _fd_read, and read().

Referenced by DBus::BusDispatcher::enter(), and read().

## ◆ signal()

void Pipe::signal | ( |  | ) |

Simply write one single byte into the pipe. This is a shortcut if there's really no data to transport, but to activate the handler.

Definition at line 83 of file pipe.cpp.

References _fd_write, and write().

## ◆ write()

void Pipe::write | ( | const void * | buffer,
|  | unsigned int | nbytes )

Write some data into the communication pipe.

Parameters

  buffer | The raw data to write.
  nbytes | The number of bytes to write from the buffer.

Definition at line 63 of file pipe.cpp.

References _fd_write, and write().

Referenced by signal(), and write().

## Friends And Related Symbol Documentation

## ◆ BusDispatcher

friend class BusDispatcher

friend

Definition at line 65 of file pipe.h.

References BusDispatcher.

Referenced by BusDispatcher.

## Member Data Documentation

## ◆ _data

const void* DBus::Pipe::_data

private

Definition at line 59 of file pipe.h.

Referenced by DBus::BusDispatcher::enter(), and Pipe().

## ◆ _fd_read

int DBus::Pipe::_fd_read

private

Definition at line 58 of file pipe.h.

Referenced by Pipe(), and read().

## ◆ _fd_write

int DBus::Pipe::_fd_write

private

Definition at line 57 of file pipe.h.

Referenced by Pipe(), signal(), and write().

## ◆ _handler

void(* DBus::Pipe::_handler) (const void *data, void *buffer, unsigned int nbyte)

private

Definition at line 56 of file pipe.h.

Referenced by DBus::BusDispatcher::enter(), and Pipe().

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

- pipe.h
- pipe.cpp