# DBus-C++

## Desktop Communication Bus System

libdbus-c-- Documentation 0.9.0

- Files
- Data Structures
- Globals
- Main Page

pipe.h
Go to the documentation of this file.
1/*
2 *
3 * D-Bus++ - C++ bindings for D-Bus
4 *
5 * Copyright (C) 2005-2007 Paolo Durante <shackan@gmail.com>
6 *
7 *
8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Lesser General Public
10 * License as published by the Free Software Foundation; either
11 * version 2.1 of the License, or (at your option) any later version.
12 *
13 * This library is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * Lesser General Public License for more details.
17 *
18 * You should have received a copy of the GNU Lesser General Public
19 * License along with this library; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21 *
22 */
23
24#ifndef DBUSXX_PIPE_H
25#define DBUSXX_PIPE_H
26
27/* Project */
28#include "api.h"
29
30/* STD */
31#include <cstdlib>
32
33 namespace DBus
34{
35
36 class DXXAPI Pipe
37{
38 public:
45 void write(const void *buffer, unsigned int nbytes);
46
47 ssize_t read(void *buffer, unsigned int &nbytes);
48
53 void signal();
54
55 private:
56 void(*_handler)(const void *data, void *buffer, unsigned int nbyte);
57 int _fd_write;
58 int _fd_read;
59 const void *_data;
60
61 // allow construction only in BusDispatcher
62 Pipe(void(*handler)(const void *data, void *buffer, unsigned int nbyte), const void *data);
63 ~Pipe() {};
64
65 friend class BusDispatcher;
66};
67
68} /* namespace DBus */
69
70#endif // DBUSXX_PIPE_H
api.h
DXXAPI
#define DXXAPI
Definition api.h:36
DBus::Pipe::Pipe
Pipe(void(*handler)(const void *data, void *buffer, unsigned int nbyte), const void *data)
Definition pipe.cpp:43
DBus::Pipe::write
void write(const void *buffer, unsigned int nbytes)
Definition pipe.cpp:63
DBus::Pipe::signal
void signal()
Definition pipe.cpp:83
DBus::Pipe::_fd_write
int _fd_write
Definition pipe.h:57
DBus::Pipe::read
ssize_t read(void *buffer, unsigned int &nbytes)
Definition pipe.cpp:73
DBus::Pipe::~Pipe
~Pipe()
Definition pipe.h:63
DBus::Pipe::_fd_read
int _fd_read
Definition pipe.h:58
DBus::Pipe::BusDispatcher
friend class BusDispatcher
Definition pipe.h:65
DBus::Pipe::_handler
void(* _handler)(const void *data, void *buffer, unsigned int nbyte)
Definition pipe.h:56
DBus::Pipe::_data
const void * _data
Definition pipe.h:59
DBus
Definition connection_p.h:42