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#include <sys/types.h>
34
35namespace DBus
36{
37
39{
40public:
47 void write(const void *buffer, unsigned int nbytes);
48
49 ssize_t read(void *buffer, unsigned int &nbytes);
50
55 void signal();
56
57private:
58 void(*_handler)(const void *data, void *buffer, unsigned int nbyte);
61 const void *_data;
62
63 // allow construction only in BusDispatcher
64 Pipe(void(*handler)(const void *data, void *buffer, unsigned int nbyte), const void *data);
65 ~Pipe() {};
66
67 friend class BusDispatcher;
68};
69
70} /* namespace DBus */
71
72#endif // DBUSXX_PIPE_H
#define DXXAPI
Definition api.h:36
Pipe(void(*handler)(const void *data, void *buffer, unsigned int nbyte), const void *data)
Definition pipe.cpp:43
void write(const void *buffer, unsigned int nbytes)
Definition pipe.cpp:63
void signal()
Definition pipe.cpp:83
int _fd_write
Definition pipe.h:59
ssize_t read(void *buffer, unsigned int &nbytes)
Definition pipe.cpp:73
~Pipe()
Definition pipe.h:65
int _fd_read
Definition pipe.h:60
friend class BusDispatcher
Definition pipe.h:67
void(* _handler)(const void *data, void *buffer, unsigned int nbyte)
Definition pipe.h:58
const void * _data
Definition pipe.h:61