edelib 2.1.0

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- File List

Sipc.h
1 /*
2 * $Id: Sipc.h 3441 2012-11-01 20:40:30Z karijes $
3 *
4 * A very simple IPC
5 * Copyright (c) 2008 edelib authors
6 *
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2 of the License, or (at your option) any later version.
11 *
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
16 *
17 * You should have received a copy of the GNU Lesser General Public License
18 * along with this library. If not, see <http://www.gnu.org/licenses/>.
19 */
20
21 #ifndef __EDELIB_SIPC_H__
22 #define __EDELIB_SIPC_H__
23
24 #include "edelib-global.h"
25
26 EDELIB_NS_BEGIN
27
28 #ifndef SKIP_DOCS
29 struct SipcServerPrivate;
30 struct SipcClientPrivate;
31 #endif
32
33
37 typedef void (*SipcCallback)(const char*, void*);
38
83 class EDELIB_API SipcServer {
84 private:
85 SipcServerPrivate* priv;
86 E_DISABLE_CLASS_COPY(SipcServer)
87 public:
91 SipcServer();
92
96 ~SipcServer();
97
105 bool request_name(const char* prefix);
106
113 void callback(SipcCallback cb, void* data);
114 };
115
133 class EDELIB_API SipcClient {
134 private:
135 SipcClientPrivate* priv;
136 E_DISABLE_CLASS_COPY(SipcClient)
137 public:
141 SipcClient();
142
146 ~SipcClient();
147
154 bool connect(const char* prefix);
155
161 void send(const char* msg);
162 };
163
164 EDELIB_NS_END
165 #endif
edelib::SipcServer
Simple IPC server.
Definition: Sipc.h:83
E_DISABLE_CLASS_COPY
#define E_DISABLE_CLASS_COPY(klass)
Definition: edelib-global.h:161
edelib::SipcCallback
void(* SipcCallback)(const char *, void *)
Definition: Sipc.h:37
edelib::SipcClient
Simple IPC client.
Definition: Sipc.h:133