summaryrefslogtreecommitdiffstats
path: root/Kod/display/ClientServerApp/Common/ComConduit.h
blob: 3948355d52532c9ce7eb850959391393b99c0b0e (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
/*
 * ComConduit.h
 *
 * Declaration of the ComConduit class
 *
 *      Author: Erik Hellström, hellstrom@isy.liu.se, 2008-12-14
 *    Modified: Emil Larsson, lime@isy.liu.se, 2012-01-13
 */

#ifndef COMCONDUIT_H_
#define COMCONDUIT_H_

// Include conduit base class
#include "Conduit.h"
// Include ipc interface
#include "ipclink.h"

#include <stdio.h>
//
// The ComConduit class
//
class ComConduit : public Conduit {

public:

	// Construct & Destruct
	ComConduit();
	virtual ~ComConduit();

	// Server initialization
	bool StartServer(KeyType* key);
	// Client initialization
	bool StartClient(KeyType* key);
	// Detach and remove shared memory segment
	bool Shutdown();

	// Get shared data size
	int GetDataSize() const;
	// Get number of events
	int GetNumEvents() const;
	// Get pointer to common shared data
	CommonData* GetCommonData() const;

	// Write data
	bool SetData(const wchar_t* data);

	// Data read
	bool GetData(wchar_t* data);

private:

	// Pointer to shared data
	COMdata* ptrData;

};



#endif /* COMCONDUIT_H_ */