File: pdata.hpp

package info (click to toggle)
conquest-dicom-server 1.4.17d-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 16,332 kB
  • ctags: 11,315
  • sloc: cpp: 56,176; ansic: 52,870; sh: 14,403; asm: 284; makefile: 282
file content (118 lines) | stat: -rw-r--r-- 3,451 bytes parent folder | download
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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
/****************************************************************************
          Copyright (C) 1995, University of California, Davis

          THIS SOFTWARE IS MADE AVAILABLE, AS IS, AND THE UNIVERSITY
          OF CALIFORNIA DOES NOT MAKE ANY WARRANTY ABOUT THE SOFTWARE, ITS
          PERFORMANCE, ITS MERCHANTABILITY OR FITNESS FOR ANY PARTICULAR
          USE, FREEDOM FROM ANY COMPUTER DISEASES OR ITS CONFORMITY TO ANY
          SPECIFICATION. THE ENTIRE RISK AS TO QUALITY AND PERFORMANCE OF
          THE SOFTWARE IS WITH THE USER.

          Copyright of the software and supporting documentation is
          owned by the University of California, and free access
          is hereby granted as a license to use this software, copy this
          software and prepare derivative works based upon this software.
          However, any distribution of this software source code or
          supporting documentation or derivative works (source code and
          supporting documentation) must include this copyright notice.
****************************************************************************/

/***************************************************************************
 *
 * University of California, Davis
 * UCDMC DICOM Network Transport Libraries
 * Version 0.1 Beta
 *
 * Technical Contact: mhoskin@ucdavis.edu
 *
 ***************************************************************************/

/****************************************************************************
 *
 * Abstract Base Class for P-DATA Service
 *
 *
 ****************************************************************************/

/*20100619    bcb Added no-copy to the classes and init list to LinkedBuffer.
  20100717    mvh Merged
*/

class	LinkedBuffer	:
	public	Buffer
	{
		Buffer	*LinkedTo;
	public:
#ifdef __GNUC__
			LinkedBuffer():LinkedTo(NULL) {};
#else
			LinkedBuffer()	{ LinkedTo = NULL; };
#endif
			~LinkedBuffer()	{ LinkedTo = NULL; };
		BOOL	Fill(Buffer	&Link, UINT	Count);
		BOOL	Flush(Buffer &Link, UINT	Count);
		UINT	GetOutgoingSize();
		UINT	GetIncomingSize();
		virtual	INT		ReadBinary(BYTE	*Data, UINT	Count);
		virtual	BOOL	SendBinary(BYTE *Data, UINT Count);
#ifdef __GNUC__
	private:// This will prevent it from being copied (it has a pointer)
		LinkedBuffer(const LinkedBuffer&);
		const	LinkedBuffer & operator = (const LinkedBuffer&);
#endif
	};

class	MemoryBuffer	:
	public	LinkedBuffer
	{
	private:
		BYTE		*Data;
		UINT		Length;
		UINT		Index;
		BOOL		DestructFlag;
	public:
		INT		ReadBinary(BYTE	*Data, UINT	Count);
		BOOL	SendBinary(BYTE *Data, UINT Count);
				MemoryBuffer ( BYTE *Data, UINT Length, BOOL Destruct,
								UINT Endian);
				~MemoryBuffer ();
#ifdef __GNUC__
	private:// This will prevent it from being copied (it has a pointer)
		MemoryBuffer(const MemoryBuffer&);
		const	MemoryBuffer & operator = (const MemoryBuffer&);
#endif
	};


class	PDV
	{
	public:
		UINT32	Length;
		BYTE	PresentationContextID;
		BYTE	MsgHeader;
	};

class	PDataTF
	{
	private:
		BYTE			ItemType;	// 0x04
		BYTE			Reserved1;
	public:
		UINT32			Length;
	public:
		LinkedBuffer	VRBuffer;

	public:
		INT		MsgStatus;
		UINT	Endian;
		PDV		pdv;
		BYTE	PresentationContextID;
		BYTE	MsgHeader;

		BOOL	ReadDynamic(Buffer	&Link);
		BOOL	Write(Buffer	&Link);

				PDataTF();
		virtual		~PDataTF();
	};