OFFIS DCMTK  Version 3.6.0
dvpsmsg.h
1 /*
2  *
3  * Copyright (C) 1998-2010, OFFIS e.V.
4  * All rights reserved. See COPYRIGHT file for details.
5  *
6  * This software and supporting documentation were developed by
7  *
8  * OFFIS e.V.
9  * R&D Division Health
10  * Escherweg 2
11  * D-26121 Oldenburg, Germany
12  *
13  *
14  * Module: dcmpstat
15  *
16  * Author: Marco Eichelberg
17  *
18  * Purpose:
19  * classes: DVPSIPCMessage
20  *
21  * Last Update: $Author: joergr $
22  * Update Date: $Date: 2010-10-14 13:16:36 $
23  * CVS/RCS Revision: $Revision: 1.7 $
24  * Status: $State: Exp $
25  *
26  * CVS/RCS Log at end of file
27  *
28  */
29 
30 #ifndef DVPSMSG_H
31 #define DVPSMSG_H
32 
33 #include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */
34 #include "dcmtk/dcmdata/dctypes.h" /* for Uint32 */
35 #include "dcmtk/ofstd/ofstring.h" /* for class OFString */
36 
38 
43 {
44 public:
45 
48 
50  DVPSIPCMessage(const DVPSIPCMessage& copy);
51 
53  virtual ~DVPSIPCMessage();
54 
57 
61  void setMessageType(Uint32 msgtype) { messageType = msgtype; }
62 
66  Uint32 getMessageType() { return messageType; }
67 
71  void addStringToPayload(const char *str);
72 
76  void addIntToPayload(Uint32 i);
77 
84 
89  OFBool extractIntFromPayload(Uint32& i);
90 
93  void rewindPayload();
94 
97  void erasePayload();
98 
103  OFBool send(DcmTransportConnection &connection);
104 
111  OFBool receive(DcmTransportConnection &connection);
112 
113 
114  // constants for message type
115  static const Uint32 OK;
116  static const Uint32 requestApplicationID;
117  static const Uint32 assignApplicationID;
118  static const Uint32 applicationTerminates;
119  static const Uint32 receivedUnencryptedDICOMConnection;
120  static const Uint32 receivedEncryptedDICOMConnection;
121  static const Uint32 connectionClosed;
122  static const Uint32 connectionAborted;
123  static const Uint32 requestedUnencryptedDICOMConnection;
124  static const Uint32 requestedEncryptedDICOMConnection;
125  static const Uint32 receivedDICOMObject;
126  static const Uint32 sentDICOMObject;
127 
128  // message status constants
129  static const Uint32 statusOK; // OK
130  static const Uint32 statusWarning; // warning
131  static const Uint32 statusError; // error
132 
133  // client type constants
134  static const Uint32 clientOther; // client is of unspecified type
135  static const Uint32 clientStoreSCP; // client is Store SCP
136  static const Uint32 clientStoreSCU; // client is Store SCU
137  static const Uint32 clientPrintSCP; // client is Print SCP
138  static const Uint32 clientPrintSCU; // client is Print SCU
139  static const Uint32 clientQRSCP; // client is Query/Retrieve (Find/Move/Get) SCP
140 
141 private:
142 
146  void resizePayload(Uint32 i);
147 
149  Uint32 messageType;
150 
152  Uint32 payloadUsed;
153 
156 
159 
161  unsigned char *payload;
162 };
163 
164 
169 {
170 public:
171 
179  DVPSIPCClient(Uint32 clientType, const char *txt, int thePort, OFBool keepOpen);
180 
182  virtual ~DVPSIPCClient();
183 
187  void notifyApplicationTerminates(Uint32 status);
188 
193  void notifyReceivedUnencryptedDICOMConnection(Uint32 status, const char *txt);
194 
199  void notifyReceivedEncryptedDICOMConnection(Uint32 status, const char *txt);
200 
204  void notifyConnectionClosed(Uint32 status);
205 
210  void notifyConnectionAborted(Uint32 status, const char *txt);
211 
216  void notifyRequestedUnencryptedDICOMConnection(Uint32 status, const char *txt);
217 
222  void notifyRequestedEncryptedDICOMConnection(Uint32 status, const char *txt);
223 
228  void notifyReceivedDICOMObject(Uint32 status, const char *txt);
229 
234  void notifySentDICOMObject(Uint32 status, const char *txt);
235 
240  OFBool isServerActive() { return serverActive; }
241 
242 private:
243 
245  DVPSIPCClient(const DVPSIPCClient& copy);
246 
249 
252  void requestConnection();
253 
260  OFBool performTransaction(DVPSIPCMessage& msg);
261 
263  int port;
264 
266  OFBool serverActive;
267 
270 
273 
276 };
277 
278 
279 #endif
280 
281 /*
282  * $Log: dvpsmsg.h,v $
283  * Revision 1.7 2010-10-14 13:16:36 joergr
284  * Updated copyright header. Added reference to COPYRIGHT file.
285  *
286  * Revision 1.6 2010-10-07 14:31:36 joergr
287  * Removed leading underscore characters from preprocessor symbols (reserved).
288  *
289  * Revision 1.5 2005/12/08 16:03:52 meichel
290  * Changed include path schema for all DCMTK header files
291  *
292  * Revision 1.4 2003/07/04 13:27:38 meichel
293  * Replaced forward declarations for OFString with explicit includes,
294  * needed when compiling with HAVE_STD_STRING
295  *
296  * Revision 1.3 2001/06/01 15:50:18 meichel
297  * Updated copyright header
298  *
299  * Revision 1.2 2000/11/08 18:38:15 meichel
300  * Updated dcmpstat IPC protocol for additional message parameters
301  *
302  * Revision 1.1 2000/10/10 12:24:36 meichel
303  * Added extensions for IPC message communication
304  *
305  *
306  */


Generated on Thu Dec 20 2012 for OFFIS DCMTK Version 3.6.0 by Doxygen 1.8.2