00001 /* 00002 * 00003 * Copyright (C) 1996-2010, OFFIS e.V. 00004 * All rights reserved. See COPYRIGHT file for details. 00005 * 00006 * This software and supporting documentation were developed by 00007 * 00008 * OFFIS e.V. 00009 * R&D Division Health 00010 * Escherweg 2 00011 * D-26121 Oldenburg, Germany 00012 * 00013 * 00014 * Module: dcmwlm 00015 * 00016 * Author: Thomas Wilkens 00017 * 00018 * Purpose: Activity manager class for basic worklist management service 00019 * class provider engines. 00020 * 00021 * Last Update: $Author: joergr $ 00022 * Update Date: $Date: 2010-10-14 13:16:39 $ 00023 * CVS/RCS Revision: $Revision: 1.18 $ 00024 * Status: $State: Exp $ 00025 * 00026 * CVS/RCS Log at end of file 00027 * 00028 */ 00029 00030 #ifndef WlmActivityManager_h 00031 #define WlmActivityManager_h 00032 00033 #include "dcmtk/config/osconfig.h" 00034 #include "dcmtk/ofstd/ofcmdln.h" /* for OFCmdUnsignedInt */ 00035 #include "dcmtk/dcmdata/dcxfer.h" /* for E_TransferSyntax */ 00036 #include "dcmtk/dcmnet/dimse.h" /* for T_DIMSE_BlockingMode */ 00037 #include "dcmtk/dcmwlm/wltypdef.h" /* for WlmRefuseReasonType */ 00038 00039 class WlmDataSource; 00040 class OFCondition; 00041 class OFConsole; 00042 00046 class WlmActivityManager 00047 { 00048 protected: 00050 WlmDataSource *dataSource; 00052 OFCmdUnsignedInt opt_port; 00054 OFBool opt_refuseAssociation; 00056 OFBool opt_rejectWithoutImplementationUID; 00058 OFCmdUnsignedInt opt_sleepAfterFind; 00060 OFCmdUnsignedInt opt_sleepDuringFind; 00062 OFCmdUnsignedInt opt_maxPDU; 00064 E_TransferSyntax opt_networkTransferSyntax; 00066 OFBool opt_failInvalidQuery; 00068 OFBool opt_singleProcess; 00071 OFBool opt_forkedChild; 00073 int cmd_argc; 00075 char **cmd_argv; 00077 int opt_maxAssociations; 00079 T_DIMSE_BlockingMode opt_blockMode; 00081 int opt_dimse_timeout; 00083 int opt_acse_timeout; 00085 char **supportedAbstractSyntaxes; 00087 int numberOfSupportedAbstractSyntaxes; 00089 OFList<WlmProcessSlotType*> processTable; 00090 00096 OFCondition WaitForAssociation( T_ASC_Network *net ); 00097 00102 void CleanChildren(); 00103 00108 OFCondition NegotiateAssociation( T_ASC_Association *assoc ); 00109 00114 void AddProcessToTable( int pid, T_ASC_Association *assoc ); 00115 00120 void RemoveProcessFromTable( int pid ); 00121 00126 void RefuseAssociation( T_ASC_Association **assoc, WlmRefuseReasonType reason ); 00127 00132 void HandleAssociation( T_ASC_Association *assoc ); 00133 00141 OFCondition ReceiveAndHandleCommands( T_ASC_Association *assoc ); 00142 00151 OFCondition HandleEchoSCP( T_ASC_Association *assoc, T_DIMSE_C_EchoRQ *req, T_ASC_PresentationContextID presId ); 00152 00161 OFCondition HandleFindSCP( T_ASC_Association *assoc, T_DIMSE_C_FindRQ *request, T_ASC_PresentationContextID presID ); 00162 00166 WlmActivityManager( const WlmActivityManager &Src ); 00167 00172 WlmActivityManager &operator=( const WlmActivityManager &Src ); 00173 00174 00175 public: 00195 WlmActivityManager( 00196 WlmDataSource *dataSourcev, 00197 OFCmdUnsignedInt opt_portv, 00198 OFBool opt_refuseAssociationv, 00199 OFBool opt_rejectWithoutImplementationUIDv, 00200 OFCmdUnsignedInt opt_sleepAfterFindv, 00201 OFCmdUnsignedInt opt_sleepDuringFindv, 00202 OFCmdUnsignedInt opt_maxPDUv, 00203 E_TransferSyntax opt_networkTransferSyntaxv, 00204 OFBool opt_failInvalidQueryv, 00205 OFBool opt_singleProcessv, 00206 int opt_maxAssociationsv, 00207 T_DIMSE_BlockingMode opt_blockModev, 00208 int opt_dimse_timeoutv, 00209 int opt_acse_timeoutv, 00210 OFBool opt_forkedChild = OFFalse, 00211 int argcv = 0, 00212 char *argvv[] = NULL ); 00213 00216 ~WlmActivityManager(); 00217 00223 OFCondition StartProvidingService(); 00224 }; 00225 00226 #endif 00227 00228 /* 00229 ** CVS Log 00230 ** $Log: wlmactmg.h,v $ 00231 ** Revision 1.18 2010-10-14 13:16:39 joergr 00232 ** Updated copyright header. Added reference to COPYRIGHT file. 00233 ** 00234 ** Revision 1.17 2009-11-24 10:40:01 uli 00235 ** Switched to logging mechanism provided by the "new" oflog module. 00236 ** 00237 ** Revision 1.16 2009-09-30 08:40:34 uli 00238 ** Make dcmwlm's include headers self-sufficient by including all 00239 ** needed headers directly. 00240 ** 00241 ** Revision 1.15 2006-12-15 14:49:21 onken 00242 ** Removed excessive use char* and C-array in favour of OFString and 00243 ** OFList. Simplified some implementation details. 00244 ** 00245 ** Revision 1.14 2006/08/14 15:30:58 onken 00246 ** Added WIN32 multiprocess mode to wlmscpfs. 00247 ** 00248 ** Revision 1.13 2005/12/08 16:05:43 meichel 00249 ** Changed include path schema for all DCMTK header files 00250 ** 00251 ** Revision 1.12 2005/11/17 13:45:39 meichel 00252 ** Added command line options for DIMSE and ACSE timeouts 00253 ** 00254 ** Revision 1.11 2003/07/02 09:17:55 wilkens 00255 ** Updated documentation to get rid of doxygen warnings. 00256 ** 00257 ** Revision 1.10 2002/12/16 11:08:36 wilkens 00258 ** Added missing #include "osconfig.h" to certain files. 00259 ** 00260 ** Revision 1.9 2002/12/12 16:48:35 wilkens 00261 ** Added some code to avoid compiler warning (unreachable code) on Sun CC 2.0.1. 00262 ** 00263 ** Revision 1.8 2002/08/05 09:09:59 wilkens 00264 ** Modfified the project's structure in order to be able to create a new 00265 ** application which contains both wlmscpdb and ppsscpdb. 00266 ** 00267 ** Revision 1.7 2002/07/17 13:10:37 wilkens 00268 ** Corrected some minor logical errors in the wlmscpdb sources and completely 00269 ** updated the wlmscpfs so that it does not use the original wlistctn sources 00270 ** any more but standard wlm sources which are now used by all three variants 00271 ** of wlmscps. 00272 ** 00273 ** Revision 1.6 2002/06/10 11:25:06 wilkens 00274 ** Made some corrections to keep gcc 2.95.3 quiet. 00275 ** 00276 ** Revision 1.5 2002/04/18 14:20:09 wilkens 00277 ** Modified Makefiles. Updated latest changes again. These are the latest 00278 ** sources. Added configure file. 00279 ** 00280 ** Revision 1.4 2002/01/08 19:10:04 joergr 00281 ** Minor adaptations to keep the gcc compiler on Linux and Solaris happy. 00282 ** Currently only the "file version" of the worklist SCP is supported on 00283 ** Unix systems. 00284 ** 00285 ** Revision 1.3 2002/01/08 17:45:34 joergr 00286 ** Reformatted source files (replaced Windows newlines by Unix ones, replaced 00287 ** tabulator characters by spaces, etc.) 00288 ** 00289 ** Revision 1.2 2002/01/08 17:35:39 joergr 00290 ** Reworked database support after trials at the hospital (modfied by MC/JR on 00291 ** 2002-01-08). 00292 ** 00293 ** 00294 */