00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030 #ifndef WlmActivityManager_h
00031 #define WlmActivityManager_h
00032
00033 #include "dcmtk/config/osconfig.h"
00034 #include "dcmtk/ofstd/ofcmdln.h"
00035 #include "dcmtk/dcmdata/dcxfer.h"
00036 #include "dcmtk/dcmnet/dimse.h"
00037 #include "dcmtk/dcmwlm/wltypdef.h"
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
00230
00231
00232
00233
00234
00235
00236
00237
00238
00239
00240
00241
00242
00243
00244
00245
00246
00247
00248
00249
00250
00251
00252
00253
00254
00255
00256
00257
00258
00259
00260
00261
00262
00263
00264
00265
00266
00267
00268
00269
00270
00271
00272
00273
00274
00275
00276
00277
00278
00279
00280
00281
00282
00283
00284
00285
00286
00287
00288
00289
00290
00291
00292
00293
00294