Loading...
Searching...
No Matches
DVPSPrintMessageHandler Class Reference

representation of an association used for DICOM Basic Grayscale Print. More...

## Public Member Functions

| DVPSPrintMessageHandler ()
| default constructor
virtual | ~DVPSPrintMessageHandler ()
| destructor
OFCondition | createRQ (const char *sopclassUID, OFString &sopinstanceUID, DcmDataset *attributeListIn, Uint16 &status, DcmDataset *&attributeListOut)
| sends an N-CREATE-RQ message and receives response.
OFCondition | setRQ (const char *sopclassUID, const char *sopinstanceUID, DcmDataset *modificationList, Uint16 &status, DcmDataset *&attributeListOut)
| sends an N-SET-RQ message and receives response.
OFCondition | getRQ (const char *sopclassUID, const char *sopinstanceUID, const Uint16 *attributeIdentifierList, size_t numShorts, Uint16 &status, DcmDataset *&attributeListOut)
| sends an N-GET-RQ message and receives response.
OFCondition | actionRQ (const char *sopclassUID, const char *sopinstanceUID, Uint16 actionTypeID, DcmDataset *actionInformation, Uint16 &status, DcmDataset *&actionReply)
| sends an N-ACTION-RQ message and receives response.
OFCondition | deleteRQ (const char *sopclassUID, const char *sopinstanceUID, Uint16 &status)
| sends an N-DELETE-RQ message and receives response.
OFCondition | negotiateAssociation (DcmTransportLayer *tlayer, const char *myAEtitle, const char *peerAEtitle, const char *peerHost, int peerPort, T_ASC_ProtocolFamily protocolFamily, long peerMaxPDU, OFBool negotiatePresentationLUT, OFBool negotiateAnnotationBox, OFBool implicitOnly)
| opens a DICOM association to a remote printer.
OFCondition | releaseAssociation ()
| releases the current association.
OFCondition | abortAssociation ()
| aborts the current association.
void | setEventHandler (DVPSPrintEventHandler *handler)
| registers an event handler object for incoming N-EVENT-REPORTs.
void | setTimeout (T_DIMSE_BlockingMode blocking, int timeOut)
| sets the blocking and timeout mode for receive operations.
OFBool | printerSupportsPresentationLUT ()
| checks if the remote printer supports the Presentation LUT SOP class.
OFBool | printerSupportsAnnotationBox ()
| checks if the remote printer supports the Basic Annotation Box SOP class.

## Private Member Functions

| DVPSPrintMessageHandler (const DVPSPrintMessageHandler &copy)
| private undefined copy constructor
DVPSPrintMessageHandler & | operator= (const DVPSPrintMessageHandler &copy)
| private undefined assignment operator
OFCondition | sendNRequest (T_ASC_PresentationContextID presId, T_DIMSE_Message &request, DcmDataset *rqDataSet, T_DIMSE_Message &response, DcmDataset *&statusDetail, DcmDataset *&rspDataset)
| sends a DIMSE-N request (any type except N-EVENT-REPORT) and waits for a response.
T_ASC_PresentationContextID | findAcceptedPC (const char *sopclassuid)
| looks for an accepted presentation context for the given SOP class.
void | dumpNMessage (T_DIMSE_Message &msg, DcmItem *dataset, OFBool outgoing)
| dumps the given message to the dump stream if it exists.

## Private Attributes

T_ASC_Association * | assoc
| the association to be used for message communication. Can be NULL.
T_ASC_Network * | net
| the network used for establishing associations. Can be NULL.
DVPSPrintEventHandler * | eventHandler
| the current event handler. Can be NULL.
T_DIMSE_BlockingMode | blockMode
| blocking mode for receive
int | timeout
| timeout for receive

## Detailed Description

representation of an association used for DICOM Basic Grayscale Print.

## Member Function Documentation

## abortAssociation()

OFCondition DVPSPrintMessageHandler::abortAssociation | ( |  | ) |

aborts the current association.

Returns
  a status code that can be checked with the SUCCESS() macro.

## actionRQ()

OFCondition DVPSPrintMessageHandler::actionRQ | ( | const char * | sopclassUID,
|  | const char * | sopinstanceUID,
|  | Uint16 | actionTypeID,
|  | DcmDataset * | actionInformation,
|  | Uint16 & | status,
|  | DcmDataset *& | actionReply )

sends an N-ACTION-RQ message and receives response.

Any event report requests incoming before the expected response message are handled.

Parameters

  sopclassUID | the requested SOP class UID, must be one of the supported print classes.
  sopinstanceUID | the requested SOP instance UID
  actionTypeID | the action type ID
  actionInformation | the action information dataset, may be NULL.
  status | the response message status code is passed back in this parameter if the method returns with success status. Content is undefined otherwise.
  actionReply | a pointer to the action reply dataset returned by the SCP is passed back in this parameter if the method returns with success status. Content is undefined otherwise. May return NULL if the SCP has not returned an attribute list. If a DICOM dataset is returned, it must be deleted by the caller.

Returns
  DIMSE_NORMAL if successful (e.g. no protocol failure), an error code otherwise.

## createRQ()

OFCondition DVPSPrintMessageHandler::createRQ | ( | const char * | sopclassUID,
|  | OFString & | sopinstanceUID,
|  | DcmDataset * | attributeListIn,
|  | Uint16 & | status,
|  | DcmDataset *& | attributeListOut )

sends an N-CREATE-RQ message and receives response.

Any event report requests incoming before the expected response message are handled.

Parameters

  sopclassUID | the affected SOP class UID, must be one of the supported print classes.
  sopinstanceUID | the affected SOP instance UID. May be empty in which case the UID is assigned by the SCP and returned in this parameter.
  attributeListIn | the attribute list dataset, may be NULL.
  status | the response message status code is passed back in this parameter if the method returns with success status. Content is undefined otherwise.
  attributeListOut | a pointer to the attribute list returned by the SCP is passed back in this parameter if the method returns with success status. Content is undefined otherwise. May return NULL if the SCP has not returned an attribute list. If a DICOM dataset is returned, it must be deleted by the caller.

Returns
  DIMSE_NORMAL if successful (e.g. no protocol failure), an error code otherwise.

## deleteRQ()

OFCondition DVPSPrintMessageHandler::deleteRQ | ( | const char * | sopclassUID,
|  | const char * | sopinstanceUID,
|  | Uint16 & | status )

sends an N-DELETE-RQ message and receives response.

Any event report requests incoming before the expected response message are handled.

Parameters

  sopclassUID | the requested SOP class UID, must be one of the supported print classes.
  sopinstanceUID | the requested SOP instance UID
  status | the response message status code is passed back in this parameter if the method returns with success status. Content is undefined otherwise.

Returns
  DIMSE_NORMAL if successful (e.g. no protocol failure), an error code otherwise.

## dumpNMessage()

void DVPSPrintMessageHandler::dumpNMessage | ( | T_DIMSE_Message & | msg,
|  | DcmItem * | dataset,
|  | OFBool | outgoing )

private

dumps the given message to the dump stream if it exists.

Parameters

  msg | message to be dumped, should be DIMSE-N
  dataset | option dataset to be dumped, may be NULL
  outgoing | OFTrue if message is outgoing, OFFalse if incoming.

## findAcceptedPC()

T_ASC_PresentationContextID DVPSPrintMessageHandler::findAcceptedPC | ( | const char * | sopclassuid | ) |

private

looks for an accepted presentation context for the given SOP class.

If the SOP class is one of the Basic Grayscale Print Management Meta classes, looks for a presentation context for the meta SOP class.

Parameters

  sopclassuid | SOP Class UID for which a presentation context is searched

Returns
  presentation context if found, 0 otherwise.

## getRQ()

OFCondition DVPSPrintMessageHandler::getRQ | ( | const char * | sopclassUID,
|  | const char * | sopinstanceUID,
|  | const Uint16 * | attributeIdentifierList,
|  | size_t | numShorts,
|  | Uint16 & | status,
|  | DcmDataset *& | attributeListOut )

sends an N-GET-RQ message and receives response.

Any event report requests incoming before the expected response message are handled.

Parameters

  sopclassUID | the requested SOP class UID, must be one of the supported print classes.
  sopinstanceUID | the requested SOP instance UID
  attributeIdentifierList | the list of DICOM attributes to get, may be NULL. The attributes should be coded in pairs along the array (e.g. {g,e,g,e,g,e,...}).
  numShorts | the number of Uint16 values in the array (not the number of pairs).
  status | the response message status code is passed back in this parameter if the method returns with success status. Content is undefined otherwise.
  attributeListOut | a pointer to the attribute list returned by the SCP is passed back in this parameter if the method returns with success status. Content is undefined otherwise. May return NULL if the SCP has not returned an attribute list. If a DICOM dataset is returned, it must be deleted by the caller.

Returns
  DIMSE_NORMAL if successful (e.g. no protocol failure), an error code otherwise.

## negotiateAssociation()

OFCondition DVPSPrintMessageHandler::negotiateAssociation | ( | DcmTransportLayer * | tlayer,
|  | const char * | myAEtitle,
|  | const char * | peerAEtitle,
|  | const char * | peerHost,
|  | int | peerPort,
|  | T_ASC_ProtocolFamily | protocolFamily,
|  | long | peerMaxPDU,
|  | OFBool | negotiatePresentationLUT,
|  | OFBool | negotiateAnnotationBox,
|  | OFBool | implicitOnly )

opens a DICOM association to a remote printer.

The Basic Grayscale Print Management Meta SOP Class and Presentation LUT SOP Class are requested. The association is only accepted if the remote printer supports at least the Basic Grayscale Print Management Meta SOP Class.

Parameters

  tlayer | transport layer object, may be NULL. If present, a transport layer object for TLS transports is expected.
  myAEtitle | the print client's own application entity title (calling aetitle)
  peerAEtitle | the printer's called aetitle
  peerHost | hostname/IP address of the printer
  peerPort | port number of the printer
  protocolFamily | protocol family (AF_INET, AF_INET6, AF_UNSPEC or -1 for default)
  peerMaxPDU | maximum PDU size to negotiate, must be between 8192 and 65536.
  negotiatePresentationLUT | if true, Presentation LUT SOP Class is negotiated
  negotiateAnnotationBox | if true, Basic Annotation Box SOP Class is negotiated
  implicitOnly | if true, only the default implicit VR transfer syntax is proposed, otherwise all uncompressed transfer syntaxes are proposed.

Returns
  status code that can be checked with the SUCCESS macro. If successful, an association is established. If unsuccessful, no association is established.

## printerSupportsAnnotationBox()

OFBool DVPSPrintMessageHandler::printerSupportsAnnotationBox | ( |  | ) |

checks if the remote printer supports the Basic Annotation Box SOP class.

May only be called if association in place.

Returns
  true if presentation context for Basic Annotation Box exists, false otherwise.

## printerSupportsPresentationLUT()

OFBool DVPSPrintMessageHandler::printerSupportsPresentationLUT | ( |  | ) |

checks if the remote printer supports the Presentation LUT SOP class.

May only be called if association in place.

Returns
  true if presentation context for presentation LUT exists, false otherwise.

## releaseAssociation()

OFCondition DVPSPrintMessageHandler::releaseAssociation | ( |  | ) |

releases the current association.

Returns
  ASC_NORMAL or ASC_RELEASECONFIRMED upon success, an error code otherwise.

## sendNRequest()

OFCondition DVPSPrintMessageHandler::sendNRequest | ( | T_ASC_PresentationContextID | presId,
|  | T_DIMSE_Message & | request,
|  | DcmDataset * | rqDataSet,
|  | T_DIMSE_Message & | response,
|  | DcmDataset *& | statusDetail,
|  | DcmDataset *& | rspDataset )

private

sends a DIMSE-N request (any type except N-EVENT-REPORT) and waits for a response.

Any event report requests incoming before the expected DIMSE-N-RSP are handled. If an event handler is registered, it is called for each received event report request.

Parameters

  presId | presentation context ID
  request | DIMSE-N request message to be sent. All fields except DataSetType must be filled in.
  rqDataSet | DICOM dataset to be sent with the request message, e.g. N-Set modification list, N-Action action information, or N-Create attribute list. Not applicable to N-Get or N-Delete.
  response | the received response is passed back in this parameter if the method returns with success status. Content is undefined otherwise.
  statusDetail | the status detail dataset of the received response is passed back in this parameter if the method returns with success status. Content is undefined otherwise.
  rspDataset | the received response dataset is passed back in this parameter if the method returns with success status. Content is undefined otherwise.

Returns
  DIMSE_NORMAL if successful, an error code otherwise.

## setEventHandler()

void DVPSPrintMessageHandler::setEventHandler | ( | DVPSPrintEventHandler * | handler | ) |

inline

registers an event handler object for incoming N-EVENT-REPORTs.

Parameters

  handler | pointer to the new handler object. May be NULL.

References eventHandler.

## setRQ()

OFCondition DVPSPrintMessageHandler::setRQ | ( | const char * | sopclassUID,
|  | const char * | sopinstanceUID,
|  | DcmDataset * | modificationList,
|  | Uint16 & | status,
|  | DcmDataset *& | attributeListOut )

sends an N-SET-RQ message and receives response.

Any event report requests incoming before the expected response message are handled.

Parameters

  sopclassUID | the requested SOP class UID, must be one of the supported print classes.
  sopinstanceUID | the requested SOP instance UID
  modificationList | the modification list dataset, must not be NULL.
  status | the response message status code is passed back in this parameter if the method returns with success status. Content is undefined otherwise.
  attributeListOut | a pointer to the attribute list returned by the SCP is passed back in this parameter if the method returns with success status. Content is undefined otherwise. May return NULL if the SCP has not returned an attribute list. If a DICOM dataset is returned, it must be deleted by the caller.

Returns
  DIMSE_NORMAL if successful (e.g. no protocol failure), an error code otherwise.

## setTimeout()

void DVPSPrintMessageHandler::setTimeout | ( | T_DIMSE_BlockingMode | blocking,
|  | int | timeOut )

inline

sets the blocking and timeout mode for receive operations.

Parameters

  blocking | blocking mode
  timeOut |

References blockMode, and timeout.

The documentation for this class was generated from the following file:

- dcmpstat/include/dcmtk/dcmpstat/dvpspr.h

Generated on for DCMTK Version 3.7.0 by Doxygen 1.15.0