DCMTK  Version 3.6.1 20120515
OFFIS DICOM Toolkit
Public Member Functions | Private Member Functions | Private Attributes
DVPSPrintMessageHandler Class Reference

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

List of all members.

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, 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
DVPSPrintMessageHandleroperator= (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_Associationassoc
 the association to be used for message communication. Can be NULL.
T_ASC_Networknet
 the network used for establishing associations. Can be NULL.
DVPSPrintEventHandlereventHandler
 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

aborts the current association.

Returns:
a status code that can be checked with the SUCCESS() macro.
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:
sopclassUIDthe requested SOP class UID, must be one of the supported print classes.
sopinstanceUIDthe requested SOP instance UID
actionTypeIDthe action type ID
actionInformationthe action information dataset, may be NULL.
statusthe response message status code is passed back in this parameter if the method returns with success status. Content is undefined otherwise.
actionReplya 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.
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:
sopclassUIDthe affected SOP class UID, must be one of the supported print classes.
sopinstanceUIDthe affected SOP instance UID. May be empty in which case the UID is assigned by the SCP and returned in this parameter.
attributeListInthe attribute list dataset, may be NULL.
statusthe response message status code is passed back in this parameter if the method returns with success status. Content is undefined otherwise.
attributeListOuta 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.
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:
sopclassUIDthe requested SOP class UID, must be one of the supported print classes.
sopinstanceUIDthe requested SOP instance UID
statusthe 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.
void DVPSPrintMessageHandler::dumpNMessage ( T_DIMSE_Message msg,
DcmItem dataset,
OFBool  outgoing 
) [private]

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

Parameters:
msgmessage to be dumped, should be DIMSE-N
datasetoption dataset to be dumped, may be NULL
outgoingOFTrue if message is outgoing, OFFalse if incoming.
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:
sopclassuidSOP Class UID for which a presentation context is searched
Returns:
presentation context if found, 0 otherwise.
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:
sopclassUIDthe requested SOP class UID, must be one of the supported print classes.
sopinstanceUIDthe requested SOP instance UID
attributeIdentifierListthe 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,...}).
numShortsthe number of Uint16 values in the array (not the number of pairs).
statusthe response message status code is passed back in this parameter if the method returns with success status. Content is undefined otherwise.
attributeListOuta 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.
OFCondition DVPSPrintMessageHandler::negotiateAssociation ( DcmTransportLayer tlayer,
const char *  myAEtitle,
const char *  peerAEtitle,
const char *  peerHost,
int  peerPort,
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:
tlayertransport layer object, may be NULL. If present, a transport layer object for TLS transports is expected.
myAEtitlethe print client's own application entity title (calling aetitle)
peerAEtitlethe printer's called aetitle
peerHosthostname/IP address of the printer
peerPortport number of the printer
peerMaxPDUmaximum PDU size to negotiate, must be between 8192 and 65536.
negotiatePresentationLUTif true, Presentation LUT SOP Class is negotiated
negotiateAnnotationBoxif true, Basic Annotation Box SOP Class is negotiated
implicitOnlyif 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.

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.

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.

releases the current association.

Returns:
ASC_NORMAL or ASC_RELEASECONFIRMED upon success, an error code otherwise.
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:
presIdpresentation context ID
requestDIMSE-N request message to be sent. All fields except DataSetType must be filled in.
rqDataSetDICOM 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.
responsethe received response is passed back in this parameter if the method returns with success status. Content is undefined otherwise.
statusDetailthe status detail dataset of the received response is passed back in this parameter if the method returns with success status. Content is undefined otherwise.
rspDatasetthe 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.

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

Parameters:
handlerpointer to the new handler object. May be NULL.
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:
sopclassUIDthe requested SOP class UID, must be one of the supported print classes.
sopinstanceUIDthe requested SOP instance UID
modificationListthe modification list dataset, must not be NULL.
statusthe response message status code is passed back in this parameter if the method returns with success status. Content is undefined otherwise.
attributeListOuta 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.
void DVPSPrintMessageHandler::setTimeout ( T_DIMSE_BlockingMode  blocking,
int  timeOut 
) [inline]

sets the blocking and timeout mode for receive operations.

Parameters:
blockModeblocking mode
timeout

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


Generated on Tue May 15 2012 for DCMTK Version 3.6.1 20120515 by Doxygen 1.7.5.1-20111027