GDCM
2.2.0
|
00001 /*========================================================================= 00002 * 00003 * Copyright Insight Software Consortium 00004 * 00005 * Licensed under the Apache License, Version 2.0 (the "License"); 00006 * you may not use this file except in compliance with the License. 00007 * You may obtain a copy of the License at 00008 * 00009 * http://www.apache.org/licenses/LICENSE-2.0.txt 00010 * 00011 * Unless required by applicable law or agreed to in writing, software 00012 * distributed under the License is distributed on an "AS IS" BASIS, 00013 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 00014 * See the License for the specific language governing permissions and 00015 * limitations under the License. 00016 * 00017 *=========================================================================*/ 00018 #ifndef GDCMPDUFACTORY_H 00019 #define GDCMPDUFACTORY_H 00020 00021 #include "gdcmTypes.h" 00022 #include "gdcmNetworkEvents.h" 00023 #include "gdcmULConnection.h" 00024 #include "gdcmPresentationDataValue.h" 00025 00026 namespace gdcm{ 00027 class BaseRootQuery; 00028 class File; 00029 namespace network{ 00030 class BasePDU; 00031 00037 class PDUFactory { 00038 public: 00039 static BasePDU* ConstructPDU(uint8_t itemtype);//eventually needs to be smartpointer'd 00040 static EEventID DetermineEventByPDU(const BasePDU* inPDU); 00041 static BasePDU* ConstructReleasePDU(); 00042 static BasePDU* ConstructAbortPDU(); 00043 00044 //these are the composite PDU construction methods for the PDataPDUs. 00045 //basically, builds a pdatapdu, and then puts the appropriate information in 00046 //for the appropriate composite service (c-echo, c-find, c-store, c-get, c-move) 00047 //the connection is necessary to construct the stream of PDVs that will 00048 //be then placed into the vector of PDUs 00049 static std::vector<BasePDU*> CreateCEchoPDU(const ULConnection& inConnection); 00050 static std::vector<BasePDU*> CreateCStoreRQPDU(const ULConnection& inConnection, const File &file); 00051 static std::vector<BasePDU*> CreateCStoreRSPPDU(const DataSet *inDataSet, const BasePDU* inPC); 00052 static std::vector<BasePDU*> CreateCFindPDU(const ULConnection& inConnection, const BaseRootQuery* inRootQuery); 00053 static std::vector<BasePDU*> CreateCMovePDU(const ULConnection& inConnection, const BaseRootQuery* inRootQuery); 00054 00055 //given data pdus, produce the presentation data values stored within. 00056 //all operations have these as the payload of the data sending operation 00057 //however, echo does not have a dataset in the pdv. 00058 static std::vector<PresentationDataValue> GetPDVs(const std::vector<BasePDU*> & inDataPDUs); 00059 }; 00060 } 00061 } 00062 #endif //GDCMPDUFACTORY_H