GDCM 2.2.0

- Main Page
- Related Pages
- Namespaces
- Classes
- Files
- Directories
- Examples

- File List
- File Members

gdcmAAssociateACPDU.h
Go to the documentation of this file.

    00001 /*=========================================================================
    00002
    00003   Program: GDCM (Grassroots DICOM). A DICOM library
    00004
    00005   Copyright (c) 2006-2011 Mathieu Malaterre
    00006   All rights reserved.
    00007   See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details.
    00008
    00009      This software is distributed WITHOUT ANY WARRANTY; without even
    00010      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
    00011      PURPOSE.  See the above copyright notice for more information.
    00012
    00013 =========================================================================*/
    00014 #ifndef GDCMAASSOCIATEACPDU_H
    00015 #define GDCMAASSOCIATEACPDU_H
    00016
    00017 #include "gdcmTypes.h"
    00018 #include "gdcmApplicationContext.h"
    00019 #include "gdcmPresentationContextAC.h"
    00020 #include "gdcmUserInformation.h"
    00021 #include "gdcmBasePDU.h"
    00022
    00023 #include <vector>
    00024
    00025 namespace gdcm
    00026 {
    00027
    00028 namespace network
    00029 {
    00030 class AAssociateRQPDU;
    00031
    00037 class AAssociateACPDU : public BasePDU
    00038 {
    00039 public:
    00040   AAssociateACPDU();
    00041   std::istream &Read(std::istream &is);
    00042   const std::ostream &Write(std::ostream &os) const;
    00043
    00044   void AddPresentationContextAC( PresentationContextAC const &pcac );
    00045
    00046   typedef std::vector<PresentationContextAC>::size_type SizeType;
    00047   const PresentationContextAC &GetPresentationContextAC( SizeType i ) {
    00048     assert( !PresContextAC.empty() && i < PresContextAC.size() );
    00049     return PresContextAC[i];
    00050   }
    00051   SizeType GetNumberOfPresentationContextAC() const {
    00052     return PresContextAC.size();
    00053   }
    00054   const UserInformation &GetUserInformation() const { return UserInfo; }
    00055
    00056   SizeType Size() const;
    00057
    00058   void Print(std::ostream &os) const;
    00059   bool IsLastFragment() const { return true; }
    00060
    00061   void InitFromRQ( AAssociateRQPDU const & rqpdu );
    00062 protected:
    00063   friend class AAssociateRQPDU;
    00064   void SetCalledAETitle(const char calledaetitle[16]);
    00065   void SetCallingAETitle(const char callingaetitle[16]);
    00066
    00067 private:
    00068   void InitSimple( AAssociateRQPDU const & rqpdu );
    00069
    00070 private:
    00071   static const uint8_t ItemType; // PDUType ?
    00072   static const uint8_t Reserved2;
    00073   uint32_t PDULength; // len of
    00074   static const uint16_t ProtocolVersion;
    00075   static const uint16_t Reserved9_10;
    00076
    00077   // This reserved field shall be sent with a value identical to the value
    00078   // received in the same field of the A-ASSOCIATE-RQ PDU, but its value
    00079   // shall not be tested when received.
    00080   char Reserved11_26[16];
    00081   // This reserved field shall be sent with a value identical to the value
    00082   // received in the same field of the A-ASSOCIATE-RQ PDU, but its value
    00083   // shall not be tested when received.
    00084   char Reserved27_42[16];
    00085   // This reserved field shall be sent with a value identical to the value
    00086   // received in the same field of the A-ASSOCIATE-RQ PDU, but its value
    00087   // shall not be tested when received.
    00088   static const uint8_t Reserved43_74[32];
    00089   /*
    00090   75-xxx Variable items This variable field shall contain the following items: one Application
    00091   Context Item, one or more Presentation Context Item(s) and one User
    00092   Information Item. For a complete description of these items see Sections
    00093   7.1.1.2, 7.1.1.14, and 7.1.1.6.
    00094    */
    00095   ApplicationContext AppContext;
    00096   std::vector<PresentationContextAC>  PresContextAC;
    00097   UserInformation UserInfo;
    00098 };
    00099
    00100 } // end namespace network
    00101
    00102 } // end namespace gdcm
    00103
    00104 #endif //GDCMAASSOCIATEACPDU_H