GDCM 2.2.0

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

- File List
- File Members

gdcmPresentationContextRQ.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 GDCMPRESENTATIONCONTEXTRQ_H
    00015 #define GDCMPRESENTATIONCONTEXTRQ_H
    00016
    00017 #include "gdcmTypes.h"
    00018 #include "gdcmAbstractSyntax.h"
    00019 #include "gdcmTransferSyntaxSub.h"
    00020 #include "gdcmDataSet.h"
    00021
    00022 namespace gdcm
    00023 {
    00024 class PresentationContext;
    00025 namespace network
    00026 {
    00027
    00034 class GDCM_EXPORT PresentationContextRQ
    00035 {
    00036 public:
    00037   PresentationContextRQ();
    00038
    00042   PresentationContextRQ( UIDs::TSName asname, UIDs::TSName tsname =
    00043     UIDs::ImplicitVRLittleEndianDefaultTransferSyntaxforDICOM  );
    00044
    00045   std::istream &Read(std::istream &is);
    00046   const std::ostream &Write(std::ostream &os) const;
    00047   size_t Size() const;
    00048
    00049   void SetAbstractSyntax( AbstractSyntax const & as );
    00050   AbstractSyntax const &GetAbstractSyntax() const { return SubItems; }
    00051   AbstractSyntax &GetAbstractSyntax() { return SubItems; }
    00052
    00053   void AddTransferSyntax( TransferSyntaxSub const &ts );
    00054   typedef std::vector<TransferSyntaxSub>::size_type SizeType;
    00055   TransferSyntaxSub const & GetTransferSyntax(SizeType i) const { return TransferSyntaxes[i]; }
    00056   TransferSyntaxSub & GetTransferSyntax(SizeType i) { return TransferSyntaxes[i]; }
    00057   std::vector<TransferSyntaxSub> const & GetTransferSyntaxes() const {return TransferSyntaxes; }
    00058   SizeType GetNumberOfTransferSyntaxes() const { return TransferSyntaxes.size(); }
    00059
    00060   void SetPresentationContextID( uint8_t id );
    00061   uint8_t GetPresentationContextID() const;
    00062
    00063   void Print(std::ostream &os) const;
    00064
    00065   bool operator==(const PresentationContextRQ & pc) const
    00066     {
    00067     assert( TransferSyntaxes.size() == 1 ); // TODO
    00068     assert( pc.TransferSyntaxes.size() == 1 );
    00069     return SubItems == pc.SubItems && TransferSyntaxes == pc.TransferSyntaxes;
    00070     }
    00071
    00072   PresentationContextRQ(const PresentationContext & pc);
    00073
    00074 private:
    00075   static const uint8_t ItemType;
    00076   static const uint8_t Reserved2;
    00077   uint16_t ItemLength; // len of last transfer syntax
    00078   uint8_t /*PresentationContext*/ID;
    00079   static const uint8_t Reserved6;
    00080   static const uint8_t Reserved7;
    00081   static const uint8_t Reserved8;
    00082   /*
    00083   This variable field shall contain the following sub-items: one Abstract
    00084   Syntax and one or more Transfer Syntax(es). For a complete
    00085   description of the use and encoding of these sub-items see Sections
    00086   9.3.2.2.1 and 9.3.2.2.2.
    00087    */
    00088   AbstractSyntax SubItems;
    00089   std::vector<TransferSyntaxSub> TransferSyntaxes;
    00090 };
    00091
    00092 } // end namespace network
    00093
    00094 } // end namespace gdcm
    00095
    00096 #endif //GDCMPRESENTATIONCONTEXTRQ_H