GDCM 2.2.0

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

- File List
- File Members

gdcmAbstractSyntax.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 GDCMABSTRACTSYNTAX_H
    00015 #define GDCMABSTRACTSYNTAX_H
    00016
    00017 #include "gdcmTypes.h"
    00018 #include "gdcmUIDs.h"
    00019 #include "gdcmDataElement.h"
    00020
    00021 namespace gdcm
    00022 {
    00023
    00024 namespace network
    00025 {
    00026
    00032 class AbstractSyntax
    00033 {
    00034 public:
    00035   AbstractSyntax();
    00036   std::istream &Read(std::istream &is);
    00037   const std::ostream &Write(std::ostream &os) const;
    00038
    00039   void SetName( const char *name ) { UpdateName( name ); }
    00040   const char *GetName() const { return Name.c_str(); }
    00041
    00042   // accept a UIDs::TSType also...
    00043   void SetNameFromUID( UIDs::TSName tsname );
    00044   //now that the PresentationContext messes around with UIDs and returns a string
    00045   //use that string as well.
    00046   //void SetNameFromUIDString( const std::string& inUIDName );
    00047
    00048   size_t Size() const;
    00049
    00050   void Print(std::ostream &os) const;
    00051
    00052   bool operator==(const AbstractSyntax & as) const
    00053     {
    00054     return Name == as.Name;
    00055     }
    00056
    00057   DataElement GetAsDataElement() const;
    00058
    00059 private:
    00060   void UpdateName( const char *name );
    00061   static const uint8_t ItemType;
    00062   static const uint8_t Reserved2;
    00063   uint16_t ItemLength; // len of
    00064   std::string /*AbstractSyntax*/ Name; // UID
    00065 };
    00066
    00067 } // end namespace network
    00068 } // end namespace gdcm
    00069
    00070 #endif //GDCMABSTRACTSYNTAX_H