Main Page | Namespace List | Class Hierarchy | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

ippTag.h

Go to the documentation of this file.
00001 // 
00002 // DISCLAIMER: 
00003 //  This software was produced by the National Institute of Standards 
00004 //  and Technology (NIST), an agency of the U.S. government, and by statute is 
00005 //  not subject to copyright in the United States.  Recipients of this 
00006 //  software assume all responsibility associated with its operation,
00007 //  modification,maintenance, and subsequent redistribution. 
00008 //
00009 //  See NIST Administration Manual 4.09.07 b and Appendix I. 
00010 //
00011 #pragma once
00012 #include "ippdme/ippdme.h"
00013 
00014 #include "ippCommandNameType.h"
00015 
00016 const int  TAGSTRINGSIZE  = 6;
00017 
00018 /* IPPSIZE is given as 65536 on page 35 of the spec. The buffers into
00019 which commands and responses are written are expected to be this size
00020 or smaller. Overflow on writing to a buffer smaller than IPPSIZE is
00021 being checked. Overflow on writing to a buffer larger than IPPSIZE is
00022 not being checked.
00023 */
00024 const int  IPPSIZE        = 65536 ;
00025 
00026 
00027 typedef enum tagIdType {
00028   CommandTag = 1,
00029   EventTag   = 2
00030 };
00031 
00032 const unsigned int invalid_tag_number = 0xFFFFFFFF;
00033 
00034 //-----------------------------------------------------------------------------
00035 class IPPDME_EXT_CLASS ippTag
00036 {  
00037   
00038 public:
00039   ippTag(unsigned int inTagNumber, ippCommandNameType id);
00040   ippTag(unsigned int inTagNumber, tagIdType inTagType);
00041   ippTag(const ippTag&);
00042   void operator=(const ippTag&);
00043   ~ippTag();
00044 
00045   void setTagNumber(unsigned int inTagNumber);
00046   
00047   void setTagType(tagIdType inTagType);
00048   
00049   void setTagType(ippCommandNameType commandName);
00050 
00051   unsigned int getTagNumber() const;
00052 
00053   tagIdType getTagType() const;
00054   
00055   std::string getTagString() const;
00056  
00057   bool operator==(const ippTag&) const;
00058   bool operator!=(const ippTag&) const;
00059 private:
00060   ippTag();
00061 private:
00062   unsigned int    _tagNumber;
00063   tagIdType       _tagType;
00064 };
00065 
00066 
00067 inline ippTag::ippTag()
00068 :_tagNumber(invalid_tag_number),_tagType(EventTag)
00069 {
00070 }
00071 
00072 inline  bool ippTag::operator==(const ippTag& rhs) const
00073 {
00074   return _tagNumber == rhs._tagNumber && _tagType != rhs._tagType;
00075 }
00076 
00077 inline bool ippTag::operator!=(const ippTag& rhs) const
00078 {
00079   return !(*this == rhs);
00080 }
00081 
00082 inline ippTag::ippTag(const ippTag& rhs)
00083 : _tagNumber(rhs._tagNumber)
00084 , _tagType(rhs._tagType)
00085 {
00086 }
00087 
00088 inline void ippTag::operator=(const ippTag& rhs)
00089 {
00090   _tagNumber =rhs._tagNumber;
00091   _tagType = rhs._tagType;
00092 }
00093 
00094 
00095 

Generated on Wed Nov 8 00:19:58 2006 for IPPDME by  doxygen 1.4.1