entityMapperKey.h
Go to the documentation of this file.
00001 /*********************************************************************
00002 ** Copyright (c) 1992-2010 VT MAK
00003 ** All rights reserved.
00004 *********************************************************************/
00005 
00008 
00009 #pragma once
00010 
00011 #include <QtCore/QString>
00012 #include <omtReader.h>
00013 
00014 class  DtEntityType;
00015 
00016 class DT_DLL_OMTREADER DtEntityMapperKey
00017 {
00018 
00019 public:
00020 
00021    static const int DtAnyMatch;
00022 
00023    DtEntityMapperKey();
00024 
00025    DtEntityMapperKey(const char* p);
00026 
00027    DtEntityMapperKey
00028    (
00029       int kind,
00030       int domain,
00031       int country,
00032       int category,
00033       int subcategory,
00034       int specific,
00035       int extra
00036    );
00037 
00039    DtEntityMapperKey(const DtEntityMapperKey& orig);
00040 
00042    ~DtEntityMapperKey();
00043 
00045    DtEntityMapperKey& operator=(const DtEntityMapperKey& rhs);
00046 
00048    DtEntityMapperKey& operator=(const char* rhs);
00049 
00050    const QString& string() const;
00051 
00052    int kind() const {return myKind;}
00053    void setKind(int kind){myKind = kind;}
00054 
00055    int domain() const {return myDomain;}
00056    void setDomain(int domain){myDomain = domain;}
00057 
00058    int country() const {return myCountry;}
00059    void setCountry(int country){myCountry = country;}
00060 
00061    int category() const {return myCategory;}
00062    void setCategory(int category){myCategory = category;}
00063 
00064    int subcategory() const {return mySubcategory;}
00065    void setSubCategory(int subcategory){mySubcategory = subcategory;}
00066 
00067    int specific() const {return mySpecific;}
00068    void setSpecific(int specific){mySpecific = specific;}
00069 
00070    int extra() const {return myExtra;}
00071    void setExtra(int extra){myExtra = extra;}
00072 
00074 
00075    bool operator==(const DtEntityMapperKey& rhs) const;
00076    virtual bool matchPattern(const DtEntityMapperKey &pat) const;
00077 
00079 
00080    bool operator!=(const DtEntityMapperKey& rhs) const;
00081 
00083 
00084    bool operator<(const DtEntityMapperKey& rhs) const;
00085 
00087 
00088    bool operator>(const DtEntityMapperKey& rhs) const;
00089 
00090    int& operator[](int);
00091    const int operator[](int) const;
00092 
00094    virtual bool exactMatch(const DtEntityMapperKey&) const;
00095 
00096 protected:
00097 
00098    mutable QString myStringRep;
00099    int myKind;
00100    int myDomain;
00101    int myCountry;
00102    int myCategory;
00103    int mySubcategory;
00104    int mySpecific;
00105    int myExtra;
00106 };
00107 
00108 inline int& DtEntityMapperKey::operator[](int i)
00109 {
00110    switch (i)
00111    {
00112       case 0:
00113          return myKind;
00114       case 1:
00115          return myDomain;
00116       case 2:
00117          return myCountry;
00118       case 3:
00119          return myCategory;
00120       case 4:
00121          return mySubcategory;
00122       case 5:
00123          return mySpecific;
00124       case 6:
00125          return myExtra;
00126    }
00127    return myKind;
00128 }
00129 
00130 inline const int DtEntityMapperKey::operator[](int i) const
00131 {
00132    switch (i)
00133    {
00134       case 0:
00135          return myKind;
00136       case 1:
00137          return myDomain;
00138       case 2:
00139          return myCountry;
00140       case 3:
00141          return myCategory;
00142       case 4:
00143          return mySubcategory;
00144       case 5:
00145          return mySpecific;
00146       case 6:
00147          return myExtra;
00148    }
00149 
00150    return myKind;
00151 }
00152 

Document ID: Generated on Tue Oct 11 19:41:03 EDT 2011 from SVN revision 107422
Copyright © 2005-2011 VT MÄK Inc. All Rights Reserved (www.mak.com)