VR-Forces 4.0.4 Class Documentation
include/ngutil/entityMapperKey.h
Go to the documentation of this file.
00001 /*********************************************************************
00002 ** Copyright (c) 1997 MaK Technologies, Inc.
00003 ** All rights reserved.
00004 *********************************************************************/
00005 /*********************************************************************
00006 ** $RCSfile: entityMapperKey.h,v $ $Revision: 1.2 $ $State: Exp $
00007 *********************************************************************/
00008 
00011 
00012 #ifndef ENTITYMAPPERKEY_H
00013 #define ENTITYMAPPERKEY_H
00014 
00015 #include "ngutil/ngutilDefines.h"
00016 #include <string>
00017 
00018 class DtEntityType;
00019 
00020 class DT_DLL_ngutil DtEntityMapperKey
00021 {
00022 
00023 public:
00024 
00025    static const int DtAnyMatch;
00026 
00027    DtEntityMapperKey();
00028 
00029    DtEntityMapperKey(const char* p);
00030 
00031    DtEntityMapperKey
00032    (
00033       int force,
00034       int super,
00035       int kind,
00036       int domain,
00037       int country,
00038       int category,
00039       int subcategory,
00040       int specific,
00041       int extra
00042    );
00043 
00045    DtEntityMapperKey(const DtEntityMapperKey& orig);
00046 
00048    ~DtEntityMapperKey();
00049 
00051    DtEntityMapperKey& operator=(const DtEntityMapperKey& rhs);
00052 
00054    DtEntityMapperKey& operator=(const char* rhs);
00055 
00056    const std::string& string() const;
00057 
00058    int force() const {return myForce;}
00059    void setForce(int force){myForce = force;}
00060 
00061    int super() const {return mySuper;}
00062    void setSuper(int super){mySuper = super;}
00063 
00064    int kind() const {return myKind;}
00065    void setKind(int kind){myKind = kind;}
00066 
00067    int domain() const {return myDomain;}
00068    void setDomain(int domain){myDomain = domain;}
00069 
00070    int country() const {return myCountry;}
00071    void setCountry(int country){myCountry = country;}
00072 
00073    int category() const {return myCategory;}
00074    void setCategory(int category){myCategory = category;}
00075 
00076    int subcategory() const {return mySubcategory;}
00077    void setSubCategory(int subcategory){mySubcategory = subcategory;}
00078 
00079    int specific() const {return mySpecific;}
00080    void setSpecific(int specific){mySpecific = specific;}
00081 
00082    int extra() const {return myExtra;}
00083    void setExtra(int extra){myExtra = extra;}
00084 
00086 
00087    bool operator==(const DtEntityMapperKey& rhs) const;
00088    virtual bool matchPattern(const DtEntityMapperKey &pat) const;
00089 
00091 
00092    bool operator!=(const DtEntityMapperKey& rhs) const;
00093 
00095 
00096    bool operator<(const DtEntityMapperKey& rhs) const;
00097 
00099 
00100    bool operator>(const DtEntityMapperKey& rhs) const;
00101 
00102    int& operator[](int);
00103    const int operator[](int) const;
00104 
00106    virtual bool exactMatch(const DtEntityMapperKey&) const;
00107 
00108 protected:
00109 
00110    mutable std::string myStringRep;
00111    int myForce;
00112    int mySuper;
00113    int myKind;
00114    int myDomain;
00115    int myCountry;
00116    int myCategory;
00117    int mySubcategory;
00118    int mySpecific;
00119    int myExtra;
00120 };
00121 
00122 inline int& DtEntityMapperKey::operator[](int i)
00123 {
00124    switch (i)
00125    {
00126       case 0:
00127          return myKind;
00128       case 1:
00129          return myDomain;
00130       case 2:
00131          return myCountry;
00132       case 3:
00133          return myCategory;
00134       case 4:
00135          return mySubcategory;
00136       case 5:
00137          return mySpecific;
00138       case 6:
00139          return myExtra;
00140       case 7:
00141          return mySuper;
00142       case 9:
00143          return myForce;
00144    }
00145 
00146    return myForce;
00147 }
00148 
00149 inline const int DtEntityMapperKey::operator[](int i) const
00150 {
00151    switch (i)
00152    {
00153       case 0:
00154          return myKind;
00155       case 1:
00156          return myDomain;
00157       case 2:
00158          return myCountry;
00159       case 3:
00160          return myCategory;
00161       case 4:
00162          return mySubcategory;
00163       case 5:
00164          return mySpecific;
00165       case 6:
00166          return myExtra;
00167       case 7:
00168          return mySuper;
00169       case 9:
00170          return myForce;
00171    }
00172 
00173    return myForce;
00174 }
00175 
00176 #endif
00177 

Document ID: Generated on Fri Jun 29 16:33:32 EDT 2012 from SVN revision 116588
Copyright © 2005-2012 VT MÄK Inc. All Rights Reserved (www.mak.com)