Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members  

WFClTypes.h

00001 #ifndef _LCORE_WFClTypes_H_
00002 
00003 /*
00004  * Copyright (C) 1991-9 Eric M. Hopper <hopper@omnifarious.mn.org>
00005  * 
00006  *     This program is free software; you can redistribute it and/or modify it
00007  *     under the terms of the GNU Lesser General Public License as published
00008  *     by the Free Software Foundation; either version 2 of the License, or
00009  *     (at your option) any later version.
00010  * 
00011  *     This program is distributed in the hope that it will be useful, but
00012  *     WITHOUT ANY WARRANTY; without even the implied warranty of
00013  *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014  *     Lesser General Public License for more details.
00015  * 
00016  *     You should have received a copy of the GNU Lesser General Public
00017  *     License along with this program; if not, write to the Free Software
00018  *     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00019  */
00020 
00021 /* $Header: /home/hopper/src/cvs/C++/LCore/LCore/WFClTypes.h,v 1.4 2002/11/25 05:40:05 hopper Exp $ */
00022 
00023 // For a log, see ../ChangeLog
00024 //
00025 // Revision 1.1.1.1  1995/07/22 04:09:25  hopper
00026 // Imported sources
00027 //
00028 
00029 #ifdef __GNUG__
00030 #  pragma interface
00031 #endif
00032 
00033 #ifndef _LCORE_ClassTypes_H_
00034 #  include <LCore/ClassTypes.h>
00035 #endif
00036 
00037 #ifndef _LCORE_Programmers_H_
00038 #  include <LCore/Programmers.h>
00039 #endif
00040 
00041 #define _LCORE_WFClTypes_H_
00042 
00043 namespace strmod {
00044 namespace lcore {
00045 
00046 class WFCORE_ClassIdent;
00047 
00048 /** \class WF_ClassNum WFClTypes.h StrMod/WFClTypes.h
00049  * A ClassNum for a WinterFire Software class.  WinterFire Software no
00050  * longer exists, but some of its code is still around.
00051  */
00052 class WF_ClassNum : public ClassNum {
00053  protected:
00054    inline virtual const ClassIdent *i_GetIdent() const;
00055    inline WF_ClassNum(const ClassNum &clnum);
00056 
00057    friend class WF_ClassIdent;
00058 
00059  public:
00060    static const WFCORE_ClassIdent identifier;
00061 
00062    inline virtual int AreYouA(const ClassIdent &cid) const;
00063 
00064    enum WFCORE_Libraries { Core = 0, RecordID,
00065                            User0 = 4088, User1, User2, User3,
00066                            User4, User5, User6, User7 = 4095};
00067 
00068    inline U2Byte GetLibNum() const;
00069    inline U4Byte GetClNum() const;
00070 
00071    inline WF_ClassNum(WFCORE_Libraries lnum, U4Byte cnum);
00072 };
00073 
00074 //----------
00075 
00076 class WFCORE_ClassIdent;
00077 
00078 class WF_ClassIdent : public ClassIdent {
00079  protected:
00080    inline virtual const ClassIdent *i_GetIdent() const;
00081 
00082  public:
00083    static const WFCORE_ClassIdent identifier;
00084 
00085    inline virtual int AreYouA(const ClassIdent &cid) const;
00086 
00087    const WF_ClassNum GetClass() const     { return(ClassIdent::GetClass()); }
00088 
00089    inline WF_ClassIdent(WF_ClassNum cnum);
00090 };
00091 
00092 //----------
00093 
00094 //! Class identifier for a core library class of WinterFire software.
00095 class WFCORE_ClassIdent : public EH_ClassIdent {
00096  protected:
00097    inline virtual const ClassIdent *i_GetIdent() const;
00098 
00099  public:
00100    static const WFCORE_ClassIdent identifier;
00101 
00102    inline virtual int AreYouA(const ClassIdent &cid) const;
00103 
00104    inline WFCORE_ClassIdent(U4Byte cnum);
00105 };
00106 
00107 //---------------------------inline functions--------------------------------
00108 
00109 inline const ClassIdent *WF_ClassNum::i_GetIdent() const
00110 {
00111    return(&identifier);
00112 }
00113 
00114 inline int WF_ClassNum::AreYouA(const ClassIdent &cid) const
00115 {
00116    return((identifier == cid) || ClassNum::AreYouA(cid));
00117 }
00118 
00119 inline U2Byte WF_ClassNum::GetLibNum() const
00120 {
00121    return((0xfff00000UL & ClassNum::GetClNum()) >> 20);
00122 }
00123 
00124 inline U4Byte WF_ClassNum::GetClNum() const
00125 {
00126    return(0x000fffffUL & ClassNum::GetClNum());
00127 }
00128 
00129 inline WF_ClassNum::WF_ClassNum(WFCORE_Libraries lnum, U4Byte cnum) :
00130      ClassNum((U4Byte(lnum & 0x0fffU) << 20) | (cnum & 0x000fffffUL))
00131 {
00132 }
00133 
00134 inline WF_ClassNum::WF_ClassNum(const ClassNum &clnum) : ClassNum(clnum)
00135 {
00136 }
00137 
00138 //--------------
00139 
00140 inline const ClassIdent *WF_ClassIdent::i_GetIdent() const
00141 {
00142    return(&identifier);
00143 }
00144 
00145 inline int WF_ClassIdent::AreYouA(const ClassIdent &cid) const
00146 {
00147    return((identifier == cid) || ClassIdent::AreYouA(cid));
00148 }
00149 
00150 inline WF_ClassIdent::WF_ClassIdent(WF_ClassNum cnum) :
00151    ClassIdent(EricMHopper_0, cnum)
00152 {
00153 }
00154 
00155 //--------------
00156 
00157 inline const ClassIdent *WFCORE_ClassIdent::i_GetIdent() const
00158 {
00159    return(&identifier);
00160 }
00161 
00162 inline int WFCORE_ClassIdent::AreYouA(const ClassIdent &cid) const
00163 {
00164    return((identifier == cid) || WF_ClassIdent::AreYouA(cid));
00165 }
00166 
00167 inline WFCORE_ClassIdent::WFCORE_ClassIdent(U4Byte cnum) :
00168      WF_ClassIdent(WF_ClassNum(WF_ClassNum::Core, cnum))
00169 {
00170 }
00171 
00172 } // namespace lcore
00173 } // namespace strmod
00174 
00175 #endif

Generated on Wed Jan 29 00:32:45 2003 for libNet by doxygen1.3-rc1