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

HopClTypes.h

00001 #ifndef _LCORE_HopClTypes_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/HopClTypes.h,v 1.12 2002/11/25 05:40:05 hopper Exp $ */
00022 
00023 // For log, see ../ChangeLog
00024 //
00025 // Revision 1.5  1998/05/01 11:59:32  hopper
00026 // Changed bool to bool_val or bool_cst as appropriate so it will be easier to
00027 // port to platforms that don't support bool.
00028 //
00029 // Revision 1.4  1996/10/01 19:17:26  hopper
00030 // Added Trashcan library to libraries list.
00031 //
00032 // Revision 1.3  1996/03/26 16:23:00  hopper
00033 // Moved ReferenceCounting class over from Container library.
00034 // Fixed up class numbering system so LCore uses a seperate library number
00035 // from the container library.
00036 //
00037 // Revision 1.2  1996/02/12 00:43:48  hopper
00038 // Added Net library class EH0_Libraries enum in class EH_ClassNum.
00039 //
00040 // Revision 1.1.1.1  1995/07/22 04:09:25  hopper
00041 // Imported sources
00042 //
00043 // Revision 0.4  1995/03/08 05:31:50  hopper
00044 // Added StrMod library to EH0_Libraries enum
00045 //
00046 // Revision 0.3  1994/10/30  04:40:44  hopper
00047 // Moved various things into the new LCore library.
00048 //
00049 // Revision 0.2  1994/09/12  03:31:27  hopper
00050 // Added the RecordID constant to the EH0_Libraries enum.
00051 //
00052 // Revision 0.1  1994/07/21  05:38:24  hopper
00053 // Genesis!
00054 //
00055 
00056 #ifdef __GNUG__
00057 #  pragma interface
00058 #endif
00059 
00060 #ifndef _LCORE_ClassTypes_H_
00061 #  include <LCore/ClassTypes.h>
00062 #endif
00063 
00064 #ifndef _LCORE_Programmers_H_
00065 #  include <LCore/Programmers.h>
00066 #endif
00067 
00068 #define _LCORE_HopClTypes_H_
00069 
00070 namespace strmod {
00071 namespace lcore {
00072 
00073 class LCore_ClassIdent;
00074 
00075 //! A ClassNum of one of Eric Hopper's classes.
00076 class EH_ClassNum : public ClassNum {
00077  protected:
00078    inline virtual const ClassIdent *i_GetIdent() const;
00079    inline EH_ClassNum(const ClassNum &clnum);
00080 
00081    friend class EH_ClassIdent;
00082 
00083  public:
00084    static const LCore_ClassIdent identifier;
00085 
00086    inline virtual int AreYouA(const ClassIdent &cid) const;
00087 
00088    enum EH0_Libraries { Container = 0, Common, ETurboVis, Accounting,
00089                         FileIO, RecordID, StrMod, Net, LCore, ADT,
00090                         Logger = 4083, MO_Entry, DriverFile, Journals, GMCs,
00091                         User0, User1, User2, User3,
00092                         User4, User5, User6, User7 = 4095};
00093 
00094    inline U2Byte GetLibNum() const;
00095    inline U4Byte GetClNum() const;
00096 
00097    inline EH_ClassNum(EH0_Libraries lnum, U4Byte cnum);
00098 };
00099 
00100 //----------
00101 
00102 class EH_ClassIdent : public ClassIdent {
00103  protected:
00104    inline virtual const ClassIdent *i_GetIdent() const;
00105 
00106  public:
00107    static const LCore_ClassIdent identifier;
00108 
00109    inline virtual int AreYouA(const ClassIdent &cid) const;
00110 
00111    const EH_ClassNum GetClass() const     { return(ClassIdent::GetClass()); }
00112 
00113    inline EH_ClassIdent(EH_ClassNum cnum);
00114 };
00115 
00116 //----------
00117 
00118 /** \class LCore_ClassIdent HopClTypes.h LCore/HopClTypes.h
00119  * A class identifier for a class in the LCore library.
00120 */
00121 class LCore_ClassIdent : public EH_ClassIdent {
00122  protected:
00123    inline virtual const ClassIdent *i_GetIdent() const;
00124 
00125  public:
00126    static const LCore_ClassIdent identifier;
00127 
00128    inline virtual int AreYouA(const ClassIdent &cid) const;
00129 
00130    inline LCore_ClassIdent(U4Byte cnum);
00131 };
00132 
00133 //---------------------------inline functions--------------------------------
00134 
00135 inline const ClassIdent *EH_ClassNum::i_GetIdent() const
00136 {
00137    return(&identifier);
00138 }
00139 
00140 inline int EH_ClassNum::AreYouA(const ClassIdent &cid) const
00141 {
00142    return((identifier == cid) || ClassNum::AreYouA(cid));
00143 }
00144 
00145 inline U2Byte EH_ClassNum::GetLibNum() const
00146 {
00147    return((0xfff00000UL & ClassNum::GetClNum()) >> 20);
00148 }
00149 
00150 inline U4Byte EH_ClassNum::GetClNum() const
00151 {
00152    return(0x000fffffUL & ClassNum::GetClNum());
00153 }
00154 
00155 inline EH_ClassNum::EH_ClassNum(EH0_Libraries lnum, U4Byte cnum) :
00156      ClassNum((U4Byte(lnum & 0x0fffU) << 20) | (cnum & 0x000fffffUL))
00157 {
00158 }
00159 
00160 inline EH_ClassNum::EH_ClassNum(const ClassNum &clnum) : ClassNum(clnum)
00161 {
00162 }
00163 
00164 //--------------
00165 
00166 inline const ClassIdent *EH_ClassIdent::i_GetIdent() const
00167 {
00168    return(&identifier);
00169 }
00170 
00171 inline int EH_ClassIdent::AreYouA(const ClassIdent &cid) const
00172 {
00173    return((identifier == cid) || ClassIdent::AreYouA(cid));
00174 }
00175 
00176 inline EH_ClassIdent::EH_ClassIdent(EH_ClassNum cnum) :
00177    ClassIdent(EricMHopper_0, cnum)
00178 {
00179 }
00180 
00181 //--------------
00182 
00183 inline const ClassIdent *LCore_ClassIdent::i_GetIdent() const
00184 {
00185    return(&identifier);
00186 }
00187 
00188 inline int LCore_ClassIdent::AreYouA(const ClassIdent &cid) const
00189 {
00190    return((identifier == cid) || EH_ClassIdent::AreYouA(cid));
00191 }
00192 
00193 inline LCore_ClassIdent::LCore_ClassIdent(U4Byte cnum) :
00194      EH_ClassIdent(EH_ClassNum(EH_ClassNum::LCore, cnum))
00195 {
00196 }
00197 
00198 } // namespace lcore
00199 } // namespace strmod
00200 
00201 #endif

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