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

SPSClTypes.h

00001 #ifndef _LCORE_SPSClTypes_H_  // -*-c++-*-
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/SPSClTypes.h,v 1.10 2002/05/09 21:55:21 hopper Exp $ */
00022 
00023 // For a log, see ../ChangeLog
00024 //
00025 // Revision 1.6  1999/01/12 04:01:46  hopper
00026 // All kinds of changes to make the code more portable and compile
00027 // properly with the DEC compiler.
00028 //
00029 // Revision 1.5  1998/05/01 11:59:33  hopper
00030 // Changed bool to bool_val or bool_cst as appropriate so it will be easier to
00031 // port to platforms that don't support bool.
00032 //
00033 // Revision 1.4  1996/07/08 02:29:05  hopper
00034 // Added EDIServ application to class library list.
00035 //
00036 // Revision 1.3  1996/06/18 03:33:16  hopper
00037 // Added comment so emacs would know this is a C++ header.
00038 //
00039 // Revision 1.2  1996/02/20 01:34:27  hopper
00040 // Added explicit declarations for some operator == that would normally be
00041 // matched by overloading rules if it weren't for a gcc 2.7.2 bug.
00042 //
00043 // Revision 1.1.1.1  1995/07/22 04:09:25  hopper
00044 // Imported sources
00045 //
00046 
00047 #ifdef __GNUG__
00048 #  pragma interface
00049 #endif
00050 
00051 #ifndef _LCORE_ClassTypes_H_
00052 #  include <LCore/ClassTypes.h>
00053 #endif
00054 
00055 #ifndef _LCORE_Programmers_H_
00056 #  include <LCore/Programmers.h>
00057 #endif
00058 
00059 #define _LCORE_SPSClTypes_H_
00060 
00061 namespace strmod {
00062 namespace lcore {
00063 
00064 class SPSCORE_ClassIdent;
00065 
00066 class SPS_ClassNum : public ClassNum {
00067  protected:
00068    inline virtual const ClassIdent *i_GetIdent() const;
00069    inline SPS_ClassNum(const ClassNum &clnum);
00070 
00071    friend class SPS_ClassIdent;
00072 
00073  public:
00074    static const SPSCORE_ClassIdent identifier;
00075 
00076    inline virtual int AreYouA(const ClassIdent &cid) const;
00077 
00078    enum SPSCORE_Libraries { Core = 0, Database,
00079                             EDIServ = 4086, Mail = 4087,
00080                             User0, User1, User2, User3,
00081                             User4, User5, User6, User7 = 4095};
00082 
00083    inline U2Byte GetLibNum() const;
00084    inline U4Byte GetClNum() const;
00085 
00086    inline SPS_ClassNum(SPSCORE_Libraries lnum, U4Byte cnum);
00087 };
00088 
00089 //----------
00090 
00091 class SPSCORE_ClassIdent;
00092 
00093 class SPS_ClassIdent : public ClassIdent {
00094  protected:
00095    inline virtual const ClassIdent *i_GetIdent() const;
00096 
00097  public:
00098    static const SPSCORE_ClassIdent identifier;
00099 
00100    inline virtual int AreYouA(const ClassIdent &cid) const;
00101 
00102    const SPS_ClassNum GetClass() const     { return(ClassIdent::GetClass()); }
00103 
00104    inline SPS_ClassIdent(SPS_ClassNum cnum);
00105 };
00106 
00107 //----------
00108 
00109 class SPSCORE_ClassIdent : public SPS_ClassIdent {
00110  protected:
00111    inline virtual const ClassIdent *i_GetIdent() const;
00112 
00113  public:
00114    static const SPSCORE_ClassIdent identifier;
00115 
00116    inline virtual int AreYouA(const ClassIdent &cid) const;
00117 
00118    inline SPSCORE_ClassIdent(U4Byte cnum);
00119 };
00120 
00121 //---------------------------inline functions--------------------------------
00122 
00123 inline const ClassIdent *SPS_ClassNum::i_GetIdent() const
00124 {
00125    return(&identifier);
00126 }
00127 
00128 inline int SPS_ClassNum::AreYouA(const ClassIdent &cid) const
00129 {
00130    return((identifier == cid) || ClassNum::AreYouA(cid));
00131 }
00132 
00133 inline U2Byte SPS_ClassNum::GetLibNum() const
00134 {
00135    return((0xfff00000UL & ClassNum::GetClNum()) >> 20);
00136 }
00137 
00138 inline U4Byte SPS_ClassNum::GetClNum() const
00139 {
00140    return(0x000fffffUL & ClassNum::GetClNum());
00141 }
00142 
00143 inline SPS_ClassNum::SPS_ClassNum(SPSCORE_Libraries lnum, U4Byte cnum) :
00144      ClassNum((U4Byte(lnum & 0x0fffU) << 20) | (cnum & 0x000fffffUL))
00145 {
00146 }
00147 
00148 inline SPS_ClassNum::SPS_ClassNum(const ClassNum &clnum) : ClassNum(clnum)
00149 {
00150 }
00151 
00152 //--------------
00153 
00154 inline const ClassIdent *SPS_ClassIdent::i_GetIdent() const
00155 {
00156    return(&identifier);
00157 }
00158 
00159 inline int SPS_ClassIdent::AreYouA(const ClassIdent &cid) const
00160 {
00161    return((identifier == cid) || ClassIdent::AreYouA(cid));
00162 }
00163 
00164 inline SPS_ClassIdent::SPS_ClassIdent(SPS_ClassNum cnum) :
00165    ClassIdent(StPaulSoftware_0, cnum)
00166 {
00167 }
00168 
00169 //--------------
00170 
00171 inline const ClassIdent *SPSCORE_ClassIdent::i_GetIdent() const
00172 {
00173    return(&identifier);
00174 }
00175 
00176 inline int SPSCORE_ClassIdent::AreYouA(const ClassIdent &cid) const
00177 {
00178    return((identifier == cid) || SPS_ClassIdent::AreYouA(cid));
00179 }
00180 
00181 inline SPSCORE_ClassIdent::SPSCORE_ClassIdent(U4Byte cnum) :
00182      SPS_ClassIdent(SPS_ClassNum(SPS_ClassNum::Core, cnum))
00183 {
00184 }
00185 
00186 } // namespace lcore
00187 } // namespace strmod
00188 
00189 #endif

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