Common.hpp

00001 #if !defined (__COMMON_HPP)
00002 #define __COMMON_HPP
00003 
00004 /*
00005    CoreLinux++ 
00006    Copyright (C) 1999 CoreLinux Consortium
00007   
00008    The CoreLinux++ Library is free software; you can redistribute it and/or
00009    modify it under the terms of the GNU Library General Public License as
00010    published by the Free Software Foundation; either version 2 of the
00011    License, or (at your option) any later version.
00012 
00013    The CoreLinux++ Library Library is distributed in the hope that it will 
00014    be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
00015    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00016    Library General Public License for more details.
00017 
00018    You should have received a copy of the GNU Library General Public
00019    License along with the GNU C Library; see the file COPYING.LIB.  If not,
00020    write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
00021    Boston, MA 02111-1307, USA.  
00022 */   
00023 
00031 // Used by the component headers to determine
00032 // that they are indeed being included by
00033 // Common.hpp
00034 
00035 #define IN_COMMON_HPP
00036 
00037 //
00038 // Some standard information
00039 //
00040 
00041 // TEXT identifies that the following text
00042 // string may be either UNICODE or ANSI
00043 //
00044 // TEXT("The quick brown fox jumped over the lazy dog!")
00045 //
00046 // will make the string UNICODE charactes if __UNICODE is defined
00047 // and ANSI characters if not.
00048 
00049 #if defined( __UNICODE )
00050    #if defined(__GNUC__)
00051       #include    <wchar.h>
00052       #define _STDTEXT(text) L##text
00053    #else
00054       #define _STDTEXT(text) text
00055    #endif
00056 #else
00057    #define _STDTEXT(text) text
00058 #endif
00059 
00060 #define TEXT(text) _STDTEXT(text)
00061 
00062 #define __STDFILE__ TEXT( __FILE__ )
00063 
00064 
00071 #define LOCATION __STDFILE__, __LINE__
00072 
00080 #define IGNORE_RETURN (void)
00081 
00090 #define DECLARE_TYPE( mydecl, mytype )  \
00091 typedef mydecl         mytype;         \
00092 typedef mytype *       mytype ## Ptr;  \
00093 typedef const mytype * mytype ## Cptr; \
00094 typedef mytype &       mytype ## Ref;  \
00095 typedef const mytype & mytype ## Cref;
00096 
00105 #define DECLARE_CLASS( tag )            \
00106    class   tag;                        \
00107    typedef tag *       tag ## Ptr;     \
00108    typedef const tag * tag ## Cptr;    \
00109    typedef tag &       tag ## Ref;     \
00110    typedef const tag & tag ## Cref;
00111 
00113 
00114 #define CORELINUX( tag ) \
00115     corelinux::tag
00116 
00118 
00119 namespace corelinux
00120 {
00121    DECLARE_CLASS( CoreLinuxObject   );    // Base class
00122    DECLARE_CLASS( AbstractString    );    // Dispatching virtual
00123    DECLARE_CLASS( StringUtf8        );    // Utf8 Implementation
00124    DECLARE_CLASS( Exception         );    // Basic Exception *temporary!!!
00125    DECLARE_CLASS( NullPointerException ); // NullPointerException
00126    DECLARE_CLASS( Assertion         );    // Thank you B. Meyers
00127    DECLARE_CLASS( Synchronized      );    // 
00128    DECLARE_CLASS( Thread            );    //
00129    DECLARE_CLASS( SemaphoreGroup    );    // 
00130    DECLARE_CLASS( AbstractInteger   );    // 
00131    DECLARE_CLASS( AbstractReal      );    // 
00132 }
00133 
00134 #include <cstddef>                             // size_t, wchar_t, NULL
00135 #include <cstring>
00136 
00137 // Non class types.  Must be the first
00138 // include file in this module.
00139 
00140 #include <Types.hpp>
00141 
00142 // Size and value limits for the types in
00143 // types.hpp
00144 
00145 #include <Limits.hpp>
00146 
00147 // Common class types.
00148 
00149 #include <Exception.hpp>                  // Class Exception 
00150 #include <CoreLinuxObject.hpp>            // Base support class
00151 #include <AbstractString.hpp>             // Base Abstraction *temp!!!
00152 #include <StringUtf8.hpp>                 // CoreLinux++ Default String
00153 #include <NullPointerException.hpp>       // NullPointerException
00154 #include <Assertion.hpp>                  // Class Assertion
00155 #include <AccessRights.hpp>               // General Access Settings
00156 #include <Identifier.hpp>                 // Base Identifier
00157 #include <ScalarIdentifiers.hpp>          // Various identifiers
00158 #include <Synchronized.hpp>
00159 #include <Thread.hpp>
00160 #include <Environment.hpp>
00161 
00162 //#include <AbstractException.hpp>
00163 //#include <AbstractSubject.hpp>
00164 //#include <AbstractObserver.hpp>
00165 //#include <AbstractInteger.hpp>
00166 //#include <AbstractReal.hpp>
00167 // Pre-included collections (STL)
00168 
00169 #if   defined(__INCLUDE_COLLECTIONS)
00170 #include <Pair.hpp>
00171 #include <List.hpp>
00172 #include <Queue.hpp>
00173 #include <Stack.hpp>
00174 #include <Vector.hpp>
00175 #include <Map.hpp>
00176 #include <Set.hpp>
00177 #endif
00178 
00179 
00180 // Do not add code after the next line.
00181 
00182 #undef IN_COMMON_HPP
00183 
00184 #endif  // !defined __COMMON_HPP
00185 
00186 /*
00187    Common rcs information do not modify
00188    $Author: prudhomm $
00189    $Revision: 1.7 $
00190    $Date: 2000/08/31 22:52:20 $
00191    $Locker:  $
00192 */
00193 
00194 
00195 
00196 
00197 
00198 
00199 
00200 
00201 
00202 

This is the CoreLinux++ reference manual
Provided by The CoreLinux Consortium