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 
00136 // Non class types.  Must be the first
00137 // include file in this module.
00138 
00139 #include <Types.hpp>
00140 
00141 // Size and value limits for the types in
00142 // types.hpp
00143 
00144 #include <Limits.hpp>
00145 
00146 // Common class types.
00147 
00148 #include <Exception.hpp>                  // Class Exception 
00149 #include <CoreLinuxObject.hpp>            // Base support class
00150 #include <AbstractString.hpp>             // Base Abstraction *temp!!!
00151 #include <StringUtf8.hpp>                 // CoreLinux++ Default String
00152 #include <NullPointerException.hpp>       // NullPointerException
00153 #include <Assertion.hpp>                  // Class Assertion
00154 #include <AccessRights.hpp>               // General Access Settings
00155 #include <Identifier.hpp>                 // Base Identifier
00156 #include <ScalarIdentifiers.hpp>          // Various identifiers
00157 #include <Synchronized.hpp>
00158 #include <Thread.hpp>
00159 #include <Environment.hpp>
00160 
00161 //#include <AbstractException.hpp>
00162 //#include <AbstractSubject.hpp>
00163 //#include <AbstractObserver.hpp>
00164 //#include <AbstractInteger.hpp>
00165 //#include <AbstractReal.hpp>
00166 // Pre-included collections (STL)
00167 
00168 #if   defined(__INCLUDE_COLLECTIONS)
00169 #include <Pair.hpp>
00170 #include <List.hpp>
00171 #include <Queue.hpp>
00172 #include <Stack.hpp>
00173 #include <Vector.hpp>
00174 #include <Map.hpp>
00175 #include <Set.hpp>
00176 #endif
00177 
00178 
00179 // Do not add code after the next line.
00180 
00181 #undef IN_COMMON_HPP
00182 
00183 #endif  // !defined __COMMON_HPP
00184 
00185 /*
00186    Common rcs information do not modify
00187    $Author: prudhomm $
00188    $Revision: 1.7 $
00189    $Date: 2000/08/31 22:52:20 $
00190    $Locker:  $
00191 */
00192 

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