00001 /*---------------------------------------------------------------------------*\ 00002 ========= | 00003 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox 00004 \\ / O peration | 00005 \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. 00006 \\/ M anipulation | 00007 ------------------------------------------------------------------------------- 00008 License 00009 This file is part of OpenFOAM. 00010 00011 OpenFOAM is free software: you can redistribute it and/or modify it 00012 under the terms of the GNU General Public License as published by 00013 the Free Software Foundation, either version 3 of the License, or 00014 (at your option) any later version. 00015 00016 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT 00017 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 00018 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 00019 for more details. 00020 00021 You should have received a copy of the GNU General Public License 00022 along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. 00023 00024 Class 00025 Foam::CompoundToken 00026 00027 Description 00028 An abstract base class for managing compound tokens 00029 00030 \*---------------------------------------------------------------------------*/ 00031 00032 #ifndef CompoundToken_H 00033 #define CompoundToken_H 00034 00035 #include <OpenFOAM/refCount.H> 00036 #include <OpenFOAM/typeInfo.H> 00037 #include <OpenFOAM/autoPtr.H> 00038 #include <OpenFOAM/runTimeSelectionTables.H> 00039 00040 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 00041 00042 namespace Foam 00043 { 00044 00045 // Forward declaration of friend functions and operators 00046 00047 class CompoundToken; 00048 Ostream& operator<<(Ostream&, const CompoundToken&); 00049 00050 00051 /*---------------------------------------------------------------------------*\ 00052 Class CompoundToken Declaration 00053 \*---------------------------------------------------------------------------*/ 00054 00055 class CompoundToken 00056 : 00057 public refCount 00058 { 00059 // Private Member Functions 00060 00061 //- Disallow default bitwise copy construct 00062 CompoundToken(const CompoundToken&); 00063 00064 //- Disallow default bitwise assignment 00065 void operator=(const CompoundToken&); 00066 00067 00068 public: 00069 00070 //- Runtime type information 00071 virtual const word& type() const = 0; 00072 00073 00074 // Declare run-time constructor selection tables 00075 00076 declareRunTimeSelectionTable 00077 ( 00078 autoPtr, 00079 CompoundToken, 00080 Istream, 00081 (const word& type, Istream& is), 00082 (type, is) 00083 ); 00084 00085 00086 // Constructors 00087 00088 //- Construct null 00089 CompoundToken() 00090 {} 00091 00092 //- Return the clone as this and increment reference count 00093 virtual autoPtr<CompoundToken> clone() const = 0; 00094 00095 00096 // Selectors 00097 00098 //- Select null constructed 00099 static autoPtr<CompoundToken> New(const word& type, Istream& is); 00100 00101 00102 // Destructor 00103 00104 virtual ~CompoundToken(); 00105 00106 00107 // Member Functions 00108 00109 // Access 00110 00111 // Check 00112 00113 // Edit 00114 00115 // Write 00116 00117 virtual void write(Istream&) = 0; 00118 00119 00120 // IOstream Operators 00121 00122 friend Ostream& operator<<(Ostream&, const CompoundToken&); 00123 }; 00124 00125 00126 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 00127 00128 } // End namespace Foam 00129 00130 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 00131 00132 #endif 00133 00134 // ************************ vim: set sw=4 sts=4 et: ************************ //