OpenFOAM logo
The Open Source CFD Toolbox
  Source Guide OpenCFD Solutions Contact OpenFOAM

CompoundToken.H

Go to the documentation of this file.
00001 /*---------------------------------------------------------------------------*\
00002   =========                 |
00003   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
00004    \\    /   O peration     |
00005     \\  /    A nd           | Copyright (C) 1991-2009 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 the
00013     Free Software Foundation; either version 2 of the License, or (at your
00014     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, write to the Free Software Foundation,
00023     Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
00024 
00025 Class
00026     Foam::CompoundToken
00027 
00028 Description
00029     An abstract base class for managing compound tokens
00030 
00031 \*---------------------------------------------------------------------------*/
00032 
00033 #ifndef CompoundToken_H
00034 #define CompoundToken_H
00035 
00036 #include "refCount.H"
00037 #include "typeInfo.H"
00038 #include "autoPtr.H"
00039 #include "runTimeSelectionTables.H"
00040 
00041 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00042 
00043 namespace Foam
00044 {
00045 
00046 // Forward declaration of friend functions and operators
00047 
00048 class CompoundToken;
00049 Ostream& operator<<(Ostream&, const CompoundToken&);
00050 
00051 
00052 /*---------------------------------------------------------------------------*\
00053                            Class CompoundToken Declaration
00054 \*---------------------------------------------------------------------------*/
00055 
00056 class CompoundToken
00057 :
00058     public refCount
00059 {
00060     // Private Member Functions
00061 
00062         //- Disallow default bitwise copy construct
00063         CompoundToken(const CompoundToken&);
00064 
00065         //- Disallow default bitwise assignment
00066         void operator=(const CompoundToken&);
00067 
00068 
00069 public:
00070 
00071     //- Runtime type information
00072     virtual const word& type() const = 0;
00073 
00074 
00075     // Declare run-time constructor selection tables
00076 
00077         declareRunTimeSelectionTable
00078         (
00079             autoPtr,
00080             CompoundToken,
00081             Istream,
00082             (const word& type, Istream& is),
00083             (type, is)
00084         );
00085 
00086 
00087     // Constructors
00088 
00089         //- Construct null
00090         CompoundToken()
00091         {}
00092 
00093         //- Return the clone as this and increment reference count
00094         virtual autoPtr<CompoundToken> clone() const = 0;
00095 
00096 
00097     // Selectors
00098 
00099         //- Select null constructed
00100         static autoPtr<CompoundToken> New(const word& type, Istream& is);
00101 
00102 
00103     // Destructor
00104 
00105         virtual ~CompoundToken();
00106 
00107 
00108     // Member Functions
00109 
00110         // Access
00111 
00112         // Check
00113 
00114         // Edit
00115 
00116         // Write
00117 
00118             virtual void write(Istream&) = 0;
00119 
00120 
00121     // IOstream Operators
00122 
00123         friend Ostream& operator<<(Ostream&, const CompoundToken&);
00124 };
00125 
00126 
00127 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00128 
00129 } // End namespace Foam
00130 
00131 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00132 
00133 #endif
00134 
00135 // ************************************************************************* //
Copyright © 2000-2009 OpenCFD Ltd