OpenFOAM logo
Open Source CFD Toolkit

TimePaths.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-2005 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     TimePaths
00027 
00028 Description
00029 
00030 SourceFiles
00031     TimePaths.C
00032 
00033 \*---------------------------------------------------------------------------*/
00034 
00035 #ifndef TimePaths_H
00036 #define TimePaths_H
00037 
00038 #include "fileName.H"
00039 
00040 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00041 
00042 namespace Foam
00043 {
00044 
00045 /*---------------------------------------------------------------------------*\
00046                            Class TimePaths Declaration
00047 \*---------------------------------------------------------------------------*/
00048 
00049 
00050 class TimePaths
00051 {
00052     // Private data
00053 
00054         bool processorCase_;
00055         fileName rootPath_;
00056         fileName case_;
00057         word system_;
00058         word constant_;
00059 
00060 
00061 public:
00062 
00063     // Constructors
00064 
00065         //- Construct given database name, rootPath and casePath
00066         TimePaths
00067         (
00068             const fileName& rootPath,
00069             const fileName& caseName,
00070             const word& systemName,
00071             const word& constantName
00072         );
00073 
00074 
00075     // Member functions
00076 
00077             //- Return true if this is a processor case
00078             bool processorCase() const
00079             {
00080                 return processorCase_;
00081             }
00082 
00083             //- Return root path
00084             const fileName& rootPath() const
00085             {
00086                 return rootPath_;
00087             }
00088 
00089             //- Return case name
00090             const fileName& caseName() const
00091             {
00092                 return case_;
00093             }
00094 
00095             //- Return system name
00096             const word& system() const
00097             {
00098                 return system_;
00099             }
00100 
00101             //- Return constant name
00102             const word& constant() const
00103             {
00104                 return constant_;
00105             }
00106 
00107             //- Return path
00108             fileName path() const
00109             {
00110                 return rootPath()/caseName();
00111             }
00112 
00113             //- Return system path
00114             fileName systemPath() const
00115             {
00116                 return path()/system();
00117             }
00118 
00119             //- Return constant path
00120             fileName constantPath() const
00121             {
00122                 return path()/constant();
00123             }
00124 };
00125 
00126 
00127 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00128 
00129 } // End namespace Foam
00130 
00131 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00132 
00133 #endif
00134 
00135 // ************************************************************************* //
For further information go to www.openfoam.org