OpenFOAM logo
Open Source CFD Toolkit

IOobjectList.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     IOobjectList
00027 
00028 Description
00029     List of IOobjects with searching and retrieving facilities.
00030 
00031 SourceFiles
00032     IOobjectList.C
00033 
00034 \*---------------------------------------------------------------------------*/
00035 
00036 #ifndef IOobjectList_H
00037 #define IOobjectList_H
00038 
00039 #include "HashPtrTable.H"
00040 #include "IOobject.H"
00041 
00042 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00043 
00044 namespace Foam
00045 {
00046 
00047 /*---------------------------------------------------------------------------*\
00048                            Class IOobjectList Declaration
00049 \*---------------------------------------------------------------------------*/
00050 
00051 class IOobjectList
00052 :
00053     public HashPtrTable<IOobject>
00054 {
00055     // Private Member Functions
00056 
00057         //- Disallow default bitwise assignment
00058         void operator=(const IOobjectList&);
00059 
00060 
00061 public:
00062 
00063     // Constructors
00064 
00065         //- Construct given an initial estimate for the number of entries
00066         explicit IOobjectList(const label nIoObjects = 100);
00067 
00068         //- Construct from objectRegistry and instance path
00069         IOobjectList
00070         (
00071             const objectRegistry& db,
00072             const fileName& instance,
00073             const fileName& local = ""
00074         );
00075 
00076         //- Construct as copy
00077         IOobjectList(const IOobjectList&);
00078 
00079 
00080     // Destructor
00081 
00082         ~IOobjectList();
00083 
00084 
00085     // Member functions
00086 
00087         //- Add an IOobject to list
00088         bool add(IOobject&);
00089 
00090         //- Remove an IOobject from list
00091         bool remove(IOobject&);
00092 
00093         //- Lookup a given name and return IOobject ptr if found else NULL
00094         IOobject* lookup(const word& name) const;
00095 
00096         //- Return the list for all IOobjects of given class
00097         IOobjectList lookupClass(const word& className) const;
00098 
00099         //- Return the list of names of the IOobjects
00100         wordList names() const;
00101 
00102         //- Return the list of names of the IOobjects of given class
00103         wordList names(const word& className) const;
00104 };
00105 
00106 
00107 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00108 
00109 } // End namespace Foam
00110 
00111 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00112 
00113 #endif
00114 
00115 // ************************************************************************* //
For further information go to www.openfoam.org