FreeFOAM The Cross-Platform CFD Toolkit
Hosted by SourceForge:
Get FreeFOAM at SourceForge.net.
            Fast, secure and Free Open Source software downloads

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