Initial commit for version 2.0.x patch release
[OpenFOAM-2.0.x.git] / src / OpenFOAM / primitives / nil / nil.H
blob77eba50437ce35c0f9f2054cc23d846d9c384a05
1 /*---------------------------------------------------------------------------*\
2   =========                 |
3   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
4    \\    /   O peration     |
5     \\  /    A nd           | Copyright (C) 2004-2010 OpenCFD Ltd.
6      \\/     M anipulation  |
7 -------------------------------------------------------------------------------
8 License
9     This file is part of OpenFOAM.
11     OpenFOAM is free software: you can redistribute it and/or modify it
12     under the terms of the GNU General Public License as published by
13     the Free Software Foundation, either version 3 of the License, or
14     (at your option) any later version.
16     OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17     ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18     FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
19     for more details.
21     You should have received a copy of the GNU General Public License
22     along with OpenFOAM.  If not, see <http://www.gnu.org/licenses/>.
24 Class
25     Foam::nil
27 Description
28     A zero-sized class without any storage. Used, for example, in HashSet.
30 Note
31     A zero-sized class actually does still require at least 1 byte storage.
33 \*---------------------------------------------------------------------------*/
35 #ifndef nil_H
36 #define nil_H
38 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
40 namespace Foam
43 // Forward declaration of classes
44 class Istream;
45 class Ostream;
47 // Forward declaration of friend functions and operators
49 class nil;
51 Istream& operator>>(Istream&, nil&);
52 Ostream& operator<<(Ostream&, const nil&);
55 /*---------------------------------------------------------------------------*\
56                              Class nil Declaration
57 \*---------------------------------------------------------------------------*/
59 class nil
62 public:
64     // Constructors
66         //- Construct null
67         nil()
68         {}
70         //- Construct from Istream
71         nil(Istream&)
72         {}
75     // IOstream Operators
77         friend Istream& operator>>(Istream& is, nil&)
78         {
79             return is;
80         }
82         friend Ostream& operator<<(Ostream& os, const nil&)
83         {
84             return os;
85         }
89 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
91 } // End namespace Foam
93 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
95 #endif
97 // ************************************************************************* //