mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: add no-op methods to Nullobject
- empty(), size(), toc(), sortedToc()
This commit is contained in:
committed by
Andrew Heather
parent
fb09f56aba
commit
0ccc005fe6
@ -48,10 +48,9 @@ SourceFiles
|
|||||||
namespace Foam
|
namespace Foam
|
||||||
{
|
{
|
||||||
|
|
||||||
// Forward declarations
|
// Forward Declarations
|
||||||
class Istream;
|
class Istream;
|
||||||
class Ostream;
|
class Ostream;
|
||||||
|
|
||||||
class NullObject;
|
class NullObject;
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*\
|
/*---------------------------------------------------------------------------*\
|
||||||
@ -111,6 +110,30 @@ public:
|
|||||||
{
|
{
|
||||||
return data_[0].val;
|
return data_[0].val;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//- No elements
|
||||||
|
inline constexpr bool empty() const
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
//- Zero elements
|
||||||
|
inline constexpr label size() const
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
//- No-op method (for HashTable replacement)
|
||||||
|
inline const NullObject& toc() const
|
||||||
|
{
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
|
||||||
|
//- No-op method (for HashTable replacement)
|
||||||
|
inline const NullObject& sortedToc() const
|
||||||
|
{
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user