OpenFOAM: v1912 released! - For more information see https://www.openfoam.com/releases/openfoam-v1912

Commit e6cb866e authored by Mark Olesen's avatar Mark Olesen

COMP: change from contiguous as function to is_contiguous as struct

parent 20ca801a
......@@ -65,7 +65,7 @@ Foam::Ostream& Foam::Module::operator<<
const Foam::Module::LongList<T, Offset>& DL
)
{
if ((os.format() == IOstream::ASCII) || !contiguous<T>())
if ((os.format() == IOstream::ASCII) || !is_contiguous<T>::value)
{
if (DL.size() < 15)
{
......@@ -157,7 +157,7 @@ Foam::Istream& Foam::Module::operator>>
DL.setSize(size);
// Read list contents depending on data format
if ((is.format() == IOstream::ASCII) || !contiguous<T>())
if ((is.format() == IOstream::ASCII) || !is_contiguous<T>::value)
{
// Read beginning of contents
char listDelimiter = is.readBeginList("List");
......@@ -283,7 +283,7 @@ void Foam::Module::LongList<T, Offset>::appendFromStream(Istream& is)
setSize(origSize + size);
// Read list contents depending on data format
if ((is.format() == IOstream::ASCII) || !contiguous<T>())
if ((is.format() == IOstream::ASCII) || !is_contiguous<T>::value)
{
// Read beginning of contents
char listDelimiter = is.readBeginList("List");
......
......@@ -148,7 +148,7 @@ public:
//- Return the binary size in number of characters of the UList
// if the element is a primitive type
// i.e. contiguous<T>() == true
// i.e. is_contiguous<T>::value == true
inline label byteSize() const;
......
......@@ -218,7 +218,7 @@ inline Foam::label Foam::Module::LongList<T, Offset>::size() const
template<class T, int Offset>
inline Foam::label Foam::Module::LongList<T, Offset>::byteSize() const
{
if (!contiguous<T>())
if (!is_contiguous<T>::value)
{
FatalErrorInFunction
<< "Cannot return the binary size of a list of "
......
......@@ -172,10 +172,11 @@ public:
//- Data for labelledMeshOctreeCubeCoordinates are contiguous
template<>
inline bool contiguous<Module::labelledMeshOctreeCubeCoordinates>()
{
return true;
}
struct is_contiguous<Module::labelledMeshOctreeCubeCoordinates>
:
std::true_type
{};
} // End namespace Foam
......
......@@ -226,10 +226,11 @@ public:
//- Data for labelledPair are contiguous
template<>
inline bool contiguous<Module::labelledPair>()
{
return true;
}
struct is_contiguous<Module::labelledPair>
:
std::true_type
{};
} // End namespace Foam
......
......@@ -165,13 +165,11 @@ public:
//- Data for labelledPoint are contiguous
template<>
inline bool contiguous<Module::labelledPoint>()
{
return true;
}
struct is_contiguous<Module::labelledPoint>
:
std::true_type
{};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
......
......@@ -152,10 +152,11 @@ public:
//- Data for refLabelledPoint are contiguous
template<>
inline bool contiguous<Module::refLabelledPoint>()
{
return true;
}
struct is_contiguous<Module::refLabelledPoint>
:
std::true_type
{};
} // End namespace Foam
......
......@@ -188,10 +188,11 @@ public:
//- Data for labelledPointScalar are contiguous
template<>
inline bool contiguous<Module::labelledPointScalar>()
{
return true;
}
struct is_contiguous<Module::labelledPointScalar>
:
std::true_type
{};
} // End namespace Foam
......
......@@ -160,10 +160,11 @@ public:
//- Data for refLabelledPointScalar are contiguous
template<>
inline bool contiguous<Module::refLabelledPointScalar>()
{
return true;
}
struct is_contiguous<Module::refLabelledPointScalar>
:
std::true_type
{};
} // End namespace Foam
......
......@@ -197,10 +197,11 @@ public:
//- Data for labelledScalar are contiguous
template<>
inline bool contiguous<Module::labelledScalar>()
{
return true;
}
struct is_contiguous<Module::labelledScalar>
:
std::true_type
{};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
......
......@@ -185,10 +185,11 @@ public:
//- Data for meshOctreCubeCoordinatesScalar are contiguous
template<>
inline bool contiguous<Module::meshOctreeCubeCoordinatesScalar>()
{
return true;
}
struct is_contiguous<Module::meshOctreeCubeCoordinatesScalar>
:
std::true_type
{};
} // End namespace Foam
......
......@@ -135,10 +135,11 @@ public:
//- Data for parPartTet are contiguous
template<>
inline bool contiguous<Module::parPartTet>()
{
return true;
}
struct is_contiguous<Module::parPartTet>
:
std::true_type
{};
} // End namespace Foam
......
......@@ -150,10 +150,10 @@ public:
//- Data for parTriFace are contiguous
template<>
inline bool contiguous<Module::parTriFace>()
{
return true;
}
struct is_contiguous<Module::parTriFace>
:
std::true_type
{};
} // End namespace Foam
......
......@@ -143,7 +143,7 @@ void Foam::Module::help::exchangeMap
{
data.clear();
if (!contiguous<T>())
if (!is_contiguous<T>::value)
{
FatalError << "Data is not contiguous" << exit(FatalError);
}
......@@ -363,9 +363,9 @@ void Foam::Module::help::exchangeMap
{
mOut.clear();
if (!contiguous<T>())
if (!is_contiguous<T>::value)
{
FatalError << "Data is not contigous" << exit(FatalError);
FatalError << "Data is not contiguous" << exit(FatalError);
}
typename std::map<label, ListType>::const_iterator iter;
......
......@@ -149,10 +149,11 @@ public:
//- Data for meshOctreeCubeBasic are contiguous
template<>
inline bool contiguous<Module::meshOctreeCubeBasic>()
{
return true;
}
struct is_contiguous<Module::meshOctreeCubeBasic>
:
std::true_type
{};
} // End namespace Foam
......
......@@ -240,10 +240,11 @@ public:
//- Data for meshOctreeCubeCoordinates are contiguous
template<>
inline bool contiguous<Module::meshOctreeCubeCoordinates>()
{
return true;
}
struct is_contiguous<Module::meshOctreeCubeCoordinates>
:
std::true_type
{};
} // End namespace Foam
......
......@@ -177,12 +177,13 @@ public:
} // End namespace Module
//- Data for parMapperHelper are contiguous
template<>
inline bool contiguous<Module::parMapperHelper>()
{
return true;
}
struct is_contiguous<Module::parMapperHelper>
:
std::true_type
{};
} // End namespace Foam
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment