OGS
ShapeStaticConsts.cpp File Reference

Detailed Description

The purpose of this file is to prevent linker errors.

The classes defined in the included headers each have static const members DIM and NPOINTS. The compiler is allowed to optimize those symbols out. Therefore the linker later on might not find those symbols anymore and raises errors. The static const members are explicitly instantiated here in order to rule such errors out.

Helper to generate that code:

find . '(' -name '*.h' -and -not -name '*-impl.h' ')' -printf '%f\n' \
| sort \
| while read f; do
c="${f%.h}";
echo "const unsigned $c::DIM;";
echo "const unsigned $c::NPOINTS;";
done >ShapeStaticConsts.cpp

Definition in file ShapeStaticConsts.cpp.

#include "ShapeHex20.h"
#include "ShapeHex8.h"
#include "ShapeLine2.h"
#include "ShapeLine3.h"
#include "ShapePoint1.h"
#include "ShapePrism15.h"
#include "ShapePrism6.h"
#include "ShapePyra13.h"
#include "ShapePyra5.h"
#include "ShapeQuad4.h"
#include "ShapeQuad8.h"
#include "ShapeQuad9.h"
#include "ShapeTet10.h"
#include "ShapeTet4.h"
#include "ShapeTri3.h"
#include "ShapeTri6.h"
Include dependency graph for ShapeStaticConsts.cpp:

Go to the source code of this file.

Namespaces

namespace  NumLib