MCPcopy Create free account
hub / github.com/PDAL/PDAL / checkInvariant

Method checkInvariant

plugins/e57/libE57Format/src/FloatNode.cpp:40–68  ·  view source on GitHub ↗

Putting this function first so we can reference the code in doxygen using @skip @brief Check whether FloatNode class invariant is true @copydetails IntegerNode::checkInvariant()

Source from the content-addressed store, hash-verified

38/// @brief Check whether FloatNode class invariant is true
39/// @copydetails IntegerNode::checkInvariant()
40void FloatNode::checkInvariant( bool /*doRecurse*/, bool doUpcast ) const
41{
42 // If destImageFile not open, can't test invariant (almost every call would throw)
43 if ( !destImageFile().isOpen() )
44 {
45 return;
46 }
47
48 // If requested, call Node::checkInvariant
49 if ( doUpcast )
50 {
51 static_cast<Node>( *this ).checkInvariant( false, false );
52 }
53
54 if ( precision() == PrecisionSingle )
55 {
56 if ( static_cast<float>( minimum() ) < FLOAT_MIN ||
57 static_cast<float>( maximum() ) > FLOAT_MAX )
58 {
59 throw E57_EXCEPTION1( ErrorInvarianceViolation );
60 }
61 }
62
63 // If value is out of bounds
64 if ( value() < minimum() || value() > maximum() )
65 {
66 throw E57_EXCEPTION1( ErrorInvarianceViolation );
67 }
68}
69
70/*!
71@class e57::FloatNode

Callers

nothing calls this directly

Calls 4

minimumFunction · 0.85
maximumFunction · 0.85
valueFunction · 0.85
isOpenMethod · 0.45

Tested by

no test coverage detected