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

Method checkInvariant

plugins/e57/libE57Format/src/IntegerNode.cpp:57–77  ·  view source on GitHub ↗

Put this function first so we can reference the code in doxygen using @skip ! @brief Check whether IntegerNode class invariant is true @param [in] doRecurse If true, also check invariants of all children or sub-objects recursively. @param [in] doUpcast If true, also check invariants of the generic Node class. @details This function checks at least the assertions in the documented class invariant

Source from the content-addressed store, hash-verified

55@throw ::ErrorInvarianceViolation or any other E57 ErrorCode
56*/
57void IntegerNode::checkInvariant( bool doRecurse, bool doUpcast ) const
58{
59 E57_UNUSED( doRecurse );
60
61 // If destImageFile not open, can't test invariant (almost every call would throw)
62 if ( !destImageFile().isOpen() )
63 {
64 return;
65 }
66
67 // If requested, call Node::checkInvariant
68 if ( doUpcast )
69 {
70 static_cast<Node>( *this ).checkInvariant( false, false );
71 }
72
73 if ( value() < minimum() || value() > maximum() )
74 {
75 throw E57_EXCEPTION1( ErrorInvarianceViolation );
76 }
77}
78
79/*!
80@class e57::IntegerNode

Callers

nothing calls this directly

Calls 4

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

Tested by

no test coverage detected