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

Method checkInvariant

plugins/e57/libE57Format/src/CompressedVectorNode.cpp:44–99  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

42*/
43
44void CompressedVectorNode::checkInvariant( bool doRecurse, bool doUpcast ) const
45{
46 // If destImageFile not open, can't test invariant (almost every call would throw)
47 if ( !destImageFile().isOpen() )
48 {
49 return;
50 }
51
52 // If requested, call Node::checkInvariant
53 if ( doUpcast )
54 {
55 static_cast<Node>( *this ).checkInvariant( false, false );
56 }
57
58 // Check prototype is good Node
59 prototype().checkInvariant( doRecurse );
60
61 // prototype attached state not same as this attached state
62 if ( prototype().isAttached() != isAttached() )
63 {
64 throw E57_EXCEPTION1( ErrorInvarianceViolation );
65 }
66
67 // prototype not root
68 if ( !prototype().isRoot() )
69 {
70 throw E57_EXCEPTION1( ErrorInvarianceViolation );
71 }
72
73 // prototype dest ImageFile not same as this dest ImageFile
74 if ( prototype().destImageFile() != destImageFile() )
75 {
76 throw E57_EXCEPTION1( ErrorInvarianceViolation );
77 }
78
79 // Check codecs is good Node
80 codecs().checkInvariant( doRecurse );
81
82 // codecs attached state not same as this attached state
83 if ( codecs().isAttached() != isAttached() )
84 {
85 throw E57_EXCEPTION1( ErrorInvarianceViolation );
86 }
87
88 // codecs not root
89 if ( !codecs().isRoot() )
90 {
91 throw E57_EXCEPTION1( ErrorInvarianceViolation );
92 }
93
94 // codecs dest ImageFile not same as this dest ImageFile
95 if ( codecs().destImageFile() != destImageFile() )
96 {
97 throw E57_EXCEPTION1( ErrorInvarianceViolation );
98 }
99}
100
101/*!

Callers

nothing calls this directly

Calls 4

isOpenMethod · 0.45
isAttachedMethod · 0.45
isRootMethod · 0.45
destImageFileMethod · 0.45

Tested by

no test coverage detected