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

Method checkInvariant

plugins/e57/libE57Format/src/CompressedVectorReader.cpp:49–85  ·  view source on GitHub ↗

Put this function first so we can reference the code in doxygen using @skip ! @brief Check whether CompressedVectorReader class invariant is true @details This function checks at least the assertions in the documented class invariant description (see class reference page for this object). Other internal invariants that are implementation-dependent may also be checked. If any invariant clause is v

Source from the content-addressed store, hash-verified

47@post No visible state is modified.
48*/
49void CompressedVectorReader::checkInvariant( bool /*doRecurse*/ )
50{
51 // If this CompressedVectorReader is not open, can't test invariant (almost
52 // every call would throw)
53 if ( !isOpen() )
54 {
55 return;
56 }
57
58 CompressedVectorNode cv = compressedVectorNode();
59 ImageFile imf = cv.destImageFile();
60
61 // If destImageFile not open, can't test invariant (almost every call would
62 // throw)
63 if ( !imf.isOpen() )
64 {
65 return;
66 }
67
68 // Associated CompressedVectorNode must be attached to ImageFile
69 if ( !cv.isAttached() )
70 {
71 throw E57_EXCEPTION1( ErrorInvarianceViolation );
72 }
73
74 // Dest ImageFile must have at least 1 reader (this one)
75 if ( imf.readerCount() < 1 )
76 {
77 throw E57_EXCEPTION1( ErrorInvarianceViolation );
78 }
79
80 // Dest ImageFile can't have any writers
81 if ( imf.writerCount() != 0 )
82 {
83 throw E57_EXCEPTION1( ErrorInvarianceViolation );
84 }
85}
86
87/*!
88@class e57::CompressedVectorReader

Callers

nothing calls this directly

Calls 6

isOpenFunction · 0.85
destImageFileMethod · 0.45
isOpenMethod · 0.45
isAttachedMethod · 0.45
readerCountMethod · 0.45
writerCountMethod · 0.45

Tested by

no test coverage detected