| 42 | } |
| 43 | |
| 44 | void CompressedVectorNodeImpl::setPrototype( const NodeImplSharedPtr &prototype ) |
| 45 | { |
| 46 | // don't checkImageFileOpen, ctor did it |
| 47 | |
| 48 | //??? check ok for proto, no Blob CompressedVector, empty? |
| 49 | //??? throw E57_EXCEPTION2(ErrorBadPrototype) |
| 50 | |
| 51 | // Can't set prototype twice. |
| 52 | if ( prototype_ ) |
| 53 | { |
| 54 | throw E57_EXCEPTION2( ErrorSetTwice, "this->pathName=" + this->pathName() ); |
| 55 | } |
| 56 | |
| 57 | // prototype can't have a parent (must be a root node) |
| 58 | if ( !prototype->isRoot() ) |
| 59 | { |
| 60 | throw E57_EXCEPTION2( ErrorAlreadyHasParent, |
| 61 | "this->pathName=" + this->pathName() + |
| 62 | " prototype->pathName=" + prototype->pathName() ); |
| 63 | } |
| 64 | |
| 65 | // Verify that prototype is destined for same ImageFile as this is |
| 66 | ImageFileImplSharedPtr thisDest( destImageFile() ); |
| 67 | ImageFileImplSharedPtr prototypeDest( prototype->destImageFile() ); |
| 68 | if ( thisDest != prototypeDest ) |
| 69 | { |
| 70 | throw E57_EXCEPTION2( ErrorDifferentDestImageFile, |
| 71 | "this->destImageFile" + thisDest->fileName() + |
| 72 | " prototype->destImageFile" + prototypeDest->fileName() ); |
| 73 | } |
| 74 | |
| 75 | // !!! check for incomplete CompressedVectors when closing file |
| 76 | prototype_ = prototype; |
| 77 | |
| 78 | // Note that prototype is not attached to CompressedVector in a parent/child |
| 79 | // relationship. This means that prototype is a root node (has no parent). |
| 80 | } |
| 81 | |
| 82 | NodeImplSharedPtr CompressedVectorNodeImpl::getPrototype() const |
| 83 | { |
no test coverage detected