libE57Format 3.1.1
C++ library to read & write the E57 file format for point cloud data
Loading...
Searching...
No Matches
e57::ImageFile Class Reference

An ASTM E57 3D format file object. More...

#include <E57Format.h>

Public Member Functions

 ImageFile ()=delete
 
 ImageFile (const char *input, uint64_t size, ReadChecksumPolicy checksumPolicy=ChecksumAll)
 
 ImageFile (const ustring &fname, const ustring &mode, ReadChecksumPolicy checksumPolicy=ChecksumAll)
 Open an ASTM E57 imaging data file for reading/writing.
 
void cancel ()
 Stop I/O operations and delete a partially written ImageFile on the disk.
 
void checkInvariant (bool doRecurse=true) const
 Check whether ImageFile class invariant is true.
 
void close ()
 Complete any write operations on an ImageFile, and close the file on the disk.
 
void dump (int indent=0, std::ostream &os=std::cout) const
 Diagnostic function to print internal state of object to output stream in an indented format.
 
void elementNameParse (const ustring &elementName, ustring &prefix, ustring &localPart) const
 Parse element name into prefix and localPart substrings.
 
void extensionsAdd (const ustring &prefix, const ustring &uri)
 Declare the use of an E57 extension in an ImageFile being written.
 
size_t extensionsCount () const
 Get number of E57 extensions declared in the ImageFile.
 
bool extensionsLookupPrefix (const ustring &prefix) const
 Look up an E57 extension prefix in the ImageFile.
 
bool extensionsLookupPrefix (const ustring &prefix, ustring &uri) const
 Get URI associated with an E57 extension prefix in the ImageFile.
 
bool extensionsLookupUri (const ustring &uri, ustring &prefix) const
 Get an E57 extension prefix associated with a URI in the ImageFile.
 
ustring extensionsPrefix (size_t index) const
 Get an E57 extension prefix declared in an ImageFile by index.
 
ustring extensionsUri (size_t index) const
 Get an E57 extension URI declared in an ImageFile by index.
 
ustring fileName () const
 Get the file name the ImageFile was created with.
 
bool isElementNameExtended (const ustring &elementName) const
 Test whether an E57 element name has an extension prefix.
 
bool isOpen () const
 Test whether ImageFile is still open for accessing.
 
bool isWritable () const
 Test whether ImageFile was opened in write mode.
 
bool operator!= (const ImageFile &imf2) const
 Test if two ImageFile handles refer to different underlying ImageFile.
 
bool operator== (const ImageFile &imf2) const
 Test if two ImageFile handles refer to the same underlying ImageFile.
 
int readerCount () const
 Get current number of open CompressedVectorReader objects reading from ImageFile.
 
StructureNode root () const
 Get the pre-established root StructureNode of the E57 ImageFile.
 
int writerCount () const
 Get current number of open CompressedVectorWriter objects writing to ImageFile.
 

Detailed Description

An ASTM E57 3D format file object.

Class overview

The ImageFile class represents the state of an ASTM E57 format data file. An ImageFile may be created from an E57 file on the disk (read mode). An new ImageFile may be created to write an E57 file to disk (write mode).

E57 files are organized in a tree structure. Each ImageFile object has a predefined root node (of type StructureNode). In a write mode ImageFile, the root node is initially empty. In a read mode ImageFile, the root node is populated by the tree stored in the .e57 file on disk.

The open/close state

An ImageFile object, opened in either mode (read/write), can be in one of two states: open or closed. An ImageFile in the open state is ready to perform transfers of data and to be interrogated. An ImageFile in the closed state cannot perform any further transfers, and has very limited ability to be interrogated. Note entering the closed state is different than destroying the ImageFile object. An ImageFile object can still exist and be in the closed state. When created, the ImageFile is initially open.

The ImageFile state can transition to the closed state in two ways. The programmer can call ImageFile::close after all required processing has completed. The programmer can call ImageFile::cancel if it is determined that the ImageFile is no longer needed.

Extensions

Basically in an E57 file, "extension = namespace + rules + meaning". The "namespace" ensures that element names don't collide. The "rules" may be written on paper, or partly codified in a computer grammar. The "meaning" is a definition of what was measured, what the numbers in the file mean.

Extensions are identified by URIs. Extensions are not identified by prefixes. Prefixes are a shorthand, used in a particular file, to make the element names more palatable for humans. When thinking about a prefixed element name, in your mind you should immediately substitute the URI for the prefix. For example, think "http://www.example.com/DemoExtension:extra2" rather than "demo:extra2", if the prefix "demo" is declared in the file to be a shorthand for the URI "http://www.example.com/DemoExtension".

The rules are statements of: what is valid, what element names are possible, what values are possible. The rules establish the answer to the following yes/no question: "Is this extended E57 file valid?". The rules divide all possible files into two sets: valid files and invalid files.

The "meanings" part of the above equation defines what the files in the first set, the valid files, actually mean. This definition usually comes in the form of documentation of the content of each new element in the format and how they relate to the other elements.

An element name in an E57 file is a member of exactly one namespace (either the default namespace defined in the ASTM standard, or an extension namespace). Rules about the structure of an E57 extension (what element names can appear where), are implicitly assumed only to govern the element names within the namespace of the extension. Element names in other namespaces are unconstrained. This is because a reader is required to ignore elements in namespaces that are unfamiliar (to treat them as if they didn't exist). This enables a writer to "tack on" new elements into pre-defined structures (e.g. structures defined in the ASTM standard), without fear that it will confuse a reader that is only familiar with the old format. This allows an extension designer to communicate to two sets of readers: the old readers that will understand the information in the old base format, and the new-fangled readers that will be able to read the base format and the extra information stored in element names in the extended namespace.

Class Invariant

A class invariant is a list of statements about an object that are always true before and after any operation on the object. An invariant is useful for testing correct operation of an implementation. Statements in an invariant can involve only externally visible state, or can refer to internal implementation-specific state that is not visible to the API user. The following C++ code checks externally visible state for consistency and throws an exception if the invariant is violated:

void ImageFile::checkInvariant( bool doRecurse ) const
{
// If this ImageFile is not open, can't test invariant (almost every call
// would throw)
if ( !isOpen() )
{
return;
}
// root() node must be a root node
if ( !root().isRoot() )
{
throw E57_EXCEPTION1( ErrorInvarianceViolation );
}
// Can't have empty fileName
if ( fileName().empty() )
{
throw E57_EXCEPTION1( ErrorInvarianceViolation );
}
int wCount = writerCount();
int rCount = readerCount();
// Can't have negative number of readers
if ( rCount < 0 )
{
throw E57_EXCEPTION1( ErrorInvarianceViolation );
}
// Can't have negative number of writers
if ( wCount < 0 )
{
throw E57_EXCEPTION1( ErrorInvarianceViolation );
}
// Can't have more than one writer
if ( 1 < wCount )
{
throw E57_EXCEPTION1( ErrorInvarianceViolation );
}
// If have writer
if ( wCount > 0 )
{
// Must be in write-mode
if ( !isWritable() )
{
throw E57_EXCEPTION1( ErrorInvarianceViolation );
}
// Can't have any readers
if ( rCount > 0 )
{
throw E57_EXCEPTION1( ErrorInvarianceViolation );
}
}
// Extension prefixes and URIs are unique
const size_t eCount = extensionsCount();
for ( size_t i = 0; i < eCount; i++ )
{
for ( size_t j = i + 1; j < eCount; j++ )
{
if ( extensionsPrefix( i ) == extensionsPrefix( j ) )
{
throw E57_EXCEPTION1( ErrorInvarianceViolation );
}
if ( extensionsUri( i ) == extensionsUri( j ) )
{
throw E57_EXCEPTION1( ErrorInvarianceViolation );
}
}
}
// Verify lookup functions are correct
for ( size_t i = 0; i < eCount; i++ )
{
ustring goodPrefix = extensionsPrefix( i );
ustring goodUri = extensionsUri( i );
ustring prefix;
ustring uri;
if ( !extensionsLookupPrefix( goodPrefix, uri ) )
{
throw E57_EXCEPTION1( ErrorInvarianceViolation );
}
if ( uri != goodUri )
{
throw E57_EXCEPTION1( ErrorInvarianceViolation );
}
if ( !extensionsLookupUri( goodUri, prefix ) )
{
throw E57_EXCEPTION1( ErrorInvarianceViolation );
}
if ( prefix != goodPrefix )
{
throw E57_EXCEPTION1( ErrorInvarianceViolation );
}
}
// If requested, check all objects "below" this one
if ( doRecurse )
{
root().checkInvariant( doRecurse );
}
}
StructureNode root() const
Get the pre-established root StructureNode of the E57 ImageFile.
Definition: ImageFile.cpp:315
ustring extensionsPrefix(size_t index) const
Get an E57 extension prefix declared in an ImageFile by index.
Definition: ImageFile.cpp:641
bool isOpen() const
Test whether ImageFile is still open for accessing.
Definition: ImageFile.cpp:386
size_t extensionsCount() const
Get number of E57 extensions declared in the ImageFile.
Definition: ImageFile.cpp:614
ustring extensionsUri(size_t index) const
Get an E57 extension URI declared in an ImageFile by index.
Definition: ImageFile.cpp:668
bool extensionsLookupPrefix(const ustring &prefix) const
Look up an E57 extension prefix in the ImageFile.
Definition: ImageFile.cpp:533
bool extensionsLookupUri(const ustring &uri, ustring &prefix) const
Get an E57 extension prefix associated with a URI in the ImageFile.
Definition: ImageFile.cpp:593
int writerCount() const
Get current number of open CompressedVectorWriter objects writing to ImageFile.
Definition: ImageFile.cpp:440
void checkInvariant(bool doRecurse=true) const
Check whether ImageFile class invariant is true.
Definition: ImageFile.cpp:57
ustring fileName() const
Get the file name the ImageFile was created with.
Definition: ImageFile.cpp:418
int readerCount() const
Get current number of open CompressedVectorReader objects reading from ImageFile.
Definition: ImageFile.cpp:462
bool isWritable() const
Test whether ImageFile was opened in write mode.
Definition: ImageFile.cpp:402
void checkInvariant(bool doRecurse=true, bool doUpcast=true) const
Check whether StructureNode class invariant is true.
Definition: StructureNode.cpp:42
@ ErrorInvarianceViolation
class invariance constraint violation in debug mode
Definition: E57Exception.h:133
std::string ustring
UTF-8 encoded Unicode string.
Definition: E57Format.h:54

Constructor & Destructor Documentation

◆ ImageFile() [1/3]

e57::ImageFile::ImageFile ( )
delete

◆ ImageFile() [2/3]

ImageFile::ImageFile ( const ustring fname,
const ustring mode,
ReadChecksumPolicy  checksumPolicy = ChecksumAll 
)

Open an ASTM E57 imaging data file for reading/writing.

Parameters
[in]fnameFile name to open. Support of '\' as a directory separating character is system dependent. For maximum portability, it is recommended that '/' be used as a directory separator in file names. Special device file name support are implementation dependent (e.g. "\\.\PhysicalDrive3" or "/dev/hd3"). It is recommended that files that meet all of the requirements for a legal ASTM E57 file format use the extension ".e57". It is recommended that files that utilize the low-level E57 element data types, but do not have all the required element names required by ASTM E57 file format standard use the file extension "._e57".
[in]modeEither "w" for writing or "r" for reading.
[in]checksumPolicyThe percentage of checksums we compute and verify as an int. Clamped to 0-100.
Write Mode
In write mode, the file cannot be already open. A file with name given by fname is immediately created on the disk. This file may grow as a result of operations on the ImageFile. Which API functions write data to the file are implementation dependent. Thus any API operation that stores data may fail as a result of insufficient free disk space. Read API operations are legal for an ImageFile opened in write mode.
Read Mode
Read mode files may be shared. Write API operations are not legal for an ImageFile opened in read mode (i.e. the ImageFile is read-only). There is no API support for appending data onto an existing E57 data file.
Postcondition
Resulting ImageFile is in open state if constructor succeeds (no exception thrown).
Exceptions
ErrorBadAPIArgument
ErrorOpenFailed
ErrorSeekFailed
ErrorReadFailed
ErrorWriteFailed
ErrorBadChecksum
ErrorBadFileSignature
ErrorUnknownFileVersion
ErrorBadFileLength
ErrorXMLParserInit
ErrorXMLParser
ErrorBadXMLFormat
ErrorBadConfiguration
ErrorInternalAll objects in undocumented state
See also
IntegerNode, ScaledIntegerNode, FloatNode, StringNode, BlobNode, StructureNode, VectorNode, CompressedVectorNode, E57Exception, E57Utilities::E57Utilities

◆ ImageFile() [3/3]

ImageFile::ImageFile ( const char *  input,
uint64_t  size,
ReadChecksumPolicy  checksumPolicy = ChecksumAll 
)

Member Function Documentation

◆ cancel()

void ImageFile::cancel ( )

Stop I/O operations and delete a partially written ImageFile on the disk.

If the ImageFile is write mode, the associated file on the disk is closed and deleted, and the ImageFile goes to the closed state. If the ImageFile is read mode, the behavior is same as calling ImageFile::close, but no exceptions are thrown. It is not an error if ImageFile is already closed.

Postcondition
ImageFile is in closed state.
Exceptions
NoE57Exceptions.
See also
ImageFile::ImageFile, ImageFile::close, ImageFile::isOpen

◆ checkInvariant()

void ImageFile::checkInvariant ( bool  doRecurse = true) const

Check whether ImageFile class invariant is true.

Parameters
[in]doRecurseIf true, also check invariants of all children or sub-objects recursively.

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 violated, an E57Exception with errorCode of ErrorInvarianceViolation is thrown.

Checking the invariant recursively may be expensive if the tree is large, so should be used judiciously, in debug versions of the application.

Postcondition
No visible state is modified.
Exceptions
ErrorInvarianceViolationor any other E57 ErrorCode
See also
Node::checkInvariant

◆ close()

void ImageFile::close ( )

Complete any write operations on an ImageFile, and close the file on the disk.

Completes the writing of the state of the ImageFile to the disk. Some API implementations may store significant portions of the state of the ImageFile in memory. This state is moved into the disk file before it is closed. Any errors in finishing the writing are reported by throwing an exception. If an exception is thrown, depending on the error code, the ImageFile may enter the closed state. If no exception is thrown, then the file on disk will be an accurate representation of the ImageFile.

Warning
If the ImageFile::close function is not called, and the ImageFile destructor is invoked with the ImageFile in the open state, the associated disk file will be deleted and the ImageFile will not be saved to the disk (the same outcome as calling ImageFile::cancel). The reason for this is that any error conditions can't be reported from a destructor, so the user can't be assured that the destruction/close completed successfully. It is strongly recommended that this close function be called before the ImageFile is destroyed.

It is not an error if ImageFile is already closed.

Postcondition
ImageFile is in closed state.
Exceptions
ErrorSeekFailed
ErrorReadFailed
ErrorWriteFailed
ErrorCloseFailed
ErrorBadChecksum
ErrorInternalAll objects in undocumented state
See also
ImageFile::cancel, ImageFile::isOpen

◆ dump()

void ImageFile::dump ( int  indent = 0,
std::ostream &  os = std::cout 
) const

Diagnostic function to print internal state of object to output stream in an indented format.

Parameters
[in]indentNumber of spaces to indent all the printed lines of this object.
[in]osOutput stream to print on.

All objects in the E57 Foundation API (with exception of E57Exception) support a dump() function. These functions print out to the console a detailed listing of the internal state of objects. The content of these printouts is not documented, and is really of interest only to implementation developers/maintainers or the really adventurous users. In implementations of the API other than the Reference Implementation, the dump() functions may produce no output (although the functions should still be defined). The output format may change from version to version.

Postcondition
No visible object state is modified.
Exceptions
NoE57Exceptions

◆ elementNameParse()

void ImageFile::elementNameParse ( const ustring elementName,
ustring prefix,
ustring localPart 
) const

Parse element name into prefix and localPart substrings.

Parameters
[in]elementNameThe string element name to parse into prefix and local parts.
[out]prefixThe prefix (if any) in the elementName.
[out]localPartThe part of the element name after the prefix.

A legal element name may be in prefixed (ID:ID) or unprefixed (ID) form, where ID is a string whose first character is in {a-z,A-Z,_} followed by zero or more characters in {a-z,A-Z,_,0-9,-,.}. If in prefixed form, the prefix does not have to be declared in the ImageFile.

Postcondition
No visible state is modified.
Exceptions
ErrorBadPathName
ErrorInternalAll objects in undocumented state
See also
ImageFile::isElementNameExtended

◆ extensionsAdd()

void ImageFile::extensionsAdd ( const ustring prefix,
const ustring uri 
)

Declare the use of an E57 extension in an ImageFile being written.

Parameters
[in]prefixThe shorthand name of the extension to use in element names.
[in]uriThe Uniform Resource Identifier string to associate with the prefix in the ImageFile.

The (prefix, uri) pair is registered in the known extensions of the ImageFile. Both prefix and uri must be unique in the ImageFile. It is not legal to declare a URI associated with the default namespace (prefix = ""). It is not an error to declare a namespace and not use it in an element name. It is an error to use a namespace prefix in an element name that is not declared beforehand.

A writer is free to "hard code" the prefix names in the element name strings that it uses (since it established the prefix declarations in the file). A reader cannot assume that any given prefix is always mapped to the same URI or vice versa. A reader might check an ImageFile, and if the prefixes aren't the way it likes, the reader could give up.

A better scheme would be to lookup the URI that the reader is familiar with, and store the prefix that the particular file uses in a variable. Then every time the reader needs to form a prefixed element name, it can assemble the full element name from the stored prefix variable and the constant documented base name string. This is less convenient than using a single "hard coded" string constant for an element name, but it is robust against any choice of prefix/URI combination.

See the class discussion at bottom of ImageFile page for more details about namespaces.

Precondition
This ImageFile must be open (i.e. isOpen()).
ImageFile must have been opened in write mode (i.e. isWritable()).
prefix != ""
uri != ""
Exceptions
ErrorBadAPIArgument
ErrorImageFileNotOpen
ErrorFileReadOnly
ErrorDuplicateNamespacePrefix
ErrorDuplicateNamespaceURI
ErrorInternalAll objects in undocumented state
See also
ImageFile::extensionsCount, ImageFile::extensionsLookupPrefix, ImageFile::extensionsLookupUri

◆ extensionsCount()

size_t ImageFile::extensionsCount ( ) const

Get number of E57 extensions declared in the ImageFile.

The default E57 namespace does not count as an extension.

Precondition
This ImageFile must be open (i.e. isOpen()).
Postcondition
No visible state is modified.
Returns
The number of E57 extensions defined in the ImageFile.
Exceptions
ErrorImageFileNotOpen
ErrorInternalAll objects in undocumented state
See also
ImageFile::extensionsPrefix, ImageFile::extensionsUri

◆ extensionsLookupPrefix() [1/2]

bool ImageFile::extensionsLookupPrefix ( const ustring prefix) const

Look up an E57 extension prefix in the ImageFile.

Parameters
[in]prefixThe shorthand name of the extension to look up.

If prefix = "" or prefix is declared in the ImageFile, then the function returns true. It is an error if prefix contains an illegal character combination for E57 namespace prefixes.

Precondition
This ImageFile must be open (i.e. isOpen()).
Postcondition
No visible state is modified.
Returns
true if prefix is declared in the ImageFile.
Exceptions
ErrorBadAPIArgument
ErrorImageFileNotOpen
ErrorInternalAll objects in undocumented state
See also
ImageFile::extensionsLookupUri

◆ extensionsLookupPrefix() [2/2]

bool ImageFile::extensionsLookupPrefix ( const ustring prefix,
ustring uri 
) const

Get URI associated with an E57 extension prefix in the ImageFile.

Parameters
[in]prefixThe shorthand name of the extension to look up.
[out]uriThe URI that was associated with the given prefix.

If prefix = "", then uri is set to the default namespace URI, and the function returns true. if prefix is declared in the ImageFile, then uri is set the corresponding URI, and the function returns true. It is an error if prefix contains an illegal character combination for E57 namespace prefixes. It is not an error if prefix is well-formed, but not defined in the ImageFile (the function just returns false).

Precondition
This ImageFile must be open (i.e. isOpen()).
Postcondition
No visible state is modified.
Returns
true if prefix is declared in the ImageFile.
Exceptions
ErrorBadAPIArgument
ErrorImageFileNotOpen
ErrorInternalAll objects in undocumented state
See also
ImageFile::extensionsLookupUri

◆ extensionsLookupUri()

bool ImageFile::extensionsLookupUri ( const ustring uri,
ustring prefix 
) const

Get an E57 extension prefix associated with a URI in the ImageFile.

Parameters
[in]uriThe URI of the extension to look up.
[out]prefixThe shorthand prefix that was associated with the given uri.

If uri is declared in the ImageFile, then prefix is set the corresponding prefix, and the function returns true. It is an error if uri contains an illegal character combination for E57 namespace URIs. It is not an error if uri is well-formed, but not defined in the ImageFile (the function just returns false).

Precondition
This ImageFile must be open (i.e. isOpen()).
uri != ""
Postcondition
No visible state is modified.
Returns
true if URI is declared in the ImageFile.
Exceptions
ErrorBadAPIArgument
ErrorImageFileNotOpen
ErrorInternalAll objects in undocumented state
See also
ImageFile::extensionsLookupPrefix

◆ extensionsPrefix()

ustring ImageFile::extensionsPrefix ( size_t  index) const

Get an E57 extension prefix declared in an ImageFile by index.

Parameters
[in]indexThe index of the prefix to get, starting at 0.

The order that the prefixes are stored in is not necessarily the same as the order they were created. However the prefix order will correspond to the URI order. The default E57 namespace is not counted as an extension.

Precondition
This ImageFile must be open (i.e. isOpen()).
0 <= index < extensionsCount()
Postcondition
No visible state is modified.
Returns
The E57 extension prefix at the given index.
Exceptions
ErrorBadAPIArgument
ErrorImageFileNotOpen
ErrorInternalAll objects in undocumented state
See also
ImageFile::extensionsCount, ImageFile::extensionsUri

◆ extensionsUri()

ustring ImageFile::extensionsUri ( size_t  index) const

Get an E57 extension URI declared in an ImageFile by index.

Parameters
[in]indexThe index of the URI to get, starting at 0.

The order that the URIs are stored is not necessarily the same as the order they were created. However the URI order will correspond to the prefix order. The default E57 namespace is not counted as an extension.

Precondition
This ImageFile must be open (i.e. isOpen()).
0 <= index < extensionsCount()
Postcondition
No visible state is modified.
Returns
The E57 extension URI at the given index.
Exceptions
ErrorBadAPIArgument
ErrorImageFileNotOpen
ErrorInternalAll objects in undocumented state
See also
ImageFile::extensionsCount, ImageFile::extensionsPrefix

◆ fileName()

ustring ImageFile::fileName ( ) const

Get the file name the ImageFile was created with.

Postcondition
No visible state is modified.
Returns
The file name the ImageFile was created with.
Exceptions
NoE57Exceptions.
See also
ImageFile::ImageFile

◆ isElementNameExtended()

bool ImageFile::isElementNameExtended ( const ustring elementName) const

Test whether an E57 element name has an extension prefix.

The element name has a prefix if the function elementNameParse(elementName,prefix,dummy) would succeed, and returned prefix != "".

Parameters
[in]elementNameThe string element name to test.
Postcondition
No visible state is modified.
Returns
True if the E57 element name has an extension prefix.
Exceptions
NoE57Exceptions.

◆ isOpen()

bool ImageFile::isOpen ( ) const

Test whether ImageFile is still open for accessing.

Postcondition
No visible state is modified.
Returns
true if ImageFile is in open state.
Exceptions
NoE57Exceptions.
See also
ImageFile::ImageFile, ImageFile::close

◆ isWritable()

bool ImageFile::isWritable ( ) const

Test whether ImageFile was opened in write mode.

Postcondition
No visible state is modified.
Returns
true if ImageFile was opened in write mode.
Exceptions
NoE57Exceptions.
See also
ImageFile::ImageFile, ImageFile::isOpen

◆ operator!=()

bool ImageFile::operator!= ( const ImageFile imf2) const

Test if two ImageFile handles refer to different underlying ImageFile.

Parameters
[in]imf2The ImageFile to compare this ImageFile with
Postcondition
No visible object state is modified.
Returns
true if ImageFile handles refer to different underlying ImageFiles.
Exceptions
NoE57Exceptions

◆ operator==()

bool ImageFile::operator== ( const ImageFile imf2) const

Test if two ImageFile handles refer to the same underlying ImageFile.

Parameters
[in]imf2The ImageFile to compare this ImageFile with
Postcondition
No visible object state is modified.
Returns
true if ImageFile handles refer to the same underlying ImageFile.
Exceptions
NoE57Exceptions

◆ readerCount()

int ImageFile::readerCount ( ) const

Get current number of open CompressedVectorReader objects reading from ImageFile.

CompressedVectorReader objects that still exist, but are in the closed state aren't counted. CompressedVectorReader objects are created by the CompressedVectorNode::reader function.

Precondition
This ImageFile must be open (i.e. isOpen()).
Postcondition
No visible state is modified.
Returns
The current number of open CompressedVectorReader objects reading from ImageFile.
Exceptions
ErrorImageFileNotOpen
ErrorInternalAll objects in undocumented state
See also
CompressedVectorNode::reader, CompressedVectorReader

◆ root()

StructureNode ImageFile::root ( ) const

Get the pre-established root StructureNode of the E57 ImageFile.

The root node of an ImageFile always exists and is always type StructureNode. The root node is empty in a newly created write mode ImageFile.

Precondition
This ImageFile must be open (i.e. isOpen()).
Returns
A smart StructureNode handle referencing the underlying object.
Exceptions
ErrorImageFileNotOpen
ErrorInternalAll objects in undocumented state
See also
StructureNode.

◆ writerCount()

int ImageFile::writerCount ( ) const

Get current number of open CompressedVectorWriter objects writing to ImageFile.

CompressedVectorWriter objects that still exist, but are in the closed state aren't counted. CompressedVectorWriter objects are created by the CompressedVectorNode::writer function.

Precondition
This ImageFile must be open (i.e. isOpen()).
Postcondition
No visible state is modified.
Returns
The current number of open CompressedVectorWriter objects writing to ImageFile.
Exceptions
ErrorImageFileNotOpen
ErrorInternalAll objects in undocumented state
See also
CompressedVectorNode::writer, CompressedVectorWriter

The documentation for this class was generated from the following files: