Arcane  4.1.12.0
Developer documentation
Loading...
Searching...
No Matches
Arcane::IIOMng Class Referenceabstract

Interface of the input/output manager. More...

#include <arcane/core/IIOMng.h>

Inheritance diagram for Arcane::IIOMng:
Collaboration diagram for Arcane::IIOMng:

Public Member Functions

virtual ~IIOMng ()=default
 Frees resources.
virtual IXmlDocumentHolderparseXmlFile (const String &filename, const String &schemaname=String{})=0
 Reads and parses the XML file filename.
virtual IXmlDocumentHolderparseXmlFile (const String &filename, const String &schemaname, ConstArrayView< Byte > schema_data)=0
 Reads and parses the XML file filename.
virtual IXmlDocumentHolderparseXmlBuffer (Span< const Byte > buffer, const String &name)=0
 Reads and parses the XML file contained in the buffer buffer.
virtual IXmlDocumentHolderparseXmlBuffer (Span< const std::byte > buffer, const String &name)=0
 Reads and parses the XML file contained in the buffer buffer.
virtual IXmlDocumentHolderparseXmlString (const String &str, const String &name)=0
 Reads and parses the XML file contained in the string str.
virtual bool writeXmlFile (IXmlDocumentHolder *doc, const String &filename, const bool indented=false)=0
 Writes the XML tree of the document doc to the file filename.
virtual bool collectiveRead (const String &filename, ByteArray &bytes)=0
 Collective reading of a file.
virtual bool collectiveRead (const String &filename, ByteArray &bytes, bool is_binary)=0
 Collective reading of a file.
virtual bool localRead (const String &filename, ByteArray &bytes)=0
 Local reading of a file.
virtual bool localRead (const String &filename, ByteArray &bytes, bool is_binary)=0
 Local reading of a file.

Detailed Description

Interface of the input/output manager.

Todo
input/output manager allowing encapsulation of file management in parallel.

Definition at line 36 of file IIOMng.h.

Member Function Documentation

◆ collectiveRead() [1/2]

virtual bool Arcane::IIOMng::collectiveRead ( const String & filename,
ByteArray & bytes )
pure virtual

Collective reading of a file.

Collectively reads the file filename and returns its content in bytes. The file is considered a binary file. Collective reading means that all processors call this operation and will read the same file. The implementation can then optimize disk access by grouping the actual reading on one or more processors and then sending the file content to the others.

Return values
truein case of an error
falseif everything is okay.

Implemented in Arcane::IOMng.

Referenced by Arcane::ArcaneMainBatch::execute(), and Arcane::CheckpointMng::readDefaultCheckpointInfo().

Here is the caller graph for this function:

◆ collectiveRead() [2/2]

virtual bool Arcane::IIOMng::collectiveRead ( const String & filename,
ByteArray & bytes,
bool is_binary )
pure virtual

Collective reading of a file.

Collectively reads the file filename and returns its content in bytes. The file is considered a binary file if is_binary is true. Collective reading means that all processors call this operation and will read the same file. The implementation can then optimize disk access by grouping the actual reading on one or more processors and then sending the file content to the others.

Return values
truein case of an error
falseif everything is okay.

Implemented in Arcane::IOMng.

◆ localRead() [1/2]

virtual bool Arcane::IIOMng::localRead ( const String & filename,
ByteArray & bytes )
pure virtual

Local reading of a file.

Locally reads the file filename and returns its content in bytes. The file is considered a binary file. This operation is not collective.

Return values
truein case of an error.
falseif everything is okay.
Warning
also returns true if the file is empty.
if the ByteUniqueArray must be converted to a String, a terminal 0 must be added beforehand (bytes.add(0))

Implemented in Arcane::IOMng.

◆ localRead() [2/2]

virtual bool Arcane::IIOMng::localRead ( const String & filename,
ByteArray & bytes,
bool is_binary )
pure virtual

Local reading of a file.

Locally reads the file filename and returns its content in bytes. This operation is not collective.

Return values
truein case of an error.
falseif everything is okay.
Warning
also returns true if the file is empty.
if the ByteUniqueArray must be converted to a String, a terminal 0 must be added beforehand (bytes.add(0))

Implemented in Arcane::IOMng.

◆ parseXmlBuffer() [1/2]

virtual IXmlDocumentHolder * Arcane::IIOMng::parseXmlBuffer ( Span< const Byte > buffer,
const String & name )
pure virtual

Reads and parses the XML file contained in the buffer buffer.

In case of an error, returns 0. The caller owns the returned instance and must destroy it using the delete operator. The argument name associates a name with the memory area that is used for displaying error messages.

Implemented in Arcane::IOMng.

Referenced by Arcane::InternalInfosDumper::dumpArcaneDatabase(), and Arcane::Hdf5VariableReaderHelper2::open().

Here is the caller graph for this function:

◆ parseXmlBuffer() [2/2]

virtual IXmlDocumentHolder * Arcane::IIOMng::parseXmlBuffer ( Span< const std::byte > buffer,
const String & name )
pure virtual

Reads and parses the XML file contained in the buffer buffer.

In case of an error, returns 0. The caller owns the returned instance and must destroy it using the delete operator. The argument name associates a name with the memory area that is used for displaying error messages.

Implemented in Arcane::IOMng.

◆ parseXmlFile() [1/2]

virtual IXmlDocumentHolder * Arcane::IIOMng::parseXmlFile ( const String & filename,
const String & schemaname,
ConstArrayView< Byte > schema_data )
pure virtual

Reads and parses the XML file filename.

In case of an error, returns 0. The caller owns the returned instance and must destroy it using the delete operator. The consistency of the file relative to the schema is checked; The schema name is provided only for error message processing.

◆ parseXmlFile() [2/2]

virtual IXmlDocumentHolder * Arcane::IIOMng::parseXmlFile ( const String & filename,
const String & schemaname = String{} )
pure virtual

Reads and parses the XML file filename.

In case of an error, returns 0. The caller owns the returned instance and must destroy it using the delete operator. If a schema name is specified, the consistency of the file relative to the schema is checked.

Implemented in Arcane::IOMng.

Referenced by Arcane::LimaCutInfosReader::_readUniqueIndex(), and Arcane::Hdf5VariableReaderHelper::open().

Here is the caller graph for this function:

◆ parseXmlString()

virtual IXmlDocumentHolder * Arcane::IIOMng::parseXmlString ( const String & str,
const String & name )
pure virtual

Reads and parses the XML file contained in the string str.

In case of an error, returns 0. The caller owns the returned instance and must destroy it using the delete operator. The argument name associates a name with the memory area that is used for displaying error messages.

Implemented in Arcane::IOMng.

Referenced by Arcane::TimeHistoryMngInternal::readVariables().

Here is the caller graph for this function:

◆ writeXmlFile()

virtual bool Arcane::IIOMng::writeXmlFile ( IXmlDocumentHolder * doc,
const String & filename,
const bool indented = false )
pure virtual

Writes the XML tree of the document doc to the file filename.

Return values
truein case of an error,
Returns
false in case of success.

Implemented in Arcane::IOMng.

Referenced by Arcane::ManualHdf5VariableWriter::notifyEndWrite().

Here is the caller graph for this function:

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