Arcane  4.1.12.0
Developer documentation
Loading...
Searching...
No Matches
Arcane::IOMng Class Reference

Input/Output Manager. More...

Inheritance diagram for Arcane::IOMng:
Collaboration diagram for Arcane::IOMng:

Public Member Functions

 IOMng (IParallelSuperMng *psm)
 IOMng (IParallelMng *pm)
IXmlDocumentHolderparseXmlFile (const String &filename, const String &schemaname=String()) override
 Reads and parses the XML file filename.
IXmlDocumentHolderparseXmlFile (const String &filename, const String &schemaname, ByteConstArrayView schema_data) override
IXmlDocumentHolderparseXmlBuffer (Span< const Byte > buffer, const String &name) override
 Reads and parses the XML file contained in the buffer buffer.
IXmlDocumentHolderparseXmlBuffer (Span< const std::byte > buffer, const String &name) override
 Reads and parses the XML file contained in the buffer buffer.
IXmlDocumentHolderparseXmlString (const String &str, const String &name) override
 Reads and parses the XML file contained in the string str.
bool writeXmlFile (IXmlDocumentHolder *doc, const String &filename, const bool indented) override
 Writes the XML tree of the document doc to the file filename.
bool collectiveRead (const String &filename, ByteArray &bytes) override
 Collective reading of a file.
bool collectiveRead (const String &filename, ByteArray &bytes, bool is_binary) override
 Collective reading of a file.
bool localRead (const String &filename, ByteArray &bytes) override
 Local reading of a file.
bool localRead (const String &filename, ByteArray &bytes, bool is_binary) override
 Local reading of a file.
Public Member Functions inherited from Arcane::IIOMng
virtual ~IIOMng ()=default
 Frees resources.
virtual IXmlDocumentHolderparseXmlFile (const String &filename, const String &schemaname, ConstArrayView< Byte > schema_data)=0
 Reads and parses the XML file filename.

Private Member Functions

template<typename ParallelMngType>
bool _collectiveRead (ParallelMngType *pm, const String &filename, ByteArray &bytes, bool is_binary)

Private Attributes

IParallelMngm_parallel_mng
IParallelSuperMngm_parallel_super_mng
IThreadMngm_thread_mng
ITraceMngm_trace_mng

Detailed Description

Input/Output Manager.

Definition at line 42 of file IOMng.cc.

Constructor & Destructor Documentation

◆ IOMng() [1/2]

Arcane::IOMng::IOMng ( IParallelSuperMng * psm)

Definition at line 109 of file IOMng.cc.

◆ IOMng() [2/2]

Arcane::IOMng::IOMng ( IParallelMng * pm)

Definition at line 97 of file IOMng.cc.

◆ ~IOMng()

Arcane::IOMng::~IOMng ( )
override

Definition at line 121 of file IOMng.cc.

Member Function Documentation

◆ _collectiveRead()

template<typename ParallelMngType>
bool Arcane::IOMng::_collectiveRead ( ParallelMngType * pm,
const String & filename,
ByteArray & bytes,
bool is_binary )
private

Definition at line 202 of file IOMng.cc.

◆ collectiveRead() [1/2]

bool Arcane::IOMng::collectiveRead ( const String & filename,
ByteArray & bytes )
inlineoverridevirtual

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.

Implements Arcane::IIOMng.

Definition at line 57 of file IOMng.cc.

References collectiveRead().

Referenced by collectiveRead().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ collectiveRead() [2/2]

bool Arcane::IOMng::collectiveRead ( const String & filename,
ByteArray & bytes,
bool is_binary )
overridevirtual

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.

Implements Arcane::IIOMng.

Definition at line 229 of file IOMng.cc.

◆ localRead() [1/2]

bool Arcane::IOMng::localRead ( const String & filename,
ByteArray & bytes )
inlineoverridevirtual

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))

Implements Arcane::IIOMng.

Definition at line 62 of file IOMng.cc.

References localRead().

Referenced by localRead().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ localRead() [2/2]

bool Arcane::IOMng::localRead ( const String & filename,
ByteArray & bytes,
bool is_binary )
overridevirtual

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))

Implements Arcane::IIOMng.

Definition at line 240 of file IOMng.cc.

References Arcane::platform::readAllFile().

Here is the call graph for this function:

◆ parseXmlBuffer() [1/2]

IXmlDocumentHolder * Arcane::IOMng::parseXmlBuffer ( Span< const Byte > buffer,
const String & name )
overridevirtual

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.

Implements Arcane::IIOMng.

Definition at line 170 of file IOMng.cc.

References Arcane::IXmlDocumentHolder::loadFromBuffer().

Here is the call graph for this function:

◆ parseXmlBuffer() [2/2]

IXmlDocumentHolder * Arcane::IOMng::parseXmlBuffer ( Span< const std::byte > buffer,
const String & name )
overridevirtual

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.

Implements Arcane::IIOMng.

Definition at line 179 of file IOMng.cc.

References Arcane::IXmlDocumentHolder::loadFromBuffer().

Here is the call graph for this function:

◆ parseXmlFile() [1/2]

IXmlDocumentHolder * Arcane::IOMng::parseXmlFile ( const String & filename,
const String & schemaname,
ByteConstArrayView schema_data )
override

Definition at line 157 of file IOMng.cc.

◆ parseXmlFile() [2/2]

IXmlDocumentHolder * Arcane::IOMng::parseXmlFile ( const String & filename,
const String & schemaname = String() )
overridevirtual

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.

Implements Arcane::IIOMng.

Definition at line 148 of file IOMng.cc.

References Arcane::IXmlDocumentHolder::loadFromFile().

Here is the call graph for this function:

◆ parseXmlString()

IXmlDocumentHolder * Arcane::IOMng::parseXmlString ( const String & str,
const String & name )
overridevirtual

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.

Implements Arcane::IIOMng.

Definition at line 188 of file IOMng.cc.

References Arcane::dom::DOMImplementation::_load(), Arcane::ConstArrayView< T >::data(), Arcane::ConstArrayView< T >::size(), and Arcane::String::utf8().

Here is the call graph for this function:

◆ writeXmlFile()

bool Arcane::IOMng::writeXmlFile ( IXmlDocumentHolder * doc,
const String & filename,
const bool indented )
overridevirtual

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.

Implements Arcane::IIOMng.

Definition at line 129 of file IOMng.cc.

References Arcane::IXmlDocumentHolder::documentNode(), Arcane::XmlNode::domNode(), and Arcane::String::localstr().

Here is the call graph for this function:

Member Data Documentation

◆ m_parallel_mng

IParallelMng* Arcane::IOMng::m_parallel_mng
private

Definition at line 70 of file IOMng.cc.

◆ m_parallel_super_mng

IParallelSuperMng* Arcane::IOMng::m_parallel_super_mng
private

Definition at line 71 of file IOMng.cc.

◆ m_thread_mng

IThreadMng* Arcane::IOMng::m_thread_mng
private

Definition at line 72 of file IOMng.cc.

◆ m_trace_mng

ITraceMng* Arcane::IOMng::m_trace_mng
private

Definition at line 73 of file IOMng.cc.


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