preCICE v3.1.1
Loading...
Searching...
No Matches
ConnectionInfoPublisher.hpp
Go to the documentation of this file.
1#pragma once
2#include <string>
3#include <string_view>
4#include <utility>
5
6#include "logging/Logger.hpp"
8
9namespace precice::com {
10
11namespace impl {
13
17std::string hashedFilePath(std::string_view acceptorName, std::string_view requesterName, std::string_view meshName, Rank rank);
18
22std::string localDirectory(std::string_view acceptorName, std::string_view requesterName, std::string_view addressDirectory);
23} // namespace impl
24
66
90
92
124
125} // namespace precice::com
std::string getLocalDirectory() const
Returns the local directory which is used to store the hashed part.
ConnectionInfoPublisher(std::string_view acceptorName, std::string_view requesterName, std::string_view tag, std::string_view addressDirectory) noexcept
ConnectionInfoPublisher(std::string_view acceptorName, std::string_view requesterName, std::string_view tag, int rank, std::string_view addressDirectory) noexcept
std::string getFilename() const
Returns the full path to the hashed filename.
Reads the connection info for the given participant/rank information.
ConnectionInfoReader(std::string_view acceptorName, std::string_view requesterName, std::string_view tag, int rank, std::string_view addressDirectory) noexcept
std::string read() const
Reads the info from the connection info file. Will block, if the the file is not present.
ConnectionInfoReader(std::string_view acceptorName, std::string_view requesterName, std::string_view tag, std::string_view addressDirectory) noexcept
Writes the connection info for the given participant/rank information.
ConnectionInfoWriter(std::string_view acceptorName, std::string_view requesterName, std::string_view tag, std::string_view addressDirectory) noexcept
void write(std::string_view info) const
Write the string info, e.g. IP:port to the connection info file.
ConnectionInfoWriter(std::string_view acceptorName, std::string_view requesterName, std::string_view tag, int rank, std::string_view addressDirectory) noexcept
~ConnectionInfoWriter()
Removes the connection info file and the directories ./precice-run/[hash], is empty.
This class provides a lightweight logger.
Definition Logger.hpp:16
std::string hashedFilePath(std::string_view acceptorName, std::string_view requesterName, std::string_view meshName, Rank rank)
Returns the file name for the connection information.
std::string localDirectory(std::string_view acceptorName, std::string_view requesterName, std::string_view addressDirectory)
contains the data communication abstraction layer.
int Rank
Definition Types.hpp:37
static std::unique_ptr< precice::Participant > impl
Definition preciceC.cpp:21