preCICE
v3.1.2
Loading...
Searching...
No Matches
src
com
SocketCommunicationFactory.hpp
Go to the documentation of this file.
1
#pragma once
2
3
#include "
CommunicationFactory.hpp
"
4
#include "
com/SharedPointer.hpp
"
5
#include "
utils/networking.hpp
"
6
7
#include <
string
>
8
9
namespace
precice
{
10
namespace
com {
11
class
SocketCommunicationFactory
:
public
CommunicationFactory
{
12
public
:
13
SocketCommunicationFactory
(
unsigned
short
portNumber = 0,
14
bool
reuseAddress =
false
,
15
std::string
networkName =
utils::networking::loopbackInterfaceName
(),
16
std::string
addressDirectory
=
"."
);
17
18
explicit
SocketCommunicationFactory
(
std::string
const
&
addressDirectory
);
19
20
PtrCommunication
newCommunication
()
override
;
21
22
std::string
addressDirectory
()
override
;
23
24
private
:
25
unsigned
short
_portNumber
;
26
bool
_reuseAddress
;
27
std::string
_networkName
;
28
std::string
_addressDirectory
;
29
};
30
}
// namespace com
31
}
// namespace precice
CommunicationFactory.hpp
std::string
precice::com::CommunicationFactory
Definition
CommunicationFactory.hpp:9
precice::com::SocketCommunicationFactory
Definition
SocketCommunicationFactory.hpp:11
precice::com::SocketCommunicationFactory::_reuseAddress
bool _reuseAddress
Definition
SocketCommunicationFactory.hpp:26
precice::com::SocketCommunicationFactory::addressDirectory
std::string addressDirectory() override
Definition
SocketCommunicationFactory.cpp:37
precice::com::SocketCommunicationFactory::_portNumber
unsigned short _portNumber
Definition
SocketCommunicationFactory.hpp:25
precice::com::SocketCommunicationFactory::SocketCommunicationFactory
SocketCommunicationFactory(unsigned short portNumber=0, bool reuseAddress=false, std::string networkName=utils::networking::loopbackInterfaceName(), std::string addressDirectory=".")
Definition
SocketCommunicationFactory.cpp:10
precice::com::SocketCommunicationFactory::_networkName
std::string _networkName
Definition
SocketCommunicationFactory.hpp:27
precice::com::SocketCommunicationFactory::newCommunication
PtrCommunication newCommunication() override
Definition
SocketCommunicationFactory.cpp:31
precice::com::SocketCommunicationFactory::_addressDirectory
std::string _addressDirectory
Definition
SocketCommunicationFactory.hpp:28
SharedPointer.hpp
precice::utils::networking::loopbackInterfaceName
std::string loopbackInterfaceName()
Returns the name of the canonical loopback interface on this system.
Definition
networking.cpp:5
precice
Main namespace of the precice library.
Definition
Acceleration.cpp:5
networking.hpp
std::shared_ptr< Communication >
string