Samchon Framework for CPP
1.0.0
Main Page
Related Pages
Namespaces
Classes
Files
File List
ExternalServerArray.hpp
1
#pragma once
2
#include <samchon/API.hpp>
3
4
#include <samchon/templates/external/ExternalSystemArray.hpp>
5
# include <samchon/templates/external/ExternalServer.hpp>
6
7
#include <thread>
8
9
namespace
samchon
10
{
11
namespace
templates
12
{
13
namespace
external
14
{
28
template
<
class
System = ExternalServer>
29
class
ExternalServerArray
30
:
public
virtual
ExternalSystemArray
<System>
31
{
32
public
:
36
ExternalServerArray
()
37
:
ExternalSystemArray
<System>()
38
{
39
};
40
virtual
~
ExternalServerArray
() =
default
;
41
47
virtual
void
connect
()
48
{
49
std::vector<std::thread> thread_array;
50
51
for
(
size_t
i = 0; i < size(); i++)
52
{
53
auto
external_server = std::dynamic_pointer_cast<
ExternalServer
>(this->at(i));
54
if
(external_server ==
nullptr
)
55
continue
;
56
57
thread_array.emplace_back(&
ExternalServer::connect
, external_server.get());
58
}
59
60
for
(
size_t
i = 0; i < thread_array.size(); i++)
61
thread_array[i].join();
62
};
63
};
64
};
65
};
66
};
samchon::templates::external::ExternalServerArray::ExternalServerArray
ExternalServerArray()
Definition:
ExternalServerArray.hpp:36
samchon::templates::external::ExternalServer
Definition:
ExternalServer.hpp:25
samchon::templates::external::ExternalSystemArray
Definition:
ExternalSystemArray.hpp:68
samchon::templates::external::ExternalServerArray::connect
virtual void connect()
Definition:
ExternalServerArray.hpp:47
samchon::templates::external::ExternalServer::connect
virtual void connect()
Definition:
ExternalServer.hpp:75
samchon
Definition:
ByteArray.hpp:6
samchon::templates::external::ExternalServerArray
Definition:
ExternalServerArray.hpp:29
cpp
samchon
templates
external
ExternalServerArray.hpp
Generated by
1.8.11