Covellite++
Version: 2.3.2 Revision: 2584 Platform: x64 Build: 19:03 05.09.2026
Кроссплатформенный фреймворк для разработки приложений на С++
Toggle main menu visibility
Загрузка...
Поиск...
Не найдено
GraphicApi.CapturingServiceComponent.cpp
1
2
#include "stdafx.h"
3
#include "GraphicApi.hpp"
4
#include <Covellite/Api/Component.inl>
5
6
namespace
covellite
7
{
8
9
namespace
api
10
{
11
12
namespace
renderer
13
{
14
40
/*static*/
auto
GraphicApi::CapturingServiceComponent::Get
(
41
const
ComponentPtr_t & _pMainComponent,
42
const
Expected_t & _Expected) -> Services_t
43
{
44
Services_t & Source = (*_pMainComponent)[uT(
"service"
)].Default(Services_t{});
45
Services_t Result;
46
47
for
(
const
auto
& Info : _Expected)
48
{
49
auto
itResult = ::std::find_if(Source.rbegin(), Source.rend(),
50
[&](
const
ComponentPtr_t & _pComponent)
51
{ return Info.first == _pComponent->Kind; });
52
53
if
(itResult != Source.rend())
54
{
55
Result.push_back(*itResult);
56
Source.erase(::std::next(itResult).base());
57
}
58
else
59
{
60
Result.push_back(Info.second);
61
}
62
}
63
64
if
(!Source.empty())
65
{
66
// 14 Февраль 2019 16:29 (unicornum.verum@gmail.com)
67
TODO(
"Писать в лог warning'и о лишних компонентах."
);
68
69
Source.clear();
70
}
71
72
return
Result;
73
}
74
92
/*static*/
void
GraphicApi::CapturingServiceComponent::Process
(
93
const
ComponentPtr_t & _pMainComponent,
94
const
Handlers_t & _PreRenders)
95
{
96
Services_t & Source = (*_pMainComponent)[uT(
"service"
)].Default(Services_t{});
97
98
for
(
const
auto
& pComponent : Source)
99
{
100
auto
itComponent = _PreRenders.find(pComponent->Kind);
101
if
(itComponent != _PreRenders.end())
102
{
103
itComponent->second(pComponent);
104
}
105
else
106
{
107
// 13 Декабрь 2018 14:22 (unicornum.verum@gmail.com)
108
TODO(
"Писать в лог warning о лишнем компоненте."
);
109
}
110
}
111
112
Source.clear();
113
}
114
115
}
// namespace renderer
116
117
}
// namespace api
118
119
}
// namespace covellite
covellite::api::renderer::GraphicApi::CapturingServiceComponent::Process
static void Process(const ComponentPtr_t &, const Handlers_t &)
Функция для последовательной обработки очереди вспомогательных компонентов.
Определения
GraphicApi.CapturingServiceComponent.cpp:92
covellite::api::renderer::GraphicApi::CapturingServiceComponent::Get
static Services_t Get(const ComponentPtr_t &, const Expected_t &)
Функция получения набора вспомогательных компонентов.
Определения
GraphicApi.CapturingServiceComponent.cpp:40
Solution
Solution
Covellite.Api
Covellite.Api
Renderer
GraphicApi.CapturingServiceComponent.cpp
Документация по Covellite++. Последние изменения:
. Создано системой
1.18.0