Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
U
uniset2
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
1
Issues
1
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
UniSet project repositories
uniset2
Commits
26775e59
Commit
26775e59
authored
Sep 12, 2020
by
Pavel Vainerman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(unet): init cache refactoring
parent
87d569a2
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
4 deletions
+22
-4
UNetReceiver.cc
extensions/UNetUDP/UNetReceiver.cc
+22
-4
No files found.
extensions/UNetUDP/UNetReceiver.cc
View file @
26775e59
...
@@ -852,7 +852,16 @@ void UNetReceiver::initIterators() noexcept
...
@@ -852,7 +852,16 @@ void UNetReceiver::initIterators() noexcept
// -----------------------------------------------------------------------------
// -----------------------------------------------------------------------------
void
UNetReceiver
::
initDCache
(
UniSetUDP
::
UDPMessage
&
pack
,
bool
force
)
noexcept
void
UNetReceiver
::
initDCache
(
UniSetUDP
::
UDPMessage
&
pack
,
bool
force
)
noexcept
{
{
CacheInfo
&
d_info
(
d_icache_map
[
pack
.
getDataID
()]);
// CacheInfo& d_info(d_icache_map[pack.getDataID()]);
auto
c_it
=
d_icache_map
.
find
(
pack
.
getDataID
());
if
(
c_it
==
d_icache_map
.
end
()
)
{
auto
ret
=
d_icache_map
.
insert
(
std
::
pair
<
long
,
CacheInfo
>
(
pack
.
getDataID
(),
CacheInfo
()));
c_it
=
ret
.
first
;
}
CacheInfo
&
d_info
=
c_it
->
second
;
if
(
!
force
&&
pack
.
dcount
==
d_info
.
cache
.
size
()
)
if
(
!
force
&&
pack
.
dcount
==
d_info
.
cache
.
size
()
)
return
;
return
;
...
@@ -864,8 +873,8 @@ void UNetReceiver::initDCache( UniSetUDP::UDPMessage& pack, bool force ) noexcep
...
@@ -864,8 +873,8 @@ void UNetReceiver::initDCache( UniSetUDP::UDPMessage& pack, bool force ) noexcep
for
(
;
it
!=
d_icache_map
.
end
();
++
it
)
for
(
;
it
!=
d_icache_map
.
end
();
++
it
)
{
{
CacheInfo
&
d_info
(
it
->
second
);
CacheInfo
&
d_info
2
(
it
->
second
);
d_cache_init_ok
=
d_cache_init_ok
&&
d_info
.
cache_init_ok
;
d_cache_init_ok
=
d_cache_init_ok
&&
d_info
2
.
cache_init_ok
;
if
(
d_cache_init_ok
==
false
)
if
(
d_cache_init_ok
==
false
)
break
;
break
;
...
@@ -896,7 +905,16 @@ void UNetReceiver::initDCache( UniSetUDP::UDPMessage& pack, bool force ) noexcep
...
@@ -896,7 +905,16 @@ void UNetReceiver::initDCache( UniSetUDP::UDPMessage& pack, bool force ) noexcep
// -----------------------------------------------------------------------------
// -----------------------------------------------------------------------------
void
UNetReceiver
::
initACache
(
UniSetUDP
::
UDPMessage
&
pack
,
bool
force
)
noexcept
void
UNetReceiver
::
initACache
(
UniSetUDP
::
UDPMessage
&
pack
,
bool
force
)
noexcept
{
{
CacheInfo
&
a_info
(
a_icache_map
[
pack
.
getDataID
()]);
// CacheInfo& a_info(a_icache_map[pack.getDataID()]);
auto
c_it
=
a_icache_map
.
find
(
pack
.
getDataID
());
if
(
c_it
==
a_icache_map
.
end
()
)
{
auto
ret
=
a_icache_map
.
insert
(
std
::
pair
<
long
,
CacheInfo
>
(
pack
.
getDataID
(),
CacheInfo
()));
c_it
=
ret
.
first
;
}
CacheInfo
&
a_info
=
c_it
->
second
;
if
(
!
force
&&
pack
.
acount
==
a_info
.
cache
.
size
()
)
if
(
!
force
&&
pack
.
acount
==
a_info
.
cache
.
size
()
)
return
;
return
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment