Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
U
UERANSIM
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Libraries
UERANSIM
Commits
b41ecee9
Commit
b41ecee9
authored
Feb 20, 2021
by
aligungr
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
UE/gNB executable refactor
parent
f0d63a86
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
37 additions
and
8 deletions
+37
-8
src/app/ue_ctl.hpp
src/app/ue_ctl.hpp
+6
-1
src/ue.cpp
src/ue.cpp
+14
-6
src/ue/app/task.cpp
src/ue/app/task.cpp
+1
-1
src/ue/types.hpp
src/ue/types.hpp
+2
-0
src/ue/ue.cpp
src/ue/ue.cpp
+1
-0
src/utils/concurrent_map.hpp
src/utils/concurrent_map.hpp
+13
-0
No files found.
src/app/ue_ctl.hpp
View file @
b41ecee9
...
...
@@ -8,13 +8,18 @@
#pragma once
namespace
nr
::
ue
{
class
UserEquipment
;
}
namespace
app
{
class
IUeController
{
public:
virtual
void
performSwitchOff
()
=
0
;
virtual
void
performSwitchOff
(
nr
::
ue
::
UserEquipment
*
ue
)
=
0
;
};
}
// namespace app
src/ue.cpp
View file @
b41ecee9
...
...
@@ -329,16 +329,24 @@ static void Loop()
class
UeController
:
public
app
::
IUeController
{
public:
void
performSwitchOff
()
override
void
performSwitchOff
(
nr
::
ue
::
UserEquipment
*
ue
)
override
{
// WARNING: This method is executed in UE AppTask's thread.
// Therefore be careful about thread safety.
// todo ue' için ptr çek
// o ptru delete et
// mapten sil
// map boşaldıysa exit yap
// tabi bunları switc off olan appin kendi threadin yapıyoz o yüzden burası atomic değil dikkat!!
std
::
string
key
{};
g_ueMap
.
invokeForeach
([
&
key
,
ue
](
auto
&
item
)
{
if
(
item
.
second
==
ue
)
key
=
item
.
first
;
});
if
(
key
.
empty
())
return
;
if
(
g_ueMap
.
removeAndGetSize
(
key
)
==
0
)
exit
(
0
);
delete
ue
;
}
}
g_ueController
;
...
...
src/ue/app/task.cpp
View file @
b41ecee9
...
...
@@ -112,7 +112,7 @@ void UeAppTask::onLoop()
if
(
w
->
timerId
==
SWITCH_OFF_TIMER_ID
)
{
m_logger
->
info
(
"UE device is switching off"
);
m_base
->
ueController
->
performSwitchOff
();
m_base
->
ueController
->
performSwitchOff
(
m_base
->
ue
);
}
break
;
}
...
...
src/ue/types.hpp
View file @
b41ecee9
...
...
@@ -25,6 +25,7 @@ class UeAppTask;
class
UeMrTask
;
class
NasTask
;
class
UeRrcTask
;
class
UserEquipment
;
struct
SupportedAlgs
{
...
...
@@ -97,6 +98,7 @@ struct UeConfig
struct
TaskBase
{
UserEquipment
*
ue
{};
UeConfig
*
config
{};
LogBase
*
logBase
{};
app
::
IUeController
*
ueController
{};
...
...
src/ue/ue.cpp
View file @
b41ecee9
...
...
@@ -20,6 +20,7 @@ UserEquipment::UserEquipment(UeConfig *config, app::IUeController *ueController,
NtsTask
*
cliCallbackTask
)
{
auto
*
base
=
new
TaskBase
();
base
->
ue
=
this
;
base
->
config
=
config
;
base
->
logBase
=
new
LogBase
(
"logs/ue-"
+
config
->
getNodeName
()
+
".log"
);
base
->
ueController
=
ueController
;
...
...
src/utils/concurrent_map.hpp
View file @
b41ecee9
...
...
@@ -43,4 +43,17 @@ class ConcurrentMap
for
(
auto
i
:
m_map
)
fun
(
i
);
}
void
remove
(
const
TKey
&
key
)
{
std
::
lock_guard
lk
(
m_mutex
);
m_map
.
erase
(
key
);
}
size_t
removeAndGetSize
(
const
TKey
&
key
)
{
std
::
lock_guard
lk
(
m_mutex
);
m_map
.
erase
(
key
);
return
m_map
.
size
();
}
};
\ No newline at end of file
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