Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
OpenXG-NRF
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
Operations
Operations
Metrics
Environments
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
OpenXG
OpenXG-NRF
Commits
298e0709
Commit
298e0709
authored
Dec 12, 2020
by
Tien-Thinh Nguyen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add remove_profile
parent
ff5a1a97
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
5 deletions
+22
-5
src/nrf_app/nrf_app.cpp
src/nrf_app/nrf_app.cpp
+22
-5
No files found.
src/nrf_app/nrf_app.cpp
View file @
298e0709
...
...
@@ -316,18 +316,35 @@ bool nrf_app::is_profile_exist(const std::string &profile_id) const {
Logger
::
nrf_app
().
info
(
"NF profile (ID %d) not found"
,
profile_id
.
c_str
());
return
false
;
}
}
//------------------------------------------------------------------------------
bool
nrf_app
::
remove_nf_profile
(
std
::
shared_ptr
<
nrf_profile
>
&
snp
)
{
//TODO
std
::
string
key
;
snp
.
get
()
->
get_nf_instance_id
(
key
);
std
::
unique_lock
lock
(
m_instance_id2nrf_profile
);
if
(
instance_id2nrf_profile
.
erase
(
key
))
{
Logger
::
nrf_app
().
info
(
"Removed NF profile (ID %d) from the list"
,
key
.
c_str
());
return
true
;
}
else
{
Logger
::
nrf_app
().
info
(
"Remove_NF_profile, profile not found (ID %d)"
,
key
.
c_str
());
return
false
;
}
}
//------------------------------------------------------------------------------
bool
nrf_app
::
remove_nf_profile
(
std
::
string
&
profile_id
)
{
//TODO
std
::
unique_lock
lock
(
m_instance_id2nrf_profile
);
if
(
instance_id2nrf_profile
.
erase
(
profile_id
))
{
Logger
::
nrf_app
().
info
(
"Removed NF profile (ID %d) from the list"
,
profile_id
.
c_str
());
return
true
;
}
else
{
Logger
::
nrf_app
().
info
(
"Remove_NF_profile, profile not found (ID %d)"
,
profile_id
.
c_str
());
return
false
;
}
}
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