Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Cameo
cameo
Commits
9c2e8ecd
Commit
9c2e8ecd
authored
Mar 05, 2020
by
legoc
Browse files
Simplified use of m_impl in Services, Server, This
parent
3e85db72
Changes
5
Hide whitespace changes
Inline
Side-by-side
src/cameo/Application.cpp
View file @
9c2e8ecd
...
...
@@ -112,7 +112,6 @@ void This::terminate() {
This
::
This
()
:
Services
(),
m_impl
(
nullptr
),
m_id
(
-
1
),
m_managed
(
false
),
m_starterId
(
0
)
{
...
...
@@ -120,8 +119,7 @@ This::This() :
void
This
::
initApplication
(
int
argc
,
char
*
argv
[])
{
m_impl
=
new
ServicesImpl
();
Services
::
setImpl
(
m_impl
);
Services
::
init
();
if
(
argc
==
0
)
{
throw
InvalidArgumentException
(
"missing info argument"
);
...
...
src/cameo/Application.h
View file @
9c2e8ecd
...
...
@@ -164,7 +164,6 @@ private:
void
stoppingFunction
(
StopFunctionType
stop
);
void
handleStopImpl
(
StopFunctionType
function
);
ServicesImpl
*
m_impl
;
std
::
string
m_name
;
int
m_id
;
bool
m_managed
;
...
...
src/cameo/Server.cpp
View file @
9c2e8ecd
...
...
@@ -32,7 +32,7 @@ namespace cameo {
Server
::
Server
(
const
std
::
string
&
endpoint
)
:
Services
()
{
Services
::
setImpl
(
new
ServicesImpl
()
);
Services
::
init
(
);
vector
<
string
>
tokens
=
split
(
endpoint
);
...
...
src/cameo/Services.cpp
View file @
9c2e8ecd
...
...
@@ -44,8 +44,9 @@ void Services::terminate() {
m_impl
.
reset
();
}
void
Services
::
setImpl
(
ServicesImpl
*
impl
)
{
m_impl
.
reset
(
impl
);
void
Services
::
init
()
{
// Set the impl.
m_impl
.
reset
(
new
ServicesImpl
());
}
std
::
vector
<
std
::
string
>
Services
::
split
(
const
std
::
string
&
info
)
{
...
...
src/cameo/Services.h
View file @
9c2e8ecd
...
...
@@ -35,7 +35,7 @@ public:
void
terminate
();
void
setImpl
(
ServicesImpl
*
impl
);
void
init
(
);
std
::
vector
<
std
::
string
>
split
(
const
std
::
string
&
info
);
void
setTimeout
(
int
timeout
);
...
...
@@ -57,6 +57,7 @@ public:
int
m_statusPort
;
std
::
string
m_serverStatusEndpoint
;
std
::
unique_ptr
<
ServicesImpl
>
m_impl
;
std
::
unique_ptr
<
RequestSocketImpl
>
m_requestSocket
;
};
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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