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
2be374a5
Commit
2be374a5
authored
Jan 20, 2016
by
legoc
Browse files
renamed functions of the Request class
parent
86cb9d86
Changes
5
Hide whitespace changes
Inline
Side-by-side
src/cameo/Application.cpp
View file @
2be374a5
...
...
@@ -861,16 +861,24 @@ Request::Request(std::auto_ptr<RequestImpl> & impl) :
Request
::~
Request
()
{
}
const
std
::
string
&
Request
::
get
()
const
{
const
std
::
string
&
Request
::
get
BinaryData
()
const
{
return
m_impl
->
m_message
;
}
void
Request
::
sendBinary
(
const
std
::
string
&
response
)
{
m_impl
->
sendBinary
(
response
);
std
::
string
Request
::
getData
()
const
{
string
data
;
parse
(
m_impl
->
m_message
,
data
);
return
data
;
}
void
Request
::
replyBinary
(
const
std
::
string
&
response
)
{
m_impl
->
replyBinary
(
response
);
}
void
Request
::
send
(
const
std
::
string
&
response
)
{
m_impl
->
send
(
response
);
void
Request
::
reply
(
const
std
::
string
&
response
)
{
m_impl
->
reply
(
response
);
}
///////////////////////////////////////////////////////////////////////////
...
...
src/cameo/Application.h
View file @
2be374a5
...
...
@@ -339,10 +339,11 @@ class Request {
public:
~
Request
();
const
std
::
string
&
get
()
const
;
const
std
::
string
&
getBinaryData
()
const
;
std
::
string
getData
()
const
;
void
send
Binary
(
const
std
::
string
&
response
);
void
send
(
const
std
::
string
&
response
);
void
reply
Binary
(
const
std
::
string
&
response
);
void
reply
(
const
std
::
string
&
response
);
private:
Request
(
std
::
auto_ptr
<
RequestImpl
>
&
impl
);
...
...
src/cameo/impl/RequestImpl.cpp
View file @
2be374a5
...
...
@@ -34,18 +34,18 @@ RequestImpl::RequestImpl(const application::This * application, const std::strin
RequestImpl
::~
RequestImpl
()
{
}
void
RequestImpl
::
send
Binary
(
const
std
::
string
&
response
)
{
void
RequestImpl
::
reply
Binary
(
const
std
::
string
&
response
)
{
string
strRequestType
=
m_application
->
m_impl
->
createRequest
(
PROTO_RESPONSE
);
m_application
->
m_impl
->
tryRequestWithOnePartReply
(
strRequestType
,
response
,
m_requesterEndpoint
);
}
void
RequestImpl
::
send
(
const
std
::
string
&
response
)
{
void
RequestImpl
::
reply
(
const
std
::
string
&
response
)
{
// encode the data
string
result
;
serialize
(
response
,
result
);
send
Binary
(
result
);
reply
Binary
(
result
);
}
}
...
...
src/cameo/impl/RequestImpl.h
View file @
2be374a5
...
...
@@ -34,8 +34,8 @@ public:
RequestImpl
(
const
application
::
This
*
application
,
const
std
::
string
&
requesterEndpoint
,
const
std
::
string
&
message
,
int
requesterApplicationId
);
~
RequestImpl
();
void
send
Binary
(
const
std
::
string
&
response
);
void
send
(
const
std
::
string
&
response
);
void
reply
Binary
(
const
std
::
string
&
response
);
void
reply
(
const
std
::
string
&
response
);
const
application
::
This
*
m_application
;
std
::
string
m_requesterEndpoint
;
...
...
src/test/TestResponderApplication.cpp
View file @
2be374a5
...
...
@@ -53,7 +53,7 @@ int main(int argc, char *argv[]) {
cout
<<
"received request "
<<
*
request
<<
endl
;
request
->
send
(
"done"
);
request
->
reply
(
"done"
);
cout
<<
"finished the application"
<<
endl
;
}
...
...
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