Commit 2be374a5 authored by legoc's avatar legoc
Browse files

renamed functions of the Request class

parent 86cb9d86
......@@ -861,16 +861,24 @@ Request::Request(std::auto_ptr<RequestImpl> & impl) :
Request::~Request() {
}
const std::string& Request::get() const {
const std::string& Request::getBinaryData() 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);
}
///////////////////////////////////////////////////////////////////////////
......
......@@ -339,10 +339,11 @@ class Request {
public:
~Request();
const std::string& get() const;
const std::string& getBinaryData() const;
std::string getData() const;
void sendBinary(const std::string& response);
void send(const std::string& response);
void replyBinary(const std::string& response);
void reply(const std::string& response);
private:
Request(std::auto_ptr<RequestImpl> & impl);
......
......@@ -34,18 +34,18 @@ RequestImpl::RequestImpl(const application::This * application, const std::strin
RequestImpl::~RequestImpl() {
}
void RequestImpl::sendBinary(const std::string& response) {
void RequestImpl::replyBinary(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);
sendBinary(result);
replyBinary(result);
}
}
......
......@@ -34,8 +34,8 @@ public:
RequestImpl(const application::This * application, const std::string & requesterEndpoint, const std::string& message, int requesterApplicationId);
~RequestImpl();
void sendBinary(const std::string& response);
void send(const std::string& response);
void replyBinary(const std::string& response);
void reply(const std::string& response);
const application::This * m_application;
std::string m_requesterEndpoint;
......
......@@ -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;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment