#include <cppcms/application.h>
#include <cppcms/service.h>
#include <cppcms/applications_pool.h>
#include <cppcms/rpc_json.h>
public:
{
bind(
"sum",cppcms::rpc::json_method(&json_service::sum,
this),method_role);
bind(
"div",cppcms::rpc::json_method(&json_service::div,
this),method_role);
bind(
"notify",cppcms::rpc::json_method(&json_service::notify,
this),notification_role);
bind(
"both",cppcms::rpc::json_method(&json_service::both,
this));
}
void sum(int x,int y)
{
std::cout << "Sum Called" << std::endl;
}
void div(int x,int y)
{
std::cout << "Div Called" << std::endl;
if(y==0)
else
}
void notify(std::string msg)
{
std::cout << "We got notification " << msg << std::endl;
}
void both(std::string msg)
{
std::cout << "We got notification " << msg << std::endl;
else
}
};
int main(
int argc,
char **argv)
{
try {
}
catch(std::exception const &e) {
std::cerr << e.what() << std::endl;
return 1;
}
return 0;
}