Menu

[r473]: / examples / trunk / hello_world / hello.cpp  Maximize  Restore  History

Download this file

35 lines (30 with data), 655 Bytes

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#include <cppcms/worker_thread.h>
#include <cppcms/manager.h>
#include <iostream>
using namespace std;
using namespace cppcms;
class my_hello_world : public worker_thread {
public:
my_hello_world(manager const &s) :
worker_thread(s)
{
};
virtual void main();
};
void my_hello_world::main()
{
cout << "<html><body>\n"
"<h1>Hello World</h1>\n"
"</body></html>\n";
}
int main(int argc,char ** argv)
{
try {
manager app(argc,argv);
app.set_worker(new simple_factory<my_hello_world>());
app.execute();
}
catch(std::exception const &e) {
cerr<<e.what()<<endl;
}
}
MongoDB Logo MongoDB