File: HelloWorld.cpp

package info (click to toggle)
libassa 3.5.1-8.1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 3,424 kB
  • sloc: cpp: 15,703; sh: 12,083; makefile: 379; perl: 51
file content (85 lines) | stat: -rw-r--r-- 2,324 bytes parent folder | download | duplicates (9)
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
// -*- c++ -*-
// Generated by assa-genesis
//------------------------------------------------------------------------------
// $Id: HelloWorld.cpp,v 1.6 2006/07/20 02:30:54 vlg Exp $
//------------------------------------------------------------------------------
//                            HelloWorld.cpp
//------------------------------------------------------------------------------
//  Copyright (c) YEAR by YOUR-NAME 
//
//  This program is free software; you can redistribute it and/or 
//  modify it under the terms of the GNU General Public License   
//  as published by the Free Software Foundation; either version  
//  2 of the License, or (at your option) any later version.      
//------------------------------------------------------------------------------
//
// Date   : Fri Apr  4 17:01:53 2003
//
//------------------------------------------------------------------------------


#include <iostream>

#include "HelloWorld-main.h"
#include "HelloWorld.h"

// Static declarations mandated by Singleton class
ASSA_DECL_SINGLETON(HelloWorld);

HelloWorld::
HelloWorld () : 
	m_greeting_message ("Hello, World!")
{
    // Add a new command-line argument
    add_opt ('a', "greeting-message", &m_greeting_message);

    // Following list removes all predefined options.
    // Remove only those that you won't use.
    // Don't forget to update your help message in 'main.cpp'!
    //

    // ---Configuration---
    rm_opt ('f', "config-file"  );
    rm_opt ('n', "instance"     );
    rm_opt ('p', "port"         );

    // ---Process bookkeeping---
    rm_opt ('b', "daemon"       );
    rm_opt ('l', "pidfile"      );
    rm_opt ('L', "ommit-pidfile");

    /*---
     * By defauil disable all debugging
     *---*/
    m_mask = ASSA::APP | ASSA::ASSAERR;
    m_log_file = "HelloWorld.log";
}


void
HelloWorld::
init_service ()
{
    trace("HelloWorld::init_service");

    //
    // Insert initialization code here
    //

    DL((ASSA::APP,"Service has been initialized\n"));
}

void
HelloWorld::
process_events ()
{
    trace("HelloWorld::process_events");

	std::cout << m_greeting_message << std::endl;

    // Shut the service down
    m_reactor.stopReactor ();
    DL((ASSA::APP,"Service stopped!\n"));
}