nodeCommon.cpp File Reference

Function implementations used by both node.cpp and masterNode.cpp. More...

#include "define.h"
#include "nodeCommon.h"
#include <bamboo/libbamboo.h>
#include <bamboo/qLog.h>
#include <bamboo/Daemonizer.h>
#include <bamboo/ConfigReader.h>
#include <bamboo/TypeConvert.h>
#include <unistd.h>
#include <cstdlib>
#include <csignal>
#include <cerrno>
#include <new>
#include <sstream>
#include <cstddef>
#include <iostream>
#include <string>

Functions

bool initialize ()
 Performs initialization work for the master and slave Fountain node daemons.
void interruptHandler (int signalNumber)
 Called when we catch a signal.
bool parseArgs (int argc, char **argv, bool amMasterNode)
 General argument parsing for both the master and slave Fountain node daemons.
int Daemonize ()
 Function to turn this process into a daemon.
void usage (char **argv, bool amMasterNode)
 Describes the various arguments accepted by the master and slave Fountain node daemons.
void version (char **argv)
 Displays the Fountain version.


Detailed Description

Function implementations used by both node.cpp and masterNode.cpp.

Header
/afs/scl/project/cvsroot/fountain/source/nodes/nodeCommon.cpp,v 1.24 2006/02/28 22:54:22 samm Exp

Function Documentation

int Daemonize  ) 
 

Function to turn this process into a daemon.

Return values:
int SUCCESS if the daemonizing was successful
int FAILURE otherwise

bool initialize  ) 
 

Performs initialization work for the master and slave Fountain node daemons.

This function does two important things, registering for signal events and initializing the Bamboo library.

Return values:
bool true if initialization was successfull
false otherwise

void interruptHandler int  signalNumber  ) 
 

Called when we catch a signal.

If the signal is SIGINT or SIGTERM we'll set the global done variable to true

Parameters:
[in] signalNumber The signal number caught

bool parseArgs int  argc,
char **  argv,
bool  amMasterNode
 

General argument parsing for both the master and slave Fountain node daemons.

Parameters:
[in] argc The number of arguments in the argv array
[in] argv Pointer to the argument array
[in] amMasterNode True if the caller is the master Fountain daemon
Return values:
bool true if the parsing was successful
false otherwise

void usage char **  argv,
bool  amMasterNode
 

Describes the various arguments accepted by the master and slave Fountain node daemons.

Parameters:
[in] argv Pointer to the argv array
[in] amMasterNode True if the caller is the master Fountain daemon

void version char **  argv  ) 
 

Displays the Fountain version.

Parameters:
[in] argv Pointer to the argv array


Generated on Wed Mar 8 14:43:32 2006 for Fountain by  doxygen 1.4.6