nodeCommon.h File Reference

Functions definitions used by both node.cpp and masterNode.cpp. More...

#include <cstdlib>
#include <csignal>

Go to the source code of this file.

Functions

bool initialize ()
 Performs initialization work for the master and slave Fountain node daemons.
void version (char **argv)
 Displays the Fountain version.
void usage (char **argv, bool amMasterNode)
 Describes the various arguments accepted by 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.


Detailed Description

Functions definitions used by both node.cpp and masterNode.cpp.


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