#ifndef _Process_h
#define _Process_h

#define SPAWN_FILE "printer" // filename of realtime process

class Process
{
	public:

	/* Function: Spawn_RT
	 * Usage: Spawn_RT();
	 * -------------------
	 * This function spawns a new QNX process defined by the constant SPAWN_FILE.
	 * A short delay is included to allow the process to get started before any
	 * interprocess communication starts
	 */

	void Spawn_RT (void);

	/* Function: Get_Background_pid
	 * Usage: Get_Background_pid()
	 * -----------------------------
	 * This function is used to get the process ID of the background (parent) process.
	 * The function can only be used from the realtime process
	 */

	void Get_Background_pid(void);

	/* Function: Is_RT_Alive
	 * Usage: stats = Is_RT_Alive()
	 * -----------------------------
	 * This function is used to determine if the realtime process is running
	 * properly.  The function returns an integer (TRUE=1 or FALSE=0) indicating
	 * whether the realtime process is still alive.
	 */

	int Is_RT_Alive(void);

	/* Function: Is_Background_Alive
	 * Usage: stats = Is_Background_Alive()
	 * ------------------------------------
	 * This function is used to determine if the background process is running
	 * properly.  The function returns an integer (TRUE=1 or FALSE=0) indicating
	 * whether the process process is still alive.
	 */

	void Is_Background_Alive(void);

	/* Function: Kill_RT_Process
	 * Usage: Kill_RT_Process()
	 * --------------------------
	 * This function is used to kill the realtime process.
	 */

	void Kill_RT_Process(void);

	/* Function: Set_Realtime_Priority
	 * Usage: Set_Realtime_Priorit()
	 * --------------------------------
	 * This function sets the scheduling priority of the realtime process to the
	 * priority number defined by PROCESS_PRIORITY in the global_defs.h
	 */

	void Set_Realtime_Priority(void);

	pid_t background_pid;
	pid_t realtime_pid;
	pid_t realtime_pid2;
};


#endif



