/*
 * The UDS collection
 * Copyright (C) 1999, 2000, 2001  Julian v. Bock
 *
 * 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.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 *
 *	(See file COPYING for more information)
 */

#ifndef _uds_childdiag_hh
#define _uds_childdiag_hh


// includes

#include <uds/diagnose.hh>

using namespace std;


namespace uds
{

/** This class is used to give an error diagnose when a child process
	didn't exit normally
	\author Julian v. Bock
	\see Exception */
class ChildDiag : public DiagBase
{
public:
	/** \param s status */
	explicit
	ChildDiag( int s );

	/** destructor */
	virtual
	~ChildDiag();
	
	/** returns a diagnose string
		\return diagnose */
	virtual string
	Diagnose() const;
	
	/** clones the class instance
		\return pointer to new instance */
	virtual ChildDiag*
	Clone() const { return new ChildDiag( *this ); }
	
	/** \return true if the diagnose class provides an error code */
	virtual bool
	HaveErrCode() const { return true; }
	
	/** returns the exit status variable
		\return error code */
	virtual int
	ErrCode() const { return status; }
	
private:
	/// status variable
	int	status;
};

}

#endif // _uds_childdiag_hh
