/***************************************************************************

    supportware
    Copyright (C) 2001-2008 by c.holzheuer
    c.holzheuer@sourceworx.org

    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.

***************************************************************************/


#include <ddbaseobject.h>
#include <iostream>
#include <stdexcept>

using namespace std;

										
ddlogmanager ddbaseobject::thelog = ddlogmanager();

/**
	Erzeugt eine string representation dieses objects.
	Prototype, wird in erbenden Klassen überschrieben.
*/

ddstring ddbaseobject::to_string() const
{
	return "ddbaseobject:";
}


/**
	Eine string-representation dieses objects nach cout schreiben.
	@see to_string()
*/

void ddbaseobject::dump() const
{
	cout << to_string() << endl;
}


/**
	Eine Nachricht ans globale Mainlog schicken.
	@param	level the loglevel
	@param	message the message
*/

void ddbaseobject::log_message( int level, const ddstring& message )
{
	thelog.log_message( level, message );
}


/**
	Eine Debug-Nachricht ans globale Mainlog schicken.
	@param	message the message
*/

bool ddbaseobject::log_debug( const ddstring& message ) const
{
	log_message( ddlogdevice::lg_debug, message );
	return true;
}


/**
	Eine Error-Nachricht ans globale Mainlog schicken.
	@param	message the message
*/

bool ddbaseobject::log_error( const ddstring& message ) const
{
	log_message( ddlogdevice::lg_error, "error:" + message );
	return false;
}


/**
	Eine Error-Nachricht ans globale Mainlog schicken
	und mit einer entsprechenden exception abbrechen.
	
	@param	message the message
*/

void ddbaseobject::log_fatal( const ddstring& message ) const
{
	log_message( ddlogdevice::lg_error, "fatal:" + message );
	throw runtime_error( message );
}


/***************************************************************************

    supportware
    Copyright (C) 2001-2008 by c.holzheuer
    c.holzheuer@sourceworx.org

    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.

***************************************************************************/


/**
	Default constructor.
*/

ddbasestate::ddbasestate()
:	_flags(0)
{

}


/***************************************************************************

    supportware
    Copyright (C) 2001-2008 by c.holzheuer
    c.holzheuer@sourceworx.org

    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.

***************************************************************************/


/**
	Default constructor
*/

ddbasename::ddbasename()
{

}



/**
	Standard constructor
*/

ddbasename::ddbasename( const ddstring& name )
:	_name(name)
{

}


/***************************************************************************

    supportware
    Copyright (C) 2001-2008 by c.holzheuer
    c.holzheuer@sourceworx.org

    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.

***************************************************************************/


/**
	
*/

ddbasenamedobject::ddbasenamedobject()
{
	
}


/**
	
*/

ddbasenamedobject::ddbasenamedobject( const ddstring& name )
:  ddbaseobject(), ddbasename( name )
{
	
}


/**
	
*/

ddbasenamedobject::~ddbasenamedobject()
{
	
}

