// **********************************************************************
//
// Copyright (c) 1998
// Object-Oriented Concepts, Inc.
// Billerica, MA, USA
//
// Copyright (c) 1998
// Object-Oriented Concepts GmbH
// Ettlingen, Germany
//
// All Rights Reserved
//
// **********************************************************************

#ifndef OB_UTIL_H
#define OB_UTIL_H

//
// The message viewer class
//
class OBMessageViewer
{
    //
    // Hide copy-constructor and asignment operator
    //
    OBMessageViewer(const OBMessageViewer&);
    void operator=(const OBMessageViewer&);

protected:

    //
    // The message viewer singleton
    //
    static OBMessageViewer* messageViewer_;

    OBMessageViewer() { }
    virtual ~OBMessageViewer() { }

public:

    //
    // Get the message viewer singleton
    //
    static OBMessageViewer* instance();

    //
    // Print messages
    //
    virtual void message(const char*);
    virtual void error(const char*);
    virtual void warning(const char*);
    virtual void nca(const char*);
};

//
// Print system exception
// Get stringified system exception
//
void OBPrintException(const CORBA_SystemException&);
char* OBExceptionToString(const CORBA_SystemException&);

//
// Print octets for debug reasons
//
void OBPrintOctets(ostream&, const CORBA_Octet*, CORBA_ULong);

//
// Print object reference
//
struct IOP_IOR;
class CORBA_Object;
typedef CORBA_Object* CORBA_Object_ptr;
void OBPrintObjref(ostream&, CORBA_Object_ptr);
void OBPrintObjref(ostream&, const char*);
void OBPrintObjref(ostream&, const IOP_IOR&);

#endif
