
/*
**  This file forms part of the GOBLIN C++ Class Library.
**
**  Written by Christian Fremuth-Paeger, May 1999.
**  
**  Copying, compiling, distribution and modification
**  of this source code is permitted only in accordance
**  with the GOBLIN general licence information.
*/             


#if !defined(_ABSOBJ_H_)

#define _ABSOBJ_H_

#include <context.h>


class goblinDataObject : protected goblinAbstractObject
{
protected:

    goblinController&   CT;
    char *              label;

private:

    unsigned int        refCounter;
    THandle             OH;

public:

    goblinDataObject(goblinController &thisContext = goblinDefaultContext,
        TOption options = 0) throw();
    virtual ~goblinDataObject() throw();

    unsigned long   Allocated() throw();

    
    // *************************************************************** //
    //           Memory Management                                     //
    // *************************************************************** //

    goblinController &      Context() throw() {return CT;};
    THandle                 Handle() throw() {return OH;};

    
    // *************************************************************** //
    //           Management of Object References                       //
    // *************************************************************** //
    
    void            MakeRef() throw() {refCounter++;};
    void            ReleaseRef() throw() {refCounter--;};
    char            IsReferenced() throw() {return (refCounter>0);};
    
    // *************************************************************** //
    //           Dummy display option                                  //
    // *************************************************************** //
    
    virtual char*   Display() throw(ERFile,ERRejected);
    virtual void    ConfigDisplay(goblinController &) throw() {};
    char*           Label() throw() {return label;};
    void            SetLabel(char* l) throw();
    
    
    // *************************************************************** //
    //           Error Handling                                        //
    // *************************************************************** //
    
    ostream &       Error(char *description = NULL) throw();

};


#endif
