#ifndef _CEGOOBJECT_H_INCLUDED_
#define _CEGOOBJECT_H_INCLUDED_
///////////////////////////////////////////////////////////////////////////////
//                                                         
// CegoObject.h
// ------------
// Cego object super class class definition
//     
// Design and Implementation by Bjoern Lemke
//
// (C)opyright 2000-2013 Bjoern Lemke
//
// INTERFACE MODULE
//
// Class: CegoObject
// 
// Description: Cego super class structure
//
// Status: QG-2.6
//
///////////////////////////////////////////////////////////////////////////////

// base includes
#include <lfcbase/Chain.h>

class CegoObject {

 public:

    enum ObjectType { SYSTEM, 
		      TABLE,
		      PINDEX,
		      UINDEX,
		      INDEX,		      
		      VIEW,
		      RBSEG,
		      FKEY,
		      PROCEDURE,
		      CHECK,
		      JOIN,
		      PBTREE,
		      UBTREE,
		      BTREE,
		      UNDEFINED};

    CegoObject();
    CegoObject(const CegoObject& oe);
    CegoObject(ObjectType type,  const Chain& objName, int tabSetId = 0);

    ~CegoObject();
    
    void setName(const Chain& name);
    const Chain& getName() const;

    void setType(ObjectType type);
    ObjectType getType() const;

    void setTabSetId(int tabSetId);
    int getTabSetId() const;

    int getBaseSize() const;
    void encodeBase(char *buf, int entrySize);
    void decodeBase(char *buf, int& entrySize);
            
    CegoObject& operator = ( const CegoObject& oe);
    bool operator == ( const CegoObject& oe);

    Chain toChain() const;

 private:

    ObjectType _type;
    Chain _name;
    int _tabSetId;

};

#endif
