#ifndef _CEGOVIEWOBJECT_H_INCLUDED_
#define _CEGOVIEWOBJECT_H_INCLUDED_
///////////////////////////////////////////////////////////////////////////////
//                                                         
// CegoViewObject.h
// ----------------
// Cego view object class definition
//     
// Design and Implementation by Bjoern Lemke
//
// (C)opyright 2000-2019 Bjoern Lemke
//
// INTERFACE MODULE
//
// Class: CegoViewObject
// 
// Description: Cego view object structure
//
// Status: CLEAN
//
///////////////////////////////////////////////////////////////////////////////

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

// cego includes
#include "CegoField.h"
#include "CegoContentObject.h"

class CegoViewObject : public CegoContentObject {
    
public:
    
    CegoViewObject();
    CegoViewObject(Element *pVO);
    CegoViewObject(const CegoViewObject& vo);
    CegoViewObject(const Chain& viewName, int tabSetId = 0);

    CegoViewObject(int tabSetId, const Chain& viewName, const ListT<CegoField>& schema, const Chain& viewStmt);
	
    ~CegoViewObject();
    
    int getEntrySize() const;
    void encode(char *buf);
    void decode(char *buf);

    void setSchema(const ListT<CegoField>& schema);   
    
    const Chain& getViewStmt() const;
    void setViewStmt(const Chain& viewStmt);

    void setEmpty();
    
    CegoViewObject& operator = ( const CegoViewObject& vo);
    bool operator == ( const CegoViewObject& vo);

    Chain getId() const;
    Chain toChain() const;
    CegoContentObject* clone(bool isAttrRef=false);

    Element* getElement() const;
    void putElement(Element* pElement);
    Chain getFormatted() const;

private:

    Chain fill(const Chain& s, int num) const;
    Chain _viewStmt;
};

#endif
