1 #ifndef _CEGOATTRALIAS_H_INCLUDED_
2 #define _CEGOATTRALIAS_H_INCLUDED_
3 ///////////////////////////////////////////////////////////////////////////////
4 //
5 // CegoAttrAlias.h
6 // ---------------
7 // Cego table attribute alias class definition
8 //
9 // Design and Implementation by Bjoern Lemke
10 //
11 // (C)opyright 2000-2019 Bjoern Lemke
12 //
13 // INTERFACE MODULE
14 //
15 // Class: CegoAttrDesc
16 //
17 // Description: Table attribute alias container class
18 //
19 // Status: CLEAN
20 //
21 ///////////////////////////////////////////////////////////////////////////////
22 
23 // LFC INCLUDES
24 #include <lfcbase/Chain.h>
25 #include <lfcbase/ListT.h>
26 #include <lfcxml/Element.h>
27 
28 // CEGO INCLUDES
29 #include "CegoContentObject.h"
30 #include "CegoField.h"
31 
32 class CegoDatabaseFormater;
33 
34 class CegoAttrAlias {
35 
36 public:
37 
38     CegoAttrAlias();
39     CegoAttrAlias(const Chain& aliasName);
40     CegoAttrAlias(const Chain& attrName, const Chain& aliasName);
41     ~CegoAttrAlias();
42 
43     void setAttrName(const Chain& attrName);
44     const Chain& getAttrName() const;
45 
46     void setAliasName(const Chain& aliasName);
47     const Chain& getAliasName() const;
48 
49     CegoAttrAlias* clone() const;
50 
51     CegoAttrAlias& operator = ( const CegoAttrAlias& ad);
52     bool operator == ( const CegoAttrAlias& ad) const;
53     bool operator != ( const CegoAttrAlias& ad) const;
54 
55     Chain getId() const;
56     Chain toChain() const;
57 
58     Element* toElement() const;
59     void fromElement(Element *pAttrAliasElement);
60 
61     void encode(char *buf);
62     void decode(char *buf);
63     int getEncodingLength() const;
64 
65     friend ostream& operator << (ostream& s, const CegoAttrAlias& a);
66 
67 private:
68 
69     Chain _attrName;
70     Chain _aliasName;
71 };
72 
73 #endif
74