CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
MappingTree.h
Go to the documentation of this file.
1 #ifndef INCLUDE_ORA_MAPPINGTREE_H
2 #define INCLUDE_ORA_MAPPINGTREE_H
3 
4 #include "MappingElement.h"
5 //
6 #include <set>
7 
8 namespace ora {
9 
10  struct TableInfo {
13  m_tableName(""),
14  m_idColumns(),
15  m_dataColumns(),
17  m_refColumns(),
19  }
20  TableInfo( const TableInfo& rhs ):
22  m_tableName( rhs.m_tableName ),
23  m_idColumns( rhs.m_idColumns ),
28  }
29  TableInfo& operator=( const TableInfo& rhs ){
37  return *this;
38  }
40  std::string m_tableName;
41  std::vector<std::string> m_idColumns;
42  std::map<std::string,std::string> m_dataColumns;
43  std::string m_parentTableName;
44  std::vector<std::string> m_refColumns;
45  std::set<std::string> m_nullableColumns;
46  };
47 
48 
54  {
55 
57  public:
59  MappingTree();
60 
62  explicit MappingTree( const std::string& version );
63 
64  MappingTree( const MappingTree& rhs );
65 
67  ~MappingTree();
68 
69  MappingTree& operator=( const MappingTree& rhs );
70 
71  void setVersion( const std::string& version);
72 
76  const std::string& version() const;
77 
84  MappingElement& setTopElement( const std::string& className,
85  const std::string& tableName,
86  bool isDependent = false );
87 
88  void setDependency( const MappingTree& parentTree );
89 
93  const MappingElement& topElement() const;
98 
102  const std::string& className() const;
103 
105  void override(const MappingTree& source);
106 
107  std::vector<TableInfo> tables() const;
108 
109  void printXML( std::ostream& outputStream ) const;
110 
111  private:
115  std::string m_version;
116 
121 
122  std::auto_ptr<TableInfo> m_parentTable;
123 
124  };
125 }
126 
127 inline const std::string&
129  return m_version;
130 }
131 
132 inline void
133 ora::MappingTree::setVersion( const std::string& version ){
134  m_version = version;
135 }
136 
137 inline const std::string&
139  return m_element.variableName();
140 }
141 
142 inline const ora::MappingElement&
144  return m_element;
145 }
146 
147 inline ora::MappingElement&
149  return m_element;
150 }
151 
152 #endif
std::string m_version
Definition: MappingTree.h:115
std::set< std::string > m_nullableColumns
Definition: MappingTree.h:45
std::auto_ptr< TableInfo > m_parentTable
Definition: MappingTree.h:122
const std::string & className() const
Definition: MappingTree.h:138
TableInfo & operator=(const TableInfo &rhs)
Definition: MappingTree.h:29
TableInfo(const TableInfo &rhs)
Definition: MappingTree.h:20
const std::string & version() const
Definition: MappingTree.h:128
std::vector< std::string > m_refColumns
Definition: MappingTree.h:44
std::map< std::string, std::string > m_dataColumns
Definition: MappingTree.h:42
MappingElement & setTopElement(const std::string &className, const std::string &tableName, bool isDependent=false)
Definition: MappingTree.cc:40
MappingTree & operator=(const MappingTree &rhs)
Definition: MappingTree.cc:29
std::string m_parentTableName
Definition: MappingTree.h:43
MappingTree()
Constructor.
Definition: MappingTree.cc:7
std::string m_tableName
Definition: MappingTree.h:40
~MappingTree()
Destructor.
Definition: MappingTree.cc:26
const MappingElement & topElement() const
Definition: MappingTree.h:143
std::vector< TableInfo > tables() const
Definition: MappingTree.cc:123
void printXML(std::ostream &outputStream) const
Definition: MappingTree.cc:142
std::vector< std::string > m_idColumns
Definition: MappingTree.h:41
void setVersion(const std::string &version)
Definition: MappingTree.h:133
void setDependency(const MappingTree &parentTree)
Definition: MappingTree.cc:52
MappingElement m_element
Definition: MappingTree.h:120