CMappingElementColIdTE.h 1.6 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
//---------------------------------------------------------------------------
//	Greenplum Database
//	Copyright (C) 2011 EMC Corp.
//
//	@filename:
//		CMappingElementColIdTE.h
//
//	@doc:
//		Wrapper class providing functions for the mapping element (between ColId and TE)
//		during DXL->Query translation
//
//	@test:
//
//
//---------------------------------------------------------------------------
#ifndef GPDXL_CMappingElementColIdTE_H
#define GPDXL_CMappingElementColIdTE_H

#include "postgres.h"

#include "gpos/base.h"

23
#include "naucrates/dxl/operators/CDXLNode.h"
24 25 26 27 28 29 30
#include "nodes/primnodes.h"

// fwd decl
struct TargetEntry;

namespace gpdxl
{
J
Jesse Zhang 已提交
31
using namespace gpos;
32

J
Jesse Zhang 已提交
33 34 35 36 37 38 39 40 41 42 43 44 45 46
//---------------------------------------------------------------------------
//	@class:
//		CMappingElementColIdTE
//
//	@doc:
//		Wrapper class providing functions for the mapping element (between ColId and TE)
//		during DXL->Query translation
//
//---------------------------------------------------------------------------
class CMappingElementColIdTE : public CRefCount
{
private:
	// the column identifier that is used as the key
	ULONG m_colid;
47

J
Jesse Zhang 已提交
48 49
	// the query level
	ULONG m_query_level;
50

J
Jesse Zhang 已提交
51 52
	// the target entry
	TargetEntry *m_target_entry;
53

J
Jesse Zhang 已提交
54 55 56
public:
	// ctors and dtor
	CMappingElementColIdTE(ULONG, ULONG, TargetEntry *);
57

J
Jesse Zhang 已提交
58 59 60 61 62 63
	// return the ColId
	ULONG
	GetColId() const
	{
		return m_colid;
	}
64

J
Jesse Zhang 已提交
65 66 67 68 69 70
	// return the query level
	ULONG
	GetQueryLevel() const
	{
		return m_query_level;
	}
71

J
Jesse Zhang 已提交
72 73 74 75 76 77 78 79
	// return the column name for the given attribute no
	const TargetEntry *
	GetTargetEntry() const
	{
		return m_target_entry;
	}
};
}  // namespace gpdxl
80

J
Jesse Zhang 已提交
81
#endif	// GPDXL_CMappingElementColIdTE_H
82 83

// EOF