CMappingElementColIdTE.h 1.7 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 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46
#include "nodes/primnodes.h"

// fwd decl
struct TargetEntry;

namespace gpdxl
{
	using namespace gpos;

	//---------------------------------------------------------------------------
	//	@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
47
			ULONG m_colid;
48 49

			// the query level
50
			ULONG m_query_level;
51 52

			// the target entry
53
			TargetEntry *m_target_entry;
54 55 56 57 58 59 60

		public:

			// ctors and dtor
			CMappingElementColIdTE(ULONG, ULONG, TargetEntry *);

			// return the ColId
61
			ULONG GetColId() const
62
			{
63
				return m_colid;
64 65 66
			}

			// return the query level
67
			ULONG GetQueryLevel() const
68
			{
69
				return m_query_level;
70 71 72
			}

			// return the column name for the given attribute no
73
			const TargetEntry *GetTargetEntry() const
74
			{
75
				return m_target_entry;
76 77 78 79 80 81 82
			}
	};
}

#endif // GPDXL_CMappingElementColIdTE_H

// EOF