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 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82
//---------------------------------------------------------------------------
//	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"

#include "dxl/operators/CDXLNode.h"
#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
			ULONG m_ulColId;

			// the query level
			ULONG m_ulQueryLevel;

			// the target entry
			TargetEntry *m_pte;

		public:

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

			// return the ColId
			ULONG UlColId() const
			{
				return m_ulColId;
			}

			// return the query level
			ULONG UlQueryLevel() const
			{
				return m_ulQueryLevel;
			}

			// return the column name for the given attribute no
			const TargetEntry *Pte() const
			{
				return m_pte;
			}
	};
}

#endif // GPDXL_CMappingElementColIdTE_H

// EOF