* Copyright (c) 2020 Huawei Technologies Co.,Ltd.
*
* openGauss is licensed under Mulan PSL v2.
* You can use this software according to the terms and conditions of the Mulan PSL v2.
* You may obtain a copy of Mulan PSL v2 at:
*
* http://license.coscl.org.cn/MulanPSL2
*
* THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
* EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
* MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
* See the Mulan PSL v2 for more details.
* ---------------------------------------------------------------------------------------
*
* vecvar.h
*
*
* IDENTIFICATION
* src/include/vecexecutor/vecvar.h
*
* ---------------------------------------------------------------------------------------
*/
#ifndef VECVAR_H_
#define VECVAR_H_
#include "vecexecutor/vectorbatch.h"
#include "utils/relcache.h"
#define GETSLOTID(val) (((val)&0x3FFFFFFFFFFFFFFFULL) >> 48)
#define GETCODE(val) ((val)&0x0000FFFFFFFFFFFFULL)
#define STORAGEVAR_SIZE_STEP 10
class StorageVar : public BaseObject {
public:
StorageVar();
~StorageVar();
void SetAttr(Relation rel, int colId);
Datum Decode(Size code);
private:
int m_colId;
Relation m_rel;
};
class StorageVarManager {
public:
StorageVarManager();
~StorageVarManager();
StorageVar* AddStorageVar();
StorageVar* GetStorageVar(int16 vindex);
Datum Decode(ScalarValue val);
private:
StorageVar** m_varData;
int m_size;
int m_index;
MemoryContext m_context;
};
#endif