8
0
mirror of https://github.com/FirebirdSQL/firebird.git synced 2025-01-27 06:43:04 +01:00
firebird-mirror/src/jrd/SysFunction.h
asfernandes a3064848d6 Make ExprNodes and RecordSourceNodes reference others directly instead of via jrd_nod.
Store ValueExprNodes instead of jrd_nod in the metadata cache.
Make RecordSourceNode child of ExprNode as they share most operations.
Get rid of the JRD visitors in favor of direct calls.
Convert assignments statement lists created inside expressions to separate source and targets ValuesExprNodes.
2010-11-21 03:47:29 +00:00

73 lines
2.1 KiB
C++

/*
* PROGRAM: JRD System Functions
* MODULE: SysFunctions.h
* DESCRIPTION: System Functions
*
* The contents of this file are subject to the Initial
* Developer's Public License Version 1.0 (the "License");
* you may not use this file except in compliance with the
* License. You may obtain a copy of the License at
* http://www.ibphoenix.com/main.nfs?a=ibphoenix&page=ibp_idpl.
*
* Software distributed under the License is distributed AS IS,
* WITHOUT WARRANTY OF ANY KIND, either express or implied.
* See the License for the specific language governing rights
* and limitations under the License.
*
* The Original Code was created by Adriano dos Santos Fernandes
* for the Firebird Open Source RDBMS project, based on work done
* in Yaffil by Oleg Loa <loa@mail.ru> and Alexey Karyakin <aleksey.karyakin@mail.ru>
*
* Copyright (c) 2007 Adriano dos Santos Fernandes <adrianosf@uol.com.br>
* and all contributors signed below.
*
* All Rights Reserved.
* Contributor(s): ______________________________________.
* Oleg Loa <loa@mail.ru>
* Alexey Karyakin <aleksey.karyakin@mail.ru>
*
*/
#ifndef JRD_SYSFUNCTION_H
#define JRD_SYSFUNCTION_H
#include "../common/classes/MetaName.h"
#include "../jrd/DataTypeUtil.h"
#include "../dsql/Nodes.h"
#include "../common/dsc.h"
namespace Jrd
{
class thread_db;
struct impure_value;
}
class SysFunction
{
public:
typedef void (*SetParamsFunc)(DataTypeUtilBase* dataTypeUtil, const SysFunction* function, int, dsc**);
typedef void (*MakeFunc)(DataTypeUtilBase* dataTypeUtil, const SysFunction* function, dsc*, int, const dsc**);
typedef dsc* (*EvlFunc)(Jrd::thread_db*, const SysFunction* function,
const Jrd::NestValueArray&, Jrd::impure_value*);
const Firebird::MetaName name;
int minArgCount;
int maxArgCount; // -1 for no limit
SetParamsFunc setParamsFunc;
MakeFunc makeFunc;
EvlFunc evlFunc;
void* misc;
static const SysFunction* lookup(const Firebird::MetaName& name);
void checkArgsMismatch(int count) const;
private:
const static SysFunction functions[];
};
#endif // JRD_SYSFUNCTION_H