2003-04-25 16:51:04 +02:00
|
|
|
/*
|
|
|
|
* PROGRAM: Server Code
|
|
|
|
* MODULE: rpb_chain.h
|
2004-03-18 06:56:06 +01:00
|
|
|
* DESCRIPTION: Keeps track of record_param's, updated_in_place by
|
2003-04-25 16:51:04 +02:00
|
|
|
* single transcation
|
|
|
|
*
|
|
|
|
* The contents of this file are subject to the Interbase 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.Inprise.com/IPL.html
|
|
|
|
*
|
|
|
|
* Software distributed under the License is distributed on an
|
|
|
|
* "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express
|
|
|
|
* or implied. See the License for the specific language governing
|
|
|
|
* rights and limitations under the License.
|
|
|
|
*
|
|
|
|
* Created by: Alex Peshkov <peshkoff@mail.ru>
|
|
|
|
*
|
|
|
|
* All Rights Reserved.
|
|
|
|
* Contributor(s): ______________________________________.
|
|
|
|
*/
|
|
|
|
|
2004-02-20 07:43:27 +01:00
|
|
|
#ifndef JRD_RPB_CHAIN_H
|
|
|
|
#define JRD_RPB_CHAIN_H
|
2003-04-25 16:51:04 +02:00
|
|
|
|
2003-11-04 00:59:24 +01:00
|
|
|
#include "../jrd/gdsassert.h"
|
2003-04-25 16:51:04 +02:00
|
|
|
#include <string.h>
|
|
|
|
|
|
|
|
#include "../common/classes/array.h"
|
|
|
|
#include "../jrd/jrd.h"
|
|
|
|
#include "../jrd/req.h"
|
|
|
|
|
2004-03-18 06:56:06 +01:00
|
|
|
// req.h defines struct record_param
|
|
|
|
|
2004-03-20 15:57:40 +01:00
|
|
|
namespace Jrd {
|
|
|
|
|
2004-03-11 06:04:26 +01:00
|
|
|
class traRpbListElement
|
|
|
|
{
|
2003-04-25 16:51:04 +02:00
|
|
|
public:
|
2004-03-18 06:56:06 +01:00
|
|
|
record_param* lr_rpb;
|
2003-04-25 16:51:04 +02:00
|
|
|
int level;
|
2004-03-18 06:56:06 +01:00
|
|
|
traRpbListElement(record_param* r, USHORT l) :
|
2003-04-25 16:51:04 +02:00
|
|
|
lr_rpb(r), level(l) {}
|
|
|
|
traRpbListElement() {}
|
2004-03-11 06:04:26 +01:00
|
|
|
|
|
|
|
static inline const bool greaterThan(const traRpbListElement& i1, const traRpbListElement& i2)
|
|
|
|
{
|
2003-04-25 16:51:04 +02:00
|
|
|
return i1.lr_rpb->rpb_relation->rel_id != i2.lr_rpb->rpb_relation->rel_id ?
|
|
|
|
i1.lr_rpb->rpb_relation->rel_id > i2.lr_rpb->rpb_relation->rel_id :
|
|
|
|
i1.lr_rpb->rpb_number != i2.lr_rpb->rpb_number ?
|
|
|
|
i1.lr_rpb->rpb_number > i2.lr_rpb->rpb_number :
|
|
|
|
i1.level > i2.level;
|
|
|
|
}
|
2004-03-11 06:04:26 +01:00
|
|
|
|
2004-04-18 04:50:38 +02:00
|
|
|
static inline const traRpbListElement& generate(const void *sender, const traRpbListElement& Item)
|
2004-03-11 06:04:26 +01:00
|
|
|
{
|
2003-04-25 16:51:04 +02:00
|
|
|
return Item;
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2004-03-11 06:04:26 +01:00
|
|
|
|
2004-03-14 14:31:26 +01:00
|
|
|
typedef Firebird::SortedArray<traRpbListElement,
|
|
|
|
Firebird::InlineStorage<traRpbListElement, 16>, traRpbListElement,
|
|
|
|
traRpbListElement, traRpbListElement> traRpbArray;
|
2004-03-11 06:04:26 +01:00
|
|
|
class traRpbList : public traRpbArray
|
|
|
|
{
|
2003-04-25 16:51:04 +02:00
|
|
|
public:
|
2004-03-14 14:31:26 +01:00
|
|
|
traRpbList(Firebird::MemoryPool& p) :
|
2006-04-25 19:49:24 +02:00
|
|
|
traRpbArray(p) {}
|
2004-03-18 06:56:06 +01:00
|
|
|
int PushRpb(record_param* value);
|
|
|
|
bool PopRpb(record_param* value, int Level);
|
2003-04-25 16:51:04 +02:00
|
|
|
};
|
2004-03-20 15:57:40 +01:00
|
|
|
|
|
|
|
} //namespace Jrd
|
|
|
|
|
2004-02-20 07:43:27 +01:00
|
|
|
#endif //JRD_RPB_CHAIN_H
|
2003-12-05 11:35:47 +01:00
|
|
|
|