8
0
mirror of https://github.com/FirebirdSQL/firebird.git synced 2025-01-27 20:03:03 +01:00
firebird-mirror/src/jrd/rpb_chain.h
robocop 2ab1f94dd2 Cleanup
Some minor corrections
Second step to rename
2004-03-11 05:04:26 +00:00

70 lines
1.9 KiB
C++

/*
* PROGRAM: Server Code
* MODULE: rpb_chain.h
* DESCRIPTION: Keeps track of rpb's, updated_in_place by
* 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): ______________________________________.
*/
#ifndef JRD_RPB_CHAIN_H
#define JRD_RPB_CHAIN_H
#include "../jrd/gdsassert.h"
#include <string.h>
#include "../common/classes/array.h"
#include "../jrd/jrd.h"
#include "../jrd/req.h"
class traRpbListElement
{
public:
struct rpb* lr_rpb;
int level;
traRpbListElement(struct rpb *r, USHORT l) :
lr_rpb(r), level(l) {}
traRpbListElement() {}
static inline const bool greaterThan(const traRpbListElement& i1, const traRpbListElement& i2)
{
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;
}
static inline const traRpbListElement& generate(void *sender, const traRpbListElement& Item)
{
return Item;
}
};
typedef Firebird::SortedArray<traRpbListElement, traRpbListElement,
traRpbListElement, traRpbListElement> traRpbArray;
class traRpbList : public traRpbArray
{
public:
traRpbList(Firebird::MemoryPool *p) :
traRpbArray(p, 16) {}
int PushRpb(struct rpb* value);
bool PopRpb(struct rpb* value, int Level);
};
#endif //JRD_RPB_CHAIN_H