本文整理汇总了C++中GiSTentry::Copy方法的典型用法代码示例。如果您正苦于以下问题:C++ GiSTentry::Copy方法的具体用法?C++ GiSTentry::Copy怎么用?C++ GiSTentry::Copy使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GiSTentry
的用法示例。
在下文中一共展示了GiSTentry::Copy方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Insert
void
MTnode::InsertBefore(const GiSTentry& entry, int index)
{
int n=NumEntries();
BOOL ordered=TRUE;
if(index>0) ordered=((*this)[index-1]->Compare(entry)<=0);
if(index<n) ordered=ordered&&((*this)[index]->Compare(entry)>=0);
if(ordered) { // yes, the position is right for this entry
assert(index<=n);
GiSTentry *e=(GiSTentry *)entry.Copy();
e->SetLevel(Level());
e->SetPosition(index);
e->SetNode(this);
// Move everything else over
for(int i=n; i>index; i--) {
GiSTentry *e=(*this)[i-1];
e->SetPosition(i);
(*this)[i]=e;
}
// Stick the entry in
(*this)[index]=e;
// Bump up the count
SetNumEntries(n+1);
}
else Insert(entry); // find the right place
}
示例2: NumEntries
// insert before the original number according to the sequence instead of index
void
MTnode::InsertBefore (const GiSTentry& newEntry, int index)
{
int n = NumEntries ();
assert (index>=0 && index<=n);
BOOL bOrder = TRUE;
if (index > 0) {
bOrder = (*this)[index-1]->Compare(newEntry) <= 0;
}
if (index < n) {
bOrder = bOrder && (*this)[index]->Compare(newEntry) >= 0;
}
if (bOrder) { // yes, the position is right for this entry
GiSTentry *entry = (GiSTentry *) newEntry.Copy ();
entry->SetLevel(Level());
entry->SetPosition(index);
entry->SetNode(this);
// Move everything else over
for (int i=n; i>index; i--) {
GiSTentry *e = (*this)[i-1];
e->SetPosition(i);
(*this)[i] = e;
}
// Stick the entry in
(*this)[index] = entry;
// Bump up the count
SetNumEntries (n+1);
} else {
Insert (newEntry); // find the right place
}
}
示例3: return
GiSTentry*
GiSTnode::SearchPtr(GiSTpage ptr) const
{
for (int i=0; i<numEntries; i++) {
GiSTentry *e = (*this)[i];
if (e->Ptr() == ptr)
return (GiSTentry*) e->Copy();
}
return NULL;
}
示例4:
GiSTlist<GiSTentry*>
GiSTnode::Search(const GiSTpredicate &query) const
{
GiSTlist<GiSTentry*> list;
for (int i=0; i<numEntries; i++) {
GiSTentry *e = (*this)[i];
if (query.Consistent(*e))
list.Append((GiSTentry*)e->Copy());
}
return list;
}
示例5: NumEntries
void
GiSTnode::InsertBefore (const GiSTentry& entry, int index)
{
assert (index <= NumEntries());
GiSTentry *e = (GiSTentry*)entry.Copy();
e->SetLevel (Level());
e->SetPosition (index);
e->SetNode (this);
// Move everything else over
for (int i=NumEntries(); i>index; i--) {
GiSTentry *e = (*this)[i-1];
e->SetPosition (i);
(*this)[i] = e;
}
// Stick the entry in
(*this)[index] = e;
// Bump up the count
numEntries++;
}