本文整理汇总了C++中DBObjRecord::Realloc方法的典型用法代码示例。如果您正苦于以下问题:C++ DBObjRecord::Realloc方法的具体用法?C++ DBObjRecord::Realloc怎么用?C++ DBObjRecord::Realloc使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DBObjRecord
的用法示例。
在下文中一共展示了DBObjRecord::Realloc方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: AddField
void DBObjTable::AddField(DBObjTableField *field) {
DBInt recID;
DBObjRecord *record;
field->StartByte(RecordLengthVAR);
FieldPTR->Add(field);
RecordLengthVAR += field->Length();
for (recID = 0; recID < ItemNum(); recID++) {
record = Item(recID);
record->Realloc(RecordLengthVAR);
switch (field->Type()) {
case DBTableFieldString:
field->String(record, "");
break;
case DBTableFieldInt:
field->Int(record, field->IntNoData());
break;
case DBTableFieldFloat:
field->Float(record, field->FloatNoData());
break;
case DBTableFieldDate:
field->Date(record, field->DateNoData());
break;
}
}
}
示例2: DeleteAllFields
void DBObjTable::DeleteAllFields() {
DBObjRecord *record;
FieldPTR->DeleteAll();
RecordLengthVAR = 0;
for (record = First(); record != (DBObjRecord *) NULL; record = Next())
record->Realloc(RecordLengthVAR);
}
示例3: DeleteField
void DBObjTable::DeleteField(DBObjTableField *delField) {
DBInt i, recID, fieldID;
DBObjRecord *record;
DBObjTableField *field;
unsigned char *data;
for (fieldID = 0; fieldID < FieldPTR->ItemNum(); ++fieldID) {
field = FieldPTR->Item(fieldID);
if (field->StartByte() > delField->StartByte())
field->StartByte(field->StartByte() - delField->Length());
}
for (recID = 0; recID < ItemNum(); ++recID) {
record = Item(recID);
data = (unsigned char *) record->Data() + delField->StartByte();
for (i = 0; i < RecordLengthVAR - delField->StartByte() - delField->Length(); ++i)
data[i] = data[i + delField->Length()];
record->Realloc(RecordLengthVAR - delField->Length());
}
FieldPTR->Remove(delField);
RecordLengthVAR -= delField->Length();
delete delField;
}
示例4: Vertexes
void DBVLineIF::Vertexes (DBObjRecord *lineRec,DBCoordinate *coord,DBInt vertexNum)
{
DBInt vertex;
DBFloat length = 0;
DBCoordinate *vertexes, prevCoord;
DBObjRecord *dataRec = (DBObjRecord *) NULL;
DBObjectLIST<DBObjRecord> *dataArrays = Data ()->Arrays ();
DBRegion lineExtent, dataExtent = Data ()->Extent ();
DBMathDistanceFunction distFunc = DBMathGetDistanceFunction (Data ());
prevCoord = NodeCoordFLD->Coordinate (FromNodeFLD->Record (lineRec));
lineExtent.Expand (prevCoord);
if (vertexNum > 0)
{
if ((dataRec = dataArrays->Item (lineRec->RowID ())) == (DBObjRecord *) NULL)
{
if ((dataRec = new DBObjRecord (lineRec->Name (),((size_t) vertexNum) * sizeof (DBCoordinate),sizeof (DBFloat))) == (DBObjRecord *) NULL) return;
dataArrays->Add (dataRec);
}
else dataRec->Realloc (vertexNum * sizeof (DBCoordinate));
if ((vertexes = (DBCoordinate *) dataRec->Data ()) == NULL)
{ CMmsgPrint (CMmsgSysError, "Memory Allocation Error in: %s %d",__FILE__,__LINE__); return; }
for (vertex = 0;vertex < vertexNum;vertex++)
{
lineExtent.Expand (vertexes [vertex] = coord [vertex]);
length += DBMathCoordinateDistance (distFunc,prevCoord,coord [vertex]);
prevCoord = coord [vertex];
}
}
VertexesFLD->Record (lineRec,dataRec);
VertexNumFLD->Int (lineRec,vertexNum);
length += DBMathCoordinateDistance (distFunc,prevCoord,NodeCoordFLD->Coordinate (ToNodeFLD->Record (lineRec)));
PerimeterFLD->Float (lineRec,length);
lineExtent.Expand (NodeCoordFLD->Coordinate (ToNodeFLD->Record (lineRec)));
ExtentFLD->Region (lineRec,lineExtent);
dataExtent.Expand (lineExtent);
Data ()->Extent (dataExtent);
}