当前位置: 首页>>代码示例>>C++>>正文


C++ Tuple::GetPersistentId方法代码示例

本文整理汇总了C++中Tuple::GetPersistentId方法的典型用法代码示例。如果您正苦于以下问题:C++ Tuple::GetPersistentId方法的具体用法?C++ Tuple::GetPersistentId怎么用?C++ Tuple::GetPersistentId使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Tuple的用法示例。


在下文中一共展示了Tuple::GetPersistentId方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: Tuple

/*

Test 07: create two new tuples with one shared float component, save both to file.

*/
void SecondoTestFrame::Test07(const TupleAttributes *attributes, 
		SmiRecordFile *recFile, SmiRecordFile *lobFile) {
	Tuple* myTuple;
	Tuple* myTuple2;
	float realv;
	int intv;
	int intv2;
	char boolv;
	char boolv2;
	bool bboolv;
	bool bboolv2;
	int numberOfPoints;	
	int *X;
	int *Y;
	int i;
	CcReal *real1;
	CcInt *int1;
	CcInt *int2;
	CcBool *bool1;
	CcBool *bool2;
	CcBool *bool2a;
	Polygon* polygon1;
	Polygon* polygon2;
	SmiRecordId recId;

	myTuple = new Tuple(attributes);
	myTuple2 = new Tuple(attributes);
	
	cout << "\ta float value for both tuples, please: "; cin >> realv;						
	cout << "\tan int value for the first tuple, please: "; cin >> intv;
	cout << "\tt = true, f = false" << endl;
	cout << "\ta boolean value for the first tuple, please: "; cin >> boolv;
						
	cout << "\tan int value for the second tuple, please: "; cin >> intv2;
	cout << "\tt = true, f = false" << endl;
	cout << "\ta boolean value for the second tuple, please: "; cin >> boolv2;
	bboolv = ((boolv == 't') ? true : false);
	bboolv2 = ((boolv2 == 't') ? true : false);
	
	cout << "\thow many points, please: "; cin >> numberOfPoints;
	X = new int[numberOfPoints];
	Y = new int[numberOfPoints];
						
	for (i = 0; i < numberOfPoints; i++) {
		cout << "\t" << (i+1) << ". Point:" << endl;
		cout << "\t\tX: "; cin >> X[i];
		cout << "\t\tY: "; cin >> Y[i];
	}

	real1 = new CcReal(true, realv);
    int1 = new CcInt(true, intv);
	bool1 = new CcBool(true, bboolv);
	int2 = new CcInt(true, intv2);
	bool2 = new CcBool(true, bboolv2);
	bool2a = new CcBool(true, bboolv2);
	
	polygon1 = new Polygon(lobFile, numberOfPoints, X, Y);
	polygon2 = new Polygon(lobFile, numberOfPoints, X, Y);
	
	myTuple->DelPut(0, int1);
	myTuple->DelPut(1, bool1);
	myTuple->DelPut(2, real1);
	myTuple->Put(3, polygon1);

	myTuple2->DelPut(0, int2);
	myTuple2->DelPut(1, bool2);
	myTuple2->AttrPut(1, myTuple, 1);
	myTuple2->AttrPut(2, myTuple, 2);
	myTuple2->Put(3, polygon2);
					
	cout << "\ttest tuple values" << endl;
	cout << "\t" << *myTuple << endl;
	cout << "\tSize: " << myTuple->GetSize() << endl;
	cout << "\tAttributes: " << myTuple->GetAttrNum() << endl;
	cout << endl;
	cout << "\ttest tuple values" << endl;
	cout << "\t" << *myTuple2 << endl;
	cout << "\tSize: " << myTuple2->GetSize() << endl;
	cout << "\tAttributes: " << myTuple2->GetAttrNum() << endl;

	cout << "\tSave tuple into recFile. Persistent id = ";

	myTuple->SaveTo(recFile, lobFile);
	recId = myTuple->GetPersistentId();
	cout << recId;
	
	myTuple2->SaveTo(recFile, lobFile);
	recId = myTuple2->GetPersistentId();
	cout << ", Persistent id = " << recId << endl;
	
	cout << "****************" << endl;
	delete myTuple2;
	cout << "(I)" << *myTuple << endl;
	delete myTuple;
	cout << "****************" << endl;
//.........这里部分代码省略.........
开发者ID:awarematics,项目名称:SECONDO,代码行数:101,代码来源:SecondoTestFrame.cpp


注:本文中的Tuple::GetPersistentId方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。