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


C++ GenericObject类代码示例

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


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

示例1: glUseProgram

void GenericHolder::drawAll()
{
	glUseProgram(shaderProgram);
	glBindVertexArray(vao);
	glBindBuffer(GL_ARRAY_BUFFER, vbo);
	for (std::vector<GenericObject*>::iterator it = objs.begin(); it != objs.end(); ){
		GenericObject* itObj = *it;
		if (itObj->markedForDeath){
			delete itObj;
			it = objs.erase(it);
		}
		else
		{
			double reps = (itObj->distMoved()) + 1;
			auto rotation = (itObj)->rotation();
			auto newTrans = ((itObj)->translate())*rotation;
			auto oldTrans = ((itObj)->translateOld())*rotation;
			for (int i = 0; i <= reps; i++){
				GLint uniTrans = glGetUniformLocation(shaderProgram, "trans");
				glUniformMatrix4fv(uniTrans, 1, GL_FALSE, glm::value_ptr(glm::interpolate(oldTrans, newTrans, i / (float)reps)));
				draw();
			}
			++it;
		}
	}
}
开发者ID:RonWeber,项目名称:Hackathon_OpenGL,代码行数:26,代码来源:GenericHolder.cpp

示例2: next

void DataSourceInterface::assignId(DataSourceEntityMapping& dsemp, ClassInfo& clas, void* entity) {
	GenericObject idv;
	next(dsemp, idv);
	if(!idv.isNull())
	{
		Field fld = clas.getField(dsemp.getIdPropertyName());
		vector<void *> valus;
		if(GenericObject::isNumber32(idv.getTypeName()) && GenericObject::isNumber(fld.getType()))
		{
			long* id;
			idv.get(id);
			valus.push_back(id);
		}
		else if(GenericObject::isNumber64(idv.getTypeName()) && GenericObject::isNumber(fld.getType()))
		{
			long long* id;
			idv.get(id);
			valus.push_back(id);
		}
		else if(GenericObject::isFPN(idv.getTypeName()) && GenericObject::isFPN(fld.getType()))
		{
			long double* id;
			idv.get(id);
			valus.push_back(id);
		}
		else if(GenericObject::isString(idv.getTypeName()) && GenericObject::isString(fld.getType()))
		{
			string* id;
			idv.set(id);
			valus.push_back(id);
		}
		else
		{
			throw "Data-Source-Object/Entity types do not match for id property" + dsemp.getClassName() + ":" + dsemp.getIdPropertyName();
		}

		args argus;
		argus.push_back(fld.getType());
		string methname = "set"+StringUtil::capitalizedCopy(fld.getFieldName());
		Method meth = clas.getMethod(methname,argus);
		reflector->invokeMethodGVP(entity,meth,valus);
	}
}
开发者ID:GYGit,项目名称:ffead-cpp,代码行数:43,代码来源:DataSourceInterface.cpp

示例3: replace

bool CacheInterface::replace(const std::string& key, const unsigned short& value, const int& expireSeconds) {
	GenericObject ob;
	ob.set(value);
	bool status = replace(key, ob, expireSeconds);
	return status;
}
开发者ID:hornsey,项目名称:ffead-cpp,代码行数:6,代码来源:CacheInterface.cpp

示例4: set

bool CacheInterface::set(const std::string& key, const int& value, const int& expireSeconds) {
	GenericObject ob;
	ob.set(value);
	bool status = set(key, ob, expireSeconds);
	return status;
}
开发者ID:hornsey,项目名称:ffead-cpp,代码行数:6,代码来源:CacheInterface.cpp

示例5: replace

bool MemoryCacheImpl::replace(const std::string& key, GenericObject& value, const int& expireSeconds) {
	std::string valueStr = value.getSerilaizedState();
	bool status = setInternal(key, valueStr, expireSeconds, 3);
	return status;
}
开发者ID:hornsey,项目名称:ffead-cpp,代码行数:5,代码来源:MemoryCacheImpl.cpp


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