本文整理汇总了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;
}
}
}
示例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);
}
}
示例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;
}
示例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;
}
示例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;
}