本文整理汇总了C++中gem::Properties::erase方法的典型用法代码示例。如果您正苦于以下问题:C++ Properties::erase方法的具体用法?C++ Properties::erase怎么用?C++ Properties::erase使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类gem::Properties
的用法示例。
在下文中一共展示了Properties::erase方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
void filmQT4L::getProperties(gem::Properties&props) {
std::vector<std::string> keys=props.keys();
gem::any value;
double d;
unsigned int i=0;
for(i=0; i<keys.size(); i++) {
std::string key=keys[i];
props.erase(key);
if("fps"==key) {
d=m_fps;
value=d; props.set(key, value);
}
if("frames"==key) {
d=m_numFrames;
value=d; props.set(key, value);
}
if("tracks"==key) {
d=m_numTracks;
value=d; props.set(key, value);
}
if("width"==key) {
d=m_image.image.xsize;
value=d; props.set(key, value);
}
if("height"==key) {
d=m_image.image.ysize;
value=d; props.set(key, value);
}
}
}
示例2: setParameters
void setParameters(gem::Properties&parms) {
unsigned int i=0;
for(i=0; i<m_parameterNames.size(); i++) {
std::string key=m_parameterNames[i];
std::string s1, s2;
double d1, d2;
switch(m_parameter.type(key)) {
case gem::Properties::NONE:
if(gem::Properties::NONE==parms.type(key)) {
parms.erase(key);
setParameter(i);
}
break;
case gem::Properties::DOUBLE:
if(m_parameter.get(key, d1) && parms.get(key, d2)) {
if(d1!=d2) {
m_parameter.set(key, d2);
setParameter(i, d2);
}
}
break;
case gem::Properties::STRING:
if(m_parameter.get(key, s1) && parms.get(key, s2)) {
if(s1!=s2) {
m_parameter.set(key, s2);
setParameter(i, s2);
}
}
break;
default: break;
}
}
}
示例3: setProperties
void imageBase :: setProperties(gem::Properties&props) {
// nada
m_properties=props;
#if 0
std::vector<std::string> keys=props.keys();
int i=0;
for(i=0; i<keys.size(); i++) {
enum gem::Properties::PropertyType typ=props.type(keys[i]);
std::cerr << "key["<<keys[i]<<"]: "<<typ<<" :: ";
switch(typ) {
case (gem::Properties::NONE):
props.erase(keys[i]);
break;
case (gem::Properties::DOUBLE):
std::cerr << gem::any_cast<double>(props.get(keys[i]));
break;
case (gem::Properties::STRING):
std::cerr << "'" << gem::any_cast<std::string>(props.get(keys[i])) << "'";
break;
default:
std::cerr << "<unknown:" << props.get(keys[i]).get_type().name() << ">";
break;
}
}
std::cerr << std::endl;
#endif
}
示例4: getProperties
void videoUNICAP :: getProperties(gem::Properties&props) {
if(!m_handle)return;
unicap_status_t status=0;
std::vector<std::string> keys=props.keys();
bool getwidth=false, getheight=false;
int i=0;
for(i=0; i<keys.size(); i++) {
std::string key=keys[i];
unicap_property_t prop;
strncpy(prop.identifier, key.c_str(), 128);
if("width"==key) {
getwidth=true;
continue;
}
if("height"==key) {
getheight=true;
continue;
}
status= unicap_get_property(m_handle, &prop );
if(SUCCESS(status)) {
switch(prop.type) {
case UNICAP_PROPERTY_TYPE_VALUE_LIST:
case UNICAP_PROPERTY_TYPE_FLAGS:
case UNICAP_PROPERTY_TYPE_RANGE:
props.set(key, prop.value);
break;
case UNICAP_PROPERTY_TYPE_MENU:
props.set(key, std::string(prop.menu_item));
break;
default:
props.erase(key);
// ?
break;
}
}
}
if(getwidth||getheight) {
unicap_format_t fmt;
status=unicap_get_format(m_handle, &fmt);
post("getting dimen");post_fmt(&fmt);
if(SUCCESS(status)) {
if(getwidth )props.set("width" , fmt.size.width);
if(getheight)props.set("height", fmt.size.height);
}
}
}
示例5: getProperties
void filmTEST::getProperties(gem::Properties&props) {
std::vector<std::string> keys=props.keys();
unsigned int i=0;
for(i=0; i<keys.size(); i++) {
std::string key=keys[i];
props.erase(key);
#define SETPROP(k, v) } else if(k == key) { double d=(double)v; props.set(key, v)
if(""==key) {
SETPROP("fps", m_fps);
SETPROP("frames", m_numFrames);
SETPROP("width", m_image.image.xsize);
SETPROP("height", m_image.image.ysize);
}
}
}
示例6: getProperties
virtual void getProperties(gem::Properties&props) {
std::vector<std::string> ids;
if(props.type("backends")!=gem::Properties::UNSET) {
unsigned int i;
for(i=0; i<m_ids.size(); i++) {
ids.push_back(m_ids[i]);
}
}
props.erase("backends");
if(m_handle)
m_handle->getProperties(props);
else
props.clear();
if(!ids.empty()) {
props.set("backends", ids);
}
}