• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ currentValue函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: Q_ASSERT

void AllowedLookupsResolver::requestValueResolution( const QModelIndex& topLeft, const QModelIndex& bottomRight, const QVector<int> &roles )
{
	Q_ASSERT( topLeft.row() == bottomRight.row() );

	// We need to attempt to resolve the ownership information only if the property value was changed.
	bool filterChanged = roles.size() == 0;
	foreach( int role, roles )
	{
		if( role == PropertyValueListModel::FilterRole )
			filterChanged = true;
	}
	if( ! filterChanged )
		return;  // Other than changes to the property value do not affect ownership information.

	// Fetch the current value and abort resolution if the property isn't lookup.
	MFiles::PropertyValue currentValue( m_model->data( topLeft, PropertyValueListModel::PropertyValueRole ).toJsonValue() );
	if( currentValue.typedValue().dataType() != MFiles::Constants::MultiSelectLookup &&
		currentValue.typedValue().dataType() != MFiles::Constants::SingleSelectLookup  )
		return;

	// Fetch the allowed values using the new filter.
	AsyncFetch* fetchAllowed = this->fetchAllowedItems( topLeft, currentValue.value() );

	// Resolve the validity.
	QObject::connect( fetchAllowed, &AsyncFetch::finished, [=]() mutable {
		fetchAllowed->deleteLater();

		QJsonArray values = fetchAllowed->values();
		this->resolveValidity( values, topLeft, currentValue.value() );
	} );
}
开发者ID:Rantanen,项目名称:MFiles-Sailfish,代码行数:31,代码来源:allowedlookupsresolver.cpp


示例2: int

bool 
Reader::decodeDouble( Token &token )
{
   double value = 0;
   const int bufferSize = 32;
   int count;
   int length = int(token.end_ - token.start_);
   if ( length <= bufferSize )
   {
      Char buffer[bufferSize];
      memcpy( buffer, token.start_, length );
      buffer[length] = 0;
      count = sscanf( buffer, "%lf", &value );
   }
   else
   {
      std::string buffer( token.start_, token.end_ );
      count = sscanf( buffer.c_str(), "%lf", &value );
   }

   if ( count != 1 )
      return addError( "'" + std::string( token.start_, token.end_ ) + "' is not a number.", token );
   currentValue() = value;
   return true;
}
开发者ID:xosdy,项目名称:zpublic,代码行数:25,代码来源:json_reader.cpp


示例3: currentValue

  bool 
  Reader::readObject ()
  {
    Token tokenName;
    std::string name;
    currentValue () = Value (objectValue);
    while (readToken (tokenName))
      {
	if (tokenName.type_ == tokenObjectEnd && name.empty ())  // empty object
	  return true;
	if (tokenName.type_ != tokenString)
	  break;
      
	name = "";
	if (!decodeString (tokenName, name))
	  return recoverFromError (tokenObjectEnd);

	Token colon;
	if (!readToken (colon) ||  colon.type_ != tokenMemberSeparator)
	  {
	    return addErrorAndRecover ("Missing ':' after object member name", 
				       colon, 
				       tokenObjectEnd);
	  }
	Value &value = currentValue ()[ name ];
	nodes_.push (&value);
	bool ok = readValue ();
	nodes_.pop ();
	if (!ok) // error already set
	  return recoverFromError (tokenObjectEnd);

	Token comma;
	if (!readToken (comma)
	     ||   (comma.type_ != tokenObjectEnd && 
		   comma.type_ != tokenArraySeparator))
	  {
	    return addErrorAndRecover ("Missing ',' or '}' in object declaration", 
				       comma, 
				       tokenObjectEnd);
	  }
	if (comma.type_ == tokenObjectEnd)
	  return true;
      }
    return addErrorAndRecover ("Missing '}' or object member name", 
			       tokenName, 
			       tokenObjectEnd);
  }
开发者ID:TuSuNaMi,项目名称:ircd-sakura,代码行数:47,代码来源:m_rpc_json.cpp


示例4: currentVariable

void VariablesEditor::lvValues_selectionModel_selectionChanged()
{
    const QModelIndex variableIndex = currentVariable();
    const QModelIndex valueIndex = currentValue();
    const int count = mModel->rowCount( variableIndex );
    ui->tbValuesEdit->setEnabled( valueIndex.isValid() );
    ui->tbValuesClear->setEnabled( variableIndex.isValid() && count > 0 );
}
开发者ID:pasnox,项目名称:monkeystudio2,代码行数:8,代码来源:VariablesEditor.cpp


示例5: currentValue

void Worker::slotNextValue()
{
    emit currentValue(--m_nValue);
  
    if (!m_nValue)
    { 
      //emit finished(); 
    }
}
开发者ID:MakSim345,项目名称:QT-Dev,代码行数:9,代码来源:worker.cpp


示例6: currentValue

bool 
Reader::decodeString( Token &token )
{
   std::string decoded;
   if ( !decodeString( token, decoded ) )
      return false;
   currentValue() = decoded;
   return true;
}
开发者ID:herryRiver,项目名称:sdl_core_v3.6_wince,代码行数:9,代码来源:json_reader.cpp


示例7: currentValue

char
CaseValue::lireValeur(void) const {
	// Lire la premièrelettre de l'entrée
	wxString currentValue(GetLineText(0));
	std::string s(currentValue.ToStdString());
	// Si la taille est nulle, retourner un point
	if( s.size()==0 ) return '.';
	// Sinon retourner la valeur en tant que caractère
	return s.at(0);
}
开发者ID:alex-87,项目名称:mokitu-solver,代码行数:10,代码来源:CaseValue.cpp


示例8: AtomicString

void SVGAnimatedAngle::synchronizeAttribute()
{
    AtomicString value;
    if (m_orientType->currentValue()->enumValue() == SVGMarkerOrientAuto)
        value = "auto";
    else
        value = AtomicString(currentValue()->valueAsString());

    contextElement()->setSynchronizedLazyAttribute(attributeName(), value);
}
开发者ID:Drakey83,项目名称:steamlink-sdk,代码行数:10,代码来源:SVGAnimatedAngle.cpp


示例9: DEFINE_STATIC_LOCAL

void SVGAnimatedAngle::synchronizeAttribute()
{
    DEFINE_STATIC_LOCAL(const AtomicString, autoValue, ("auto", AtomicString::ConstructFromLiteral));
    AtomicString value;
    if (m_orientType->currentValue()->enumValue() == SVGMarkerOrientAuto)
        value = autoValue;
    else
        value = AtomicString(currentValue()->valueAsString());

    contextElement()->setSynchronizedLazyAttribute(attributeName(), value);
}
开发者ID:335969568,项目名称:Blink-1,代码行数:11,代码来源:SVGAnimatedAngle.cpp


示例10: getNthValueOnKeyPath

static JSValue getNthValueOnKeyPath(ExecState* exec, JSValue rootValue, const Vector<String>& keyPathElements, size_t index)
{
    JSValue currentValue(rootValue);
    ASSERT(index <= keyPathElements.size());
    for (size_t i = 0; i < index; i++) {
        JSValue parentValue(currentValue);
        if (!get(exec, parentValue, keyPathElements[i], currentValue))
            return jsUndefined();
    }
    return currentValue;
}
开发者ID:valbok,项目名称:WebKitForWayland,代码行数:11,代码来源:IDBBindingUtilities.cpp


示例11: findOptimalAmount

long unsigned int findOptimalAmount(short int factor2,short int factor3)
{ unsigned int n = currentValue(factor2,factor3);
  if(n < 12)
  { costArray[factor2][factor3] = n;
    return (long unsigned int)n;
  }
  else
  { if(costArray[factor2][factor3] == 0)
      costArray[factor2][factor3] = (findOptimalAmount(factor2+1,factor3) + findOptimalAmount(factor2,factor3+1) + findOptimalAmount(factor2+2,factor3));
    return costArray[factor2][factor3];
  }
}
开发者ID:Garvit,项目名称:code-backup,代码行数:12,代码来源:coins.c


示例12: currentValue

bool QNumberStyleAnimation::isUpdateNeeded() const
{
    if (QStyleAnimation::isUpdateNeeded()) {
        qreal current = currentValue();
        if (!qFuzzyCompare(_prev, current))
        {
            _prev = current;
            return true;
        }
    }
    return false;
}
开发者ID:MarianMMX,项目名称:MarianMMX,代码行数:12,代码来源:qstyleanimation.cpp


示例13: getNthValueOnKeyPath

static v8::Handle<v8::Value> getNthValueOnKeyPath(v8::Handle<v8::Value>& rootValue, const Vector<String>& keyPathElements, size_t index, v8::Isolate* isolate)
{
    v8::Handle<v8::Value> currentValue(rootValue);
    ASSERT(index <= keyPathElements.size());
    for (size_t i = 0; i < index; ++i) {
        v8::Handle<v8::Value> parentValue(currentValue);
        if (!get(parentValue, keyPathElements[i], currentValue, isolate))
            return v8Undefined();
    }

    return currentValue;
}
开发者ID:Metrological,项目名称:chromium,代码行数:12,代码来源:IDBBindingUtilities.cpp


示例14: readToken

  bool
  Reader::readValue ()
  {
    Token token;
    do
      readToken (token);
    while (token.type_ == tokenComment);
    bool successful = true;

    switch (token.type_)
      {
      case tokenObjectBegin:
	successful = readObject ();
	break;
      case tokenArrayBegin:
	successful = readArray ();
	break;
      case tokenNumber:
	successful = decodeNumber (token);
	break;
      case tokenString:
	successful = decodeString (token);
	break;
      case tokenTrue:
	currentValue () = true;
	break;
      case tokenFalse:
	currentValue () = false;
	break;
      case tokenNull:
	currentValue () = Value ();
	break;
      default:
	return addError ("Syntax error: value, object or array expected.", token);
      }

    return successful;
  }
开发者ID:TuSuNaMi,项目名称:ircd-sakura,代码行数:38,代码来源:m_rpc_json.cpp


示例15: finished

void MyThread::slotNextValue()
{
  QString str;
  m_nValue--;
  if (!m_nValue)
  {   
   emit finished(); 
  }
   
  str = "TEST message: this is a test message without any parameters.";
  emit currentValue(str);
  emit currentNumValue(m_nValue);
  emit pushTheButton();
}
开发者ID:MakSim345,项目名称:QT-Dev,代码行数:14,代码来源:mythread.cpp


示例16: in

bool 
Reader::decodeNumber( Token &token )
{
   bool isDouble = false;
   for ( Location inspect = token.start_; inspect != token.end_; ++inspect )
   {
      isDouble = isDouble  
                 ||  in( *inspect, '.', 'e', 'E', '+' )  
                 ||  ( *inspect == '-'  &&  inspect != token.start_ );
   }
   if ( isDouble )
      return decodeDouble( token );
   Location current = token.start_;
   bool isNegative = *current == '-';
   if ( isNegative )
      ++current;
   Value::UInt threshold = (isNegative ? Value::UInt(-Value::minInt) 
                                       : Value::maxUInt) / 10;
   Value::UInt value = 0;
   while ( current < token.end_ )
   {
      Char c = *current++;
      if ( c < '0'  ||  c > '9' )
         return addError( "'" + std::string( token.start_, token.end_ ) + "' is not a number.", token );
      if ( value >= threshold )
         return decodeDouble( token );
      value = value * 10 + Value::UInt(c - '0');
   }
   if ( isNegative )
      currentValue() = -Value::Int( value );
   else if ( value <= Value::UInt(Value::maxInt) )
      currentValue() = Value::Int( value );
   else
      currentValue() = value;
   return true;
}
开发者ID:AngryPowman,项目名称:smalltranslator,代码行数:36,代码来源:json_reader.cpp


示例17: switch

bool OnOffLightService::processRequest(uint16_t requestType, XBeeAddress from, uint8_t* payload, uint8_t payload_length) {
	switch (requestType) {
	case 0x0001: { //is on?
#ifdef DEBUG_ASRVS
		Serial.println("Request for current status");
#endif
		uint8_t value = currentValue() ? 0x01 : 0x00;
		uint8_t data[] = { 0, 0, 0, 0, value };
		fillResponseHeader(data, requestType);
		_sender->send(from, data, 5);
		return true;
	}
	default: return false;
	}
}
开发者ID:msiegenthaler,项目名称:gidaivel-arduino-light,代码行数:15,代码来源:OnOffLightService.cpp


示例18: getDatum

bool ScriptNode::makeDatum(std::string n, PyTypeObject* type,
                           std::string value, bool output)
{
    for (auto a : script.active)
        if (a->name == n)
            return false;

    // If there's an existing datum and it's of the wrong type, delete it.
    auto d = getDatum(n);
    if (d != NULL && (d->type != type))
    {
        datums.remove_if([&](const std::unique_ptr<Datum>& d_)
                         { return d_.get() == d; });
        d = NULL;
    }

    if (d == NULL)
    {
        d = new Datum(n, value, type, this);
        assert(d->isValid());
    }
    else
    {
        // Move the existing datum to the end of the list
        // (so that ordering matches ordering in the script)
        for (auto itr = datums.begin(); itr != datums.end(); ++itr)
            if (itr->get() == d)
            {
                datums.splice(datums.end(), datums, itr);
                break;
            }

        // If the datum is an output, update its expression
        if (output)
            d->setText(value);
        // Otherwise, erase the output sigil by setting the text
        else if (d->isOutput())
            d->setText(value);
    }

    script.active.insert(d);

    // Inject this variable into the script's namespace
    script.inject(n.c_str(), d->currentValue());
    saveLookup(n, &script);

    return true;
}
开发者ID:mkeeter,项目名称:antimony,代码行数:48,代码来源:script_node.cpp


示例19: canInjectNthValueOnKeyPath

static bool canInjectNthValueOnKeyPath(ExecState* exec, JSValue rootValue, const Vector<String>& keyPathElements, size_t index)
{
    if (!rootValue.isObject())
        return false;

    JSValue currentValue(rootValue);

    ASSERT(index <= keyPathElements.size());
    for (size_t i = 0; i < index; ++i) {
        JSValue parentValue(currentValue);
        const String& keyPathElement = keyPathElements[i];
        if (!get(exec, parentValue, keyPathElement, currentValue))
            return canSet(parentValue, keyPathElement);
    }
    return true;
}
开发者ID:valbok,项目名称:WebKitForWayland,代码行数:16,代码来源:IDBBindingUtilities.cpp


示例20: canInjectNthValueOnKeyPath

static bool canInjectNthValueOnKeyPath(v8::Handle<v8::Value>& rootValue, const Vector<String>& keyPathElements, size_t index, v8::Isolate* isolate)
{
    if (!rootValue->IsObject())
        return false;

    v8::Handle<v8::Value> currentValue(rootValue);

    ASSERT(index <= keyPathElements.size());
    for (size_t i = 0; i < index; ++i) {
        v8::Handle<v8::Value> parentValue(currentValue);
        const String& keyPathElement = keyPathElements[i];
        if (!get(parentValue, keyPathElement, currentValue, isolate))
            return canSet(parentValue, keyPathElement);
    }
    return true;
}
开发者ID:Metrological,项目名称:chromium,代码行数:16,代码来源:IDBBindingUtilities.cpp



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ currentView函数代码示例发布时间:2022-05-30
下一篇:
C++ currentTimeMS函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap