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


C++ Attributes::empty方法代码示例

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


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

示例1: attributesWithET

RowCollection<Group,Hash>::RowCollection(boost::shared_ptr<Query> const& query, const string& name, const Attributes& attributes, size_t chunkSize)
: _query(query), _attributes(attributes), _chunkSize(chunkSize), _sizeBuffered(0), _mode(RowCollectionModeAppend)
{
    assert(!attributes.empty());
    assert(chunkSize >= 2);

    // Use (CONFIG_MEM_ARRAY_THRESHOLD / 10) as the #bytes the unflushed items may have.
    _maxSizeBuffered = Config::getInstance()->getOption<size_t>(CONFIG_MEM_ARRAY_THRESHOLD) * MiB / 10;

    // Push the empty tag
    Attributes attributesWithET(attributes);
    attributesWithET.push_back(AttributeDesc(attributes.size(), DEFAULT_EMPTY_TAG_ATTRIBUTE_NAME,
           TID_BOOL, AttributeDesc::IS_EMPTY_INDICATOR, 0));

    // get the schema
    Dimensions dims(2);
    dims[0] = DimensionDesc("Row", 0, MAX_COORDINATE, 1, 0);
    dims[1] = DimensionDesc("Column", 0, MAX_COORDINATE, _chunkSize, 0);
    ArrayDesc schema(name, attributesWithET, dims);

    // create a MemArray
    _theArray = make_shared<MemArray>(schema,query);

    // get the array iterators
    _arrayIterators.reserve(attributes.size());
    for (size_t t=0; t<attributes.size(); ++t) {
        _arrayIterators.push_back(_theArray->getIterator(t));
    }
}
开发者ID:Myasuka,项目名称:scidb,代码行数:29,代码来源:RowCollection.cpp

示例2:

std::list<std::string>*		Node::compatibleModules(void)
{
  list<std::string>*			result;
  Variant*				dtypesptr;
  Attributes				dtypes;
  ConfigManager*			cm;
  std::map<std::string, Constant*>	constants;
  std::string				ext;

  result = NULL;
  if ((cm = ConfigManager::Get()) != NULL)
    {
      result = new list<std::string>;
      constants = cm->constantsByName("mime-type");
      if (!constants.empty() && ((dtypesptr = this->dataType()) != NULL))
	{
	  dtypes = dtypesptr->value<Attributes >();
	  if (!dtypes.empty())
	    this->__compatibleModulesByType(constants, dtypes, result);
	  delete dtypesptr;
	}
      ext = this->extension();
      if (!ext.empty())
	{
	  constants = cm->constantsByName("extension-type");
	  if (!constants.empty())
	    this->__compatibleModulesByExtension(constants, ext, result);
	}
    }
  return result;
}
开发者ID:halbbob,项目名称:dff,代码行数:31,代码来源:node.cpp

示例3: parseTupleType

/*
 GRAMMAR OF A TUPLE TYPE
 
 ‌ tuple-type → (tuple-type-bodyopt)
 ‌ tuple-type-body → tuple-type-element-list...opt
 ‌ tuple-type-element-list → tuple-type-element  tuple-type-element,tuple-type-element-list
 ‌ tuple-type-element → attributes opt inout opt type | inout opt element-name type-annotation
 ‌ element-name → identifier
 */
TupleTypePtr Parser::parseTupleType()
{
    Token token, token2;
    expect(L"(", token);
    TupleTypePtr ret = nodeFactory->createTupleType(token.state);
    Attributes attributes;
    if(!predicate(L")"))
    {
        do
        {
            //‌ tuple-type-element → attributes opt inout opt type inoutoptelement-nametype-annotation
            attributes.clear();
            bool inout = false;
            if(predicate(L"@"))
            {
                parseAttributes(attributes);
            }
            inout = match(Keyword::Inout);
            expect_next(token);
            if(attributes.empty() && token.type == TokenType::Identifier && token.identifier.keyword == Keyword::_ && peek(token2) && token2.type == TokenType::Colon)
            {
                //type-annotation → :attributes opt type
                if(predicate(L"@"))
                {
                    parseAttributes(attributes);
                }
                expect(L":");
                TypeNodePtr type = parseType();
                type->setAttributes(attributes);
                ret->add(inout, token.token, type);
            }
            else
            {
                restore(token);
                TypeNodePtr type = parseType();
                type->setAttributes(attributes);
                ret->add(inout, L"", type);
            }
        }while(match(L","));
        if(match(L"..."))
        {
            ret->setVariadicParameters(true);
        }
    }
    
    expect(L")");
    return ret;
}
开发者ID:healerkx,项目名称:swallow,代码行数:57,代码来源:Parser_Type.cpp

示例4: ShaderMaterial

  ShaderMaterial( std::string vertexShader,
                  std::string fragmentShader,
                  const Uniforms& uniforms,
                  const Attributes& attributes,
                  const Parameters& parameters )
    : Material() {

    setParameters( parameters, DefaultKeys() );

    this->vertexShader   = std::move(vertexShader);
    this->fragmentShader = std::move(fragmentShader);

    if (!attributes.empty()) {
      this->attributes = attributes;
    }
    if (!uniforms.empty()) {
      this->uniforms = uniforms;
    }

  }
开发者ID:CarterTsai,项目名称:three_cpp,代码行数:20,代码来源:shader_material.hpp

示例5: if

/*
 ‌ getter-setter-keyword-block → {getter-keyword-clause setter-keyword-clause opt}
 ‌ getter-setter-keyword-block → {setter-keyword-clause getter-keyword-clause}
 ‌ getter-keyword-clause → attributes opt get
 ‌ setter-keyword-clause → attributes opt set
*/
std::pair<CodeBlockPtr, CodeBlockPtr> Parser::parseGetterSetterKeywordBlock()
{
    Token token;
    Attributes attributes;
    parseAttributes(attributes);
    CodeBlockPtr getter = NULL;
    CodeBlockPtr setter = NULL;
    if(match(Keyword::Get, token))
    {
        getter = nodeFactory->createCodeBlock(token.state);
        getter->setAttributes(attributes);
        parseAttributes(attributes);
        if(match(Keyword::Set, token))
        {
            setter = nodeFactory->createCodeBlock(token.state);
            setter->setAttributes(attributes);
        }
        else if(!attributes.empty())//attributes defined for setter but setter is not found
        {
            Token token;
            expect_next(token);
            unexpected(token);
        }
    }
    else if(match(Keyword::Set, token))
    {
        setter = nodeFactory->createCodeBlock(token.state);
        setter->setAttributes(attributes);
        
        parseAttributes(attributes);
        expect(Keyword::Get, token);
        getter = nodeFactory->createCodeBlock(token.state);
        getter->setAttributes(attributes);
    }
    return std::make_pair(getter, setter);
}
开发者ID:xiedantibu,项目名称:swallow,代码行数:42,代码来源:Parser_Declaration.cpp


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