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


C++ AttributeMap::end方法代码示例

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


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

示例1: onObserve

void onObserve(const HeaderOptions &headerOption , const OCRepresentation& rep , const int& eCode, const int& sequenceNumber)
{
	std::cout << "onObserve" << std::endl;
//    if(eCode == SUCCESS_RESPONSE)
	if(eCode <= OC_STACK_RESOURCE_DELETED)
    {

        AttributeMap attributeMap = rep.getAttributeMap();

        for(auto it = attributeMap.begin() ; it != attributeMap.end() ; ++it)
        {
            if(attributeMap.find(it->first) == attributeMap.end())
            {
                return;
            }
        }

        if(rep.getUri().empty())
        {
        	cout << "uri is null\n";
            return;
        }

        std::cout << std::endl;
        std::cout << "========================================================" << std::endl;
        std::cout << "Receive OBSERVE RESULT:" << std::endl;
        std::cout << "\tSequenceNumber: " << sequenceNumber << std::endl;
        for(auto it = attributeMap.begin() ; it != attributeMap.end() ; ++it)
        {
            std::cout << "\tAttribute name: " << it->first << " value: ";
            for(auto valueItr = it->second.begin() ; valueItr != it->second.end() ; ++valueItr)
            {
                std::cout << "\t" << *valueItr << " ";
            }

            std::cout << std::endl;
        }

        if(observe_count() > 30)
        {
            std::cout << "Cancelling Observe..." << std::endl;
            OCStackResult result = g_curResource->cancelObserve();

            std::cout << "Cancel result: " << result << std::endl;
            sleep(10);
            std::cout << "DONE" << std::endl;
            std::exit(0);
        }
    }
    else
    {
        std::cout << "onObserve Response error: " << eCode << std::endl;
        std::exit(-1);
    }
}
开发者ID:tizenorg,项目名称:platform.upstream.iotivity,代码行数:55,代码来源:SampleConsumer.cpp

示例2: startElement

void KeyHandler::startElement(const QName& qname, const AttributeMap& attributes) {
    _result.reset(new Key());
    
    auto number = attributes.find(kNumberAttribute);
    if (number != attributes.end())
        _result->setNumber(lxml::IntegerHandler::parseInteger(number->second));
    
    auto print = attributes.find(kPrintObjectAttribute);
    if (print != attributes.end())
        _result->setPrintObject(print->second == "no" ? false : true);
}
开发者ID:aleph7,项目名称:mxml,代码行数:11,代码来源:KeyHandler.cpp

示例3: startElement

void MordentHandler::startElement(const lxml::QName& qname, const AttributeMap& attributes) {
    _result.reset(new Mordent());

    auto placement = attributes.find(kPlacementAttribute);
    if (placement != attributes.end())
        _result->setPlacement(presentOptional(EmptyPlacementHandler::placementFromString(placement->second)));

    auto longv = attributes.find(kLongAttribute);
    if (longv != attributes.end())
        _result->setLong(longv->second == "yes");
}
开发者ID:aleph7,项目名称:mxml,代码行数:11,代码来源:MordentHandler.cpp

示例4: onPut

void onPut(const OCRepresentation& rep , const int eCode)
{
    if(eCode == SUCCESS_RESPONSE)
    {
        std::cout << "PUT request was successful" << std::endl;

        AttributeMap attributeMap = rep.getAttributeMap();

        for(auto it = attributeMap.begin() ; it != attributeMap.end() ; ++it)
        {
            std::cout << "\tAttribute name: " << it->first << " value: ";
            for(auto valueItr = it->second.begin() ; valueItr != it->second.end() ; ++valueItr)
            {
                std::cout << "\t" << *valueItr << " ";
            }

            std::cout << std::endl;
        }

        std::vector< OCRepresentation > children = rep.getChildren();

        for(auto oit = children.begin() ; oit != children.end() ; ++oit)
        {
            attributeMap = oit->getAttributeMap();

            for(auto it = attributeMap.begin() ; it != attributeMap.end() ; ++it)
            {
                std::cout << "\tAttribute name: " << it->first << " value: ";
                for(auto valueItr = it->second.begin() ; valueItr != it->second.end() ; ++valueItr)
                {
                    std::cout << "\t" << *valueItr << " ";
                }

                std::cout << std::endl;
            }
        }

        if(OBSERVE_TYPE_TO_USE == ObserveType::Observe)
            std::cout << std::endl << "Observe is used." << std::endl << std::endl;
        else if(OBSERVE_TYPE_TO_USE == ObserveType::ObserveAll)
            std::cout << std::endl << "ObserveAll is used." << std::endl << std::endl;

        QueryParamsMap test;

        g_curResource->observe(ObserveType::Observe , test , &onObserve);

    }
    else
    {
        std::cout << "onPut Response error: " << eCode << std::endl;
        std::exit(-1);
    }
}
开发者ID:tizenorg,项目名称:platform.upstream.iotivity,代码行数:53,代码来源:SampleConsumer.cpp

示例5: onobserve

void onobserve()
{

    oicappData *ad = g_oicObserveAd;

    AttributeMap attributeMap = g_curAttributeMap;

    std::string tmpStr[2];
    int index = 0;
    for(auto it = attributeMap.begin() ; it != attributeMap.end() ; ++it)
    {
        tmpStr[index] = it->first;
        tmpStr[index].append(" : ");
        for(auto value = it->second.begin() ; value != it->second.end() ; ++value)
        {
            tmpStr[index].append(*value);
        }
        index++;
    }

    DBG("%s" , tmpStr[0].c_str());
    DBG("%s" , tmpStr[1].c_str());
    _gl_update_item(ad , strdup(tmpStr[0].c_str()) , ad->itemConsumerTemp);
    _gl_update_item(ad , strdup(tmpStr[1].c_str()) , ad->itemConsumerHumid);
}
开发者ID:tizenorg,项目名称:platform.upstream.iotivity,代码行数:25,代码来源:oicapp-client.cpp

示例6:

bool
TemplateBuilder::hasAttribute(
  const AttributeMap& attributes,
  const std::string& name)
{
  return attributes.find(name) != attributes.end();
}
开发者ID:clearctvm,项目名称:MarketData.Quickfast,代码行数:7,代码来源:XMLTemplateParser.cpp

示例7: setLength

void StyleSheetTable::setLength(ZLTextStyleEntry &entry, ZLTextStyleEntry::Feature featureId, const AttributeMap &map, const std::string &attributeName) {
	StyleSheetTable::AttributeMap::const_iterator it = map.find(attributeName);
	if (it != map.end()) {
		::trySetLength(entry, featureId, it->second);
		return;
	}
}
开发者ID:2php,项目名称:FBReaderJ,代码行数:7,代码来源:StyleSheetTable.cpp

示例8: onGet

// callback handler on GET request
void onGet(const HeaderOptions &headerOption , const OCRepresentation& rep , const int eCode)
{
    if(eCode == SUCCESS_RESPONSE)
    {
        std::cout << "GET request was successful" << std::endl;

        AttributeMap attributeMap = rep.getAttributeMap();

        std::cout << "Resource URI: " << rep.getUri() << std::endl;

        for(auto it = attributeMap.begin() ; it != attributeMap.end() ; ++it)
        {
            std::cout << "\tAttribute name: " << it->first << " value: ";
            for(auto valueItr = it->second.begin() ; valueItr != it->second.end() ; ++valueItr)
            {
                std::cout << "\t" << *valueItr << " ";
            }

            std::cout << std::endl;
        }

        std::vector< OCRepresentation > children = rep.getChildren();

        for(auto oit = children.begin() ; oit != children.end() ; ++oit)
        {
            std::cout << "Child Resource URI: " << oit->getUri() << std::endl;

            attributeMap = oit->getAttributeMap();

            for(auto it = attributeMap.begin() ; it != attributeMap.end() ; ++it)
            {
                std::cout << "\tAttribute name: " << it->first << " value: ";
                for(auto valueItr = it->second.begin() ; valueItr != it->second.end() ; ++valueItr)
                {
                    std::cout << "\t" << *valueItr << " ";
                }

                std::cout << std::endl;
            }
        }
    }
    else
    {
        std::cout << "onGET Response error: " << eCode << std::endl;
        std::exit(-1);
    }
}
开发者ID:tizenorg,项目名称:platform.upstream.iotivity,代码行数:48,代码来源:SampleConsumer.cpp

示例9: startElement

void PartHandler::startElement(const QName& qname, const AttributeMap& attributes) {
    _result.reset(new Part());
    _measureIndex = 0;

    auto id = attributes.find(kIdTag);
    if (id != attributes.end())
        _result->setId(id->second);
}
开发者ID:aleph7,项目名称:mxml,代码行数:8,代码来源:PartHandler.cpp

示例10: printAttributeMap

void printAttributeMap(const AttributeMap attributeMap)
{
    for(auto it = attributeMap.begin() ; it != attributeMap.end() ; ++it)
    {
        DBG("\tAttribute name: %s" , it->first.c_str());
        for(auto valueItr = it->second.begin() ; valueItr != it->second.end() ; ++valueItr)
        {
            DBG("\t\tAttribute value: %s" , (*valueItr).c_str());
        }
    }
}
开发者ID:tizenorg,项目名称:platform.upstream.iotivity,代码行数:11,代码来源:oicapp-client.cpp

示例11: startElement

void PedalHandler::startElement(const lxml::QName& qname, const AttributeMap& attributes) {
    using dom::presentOptional;
    using lxml::DoubleHandler;
    using lxml::StringHandler;

    _result.reset(new Pedal{});
    _result->position = PositionFactory::buildFromAttributes(attributes);

    auto type = attributes.find(kTypeAttribute);
    if (type != attributes.end())
        _result->setType(typeFromString(type->second));

    auto line = attributes.find(kLineAttribute);
    if (line != attributes.end())
        _result->setLine(presentOptional(line->second == "yes"));

    auto sign = attributes.find(kSignAttribute);
    if (sign != attributes.end())
        _result->setSign(presentOptional(sign->second == "yes"));
}
开发者ID:aleph7,项目名称:mxml,代码行数:20,代码来源:DirectionTypeHandler.cpp

示例12: setLength

void StyleSheetTable::setLength(ZLTextStyleEntry &entry, ZLTextStyleEntry::Length name, const AttributeMap &map, const std::string &attributeName) {
	StyleSheetTable::AttributeMap::const_iterator it = map.find(attributeName);
	if (it == map.end()) {
		return;
	}
	const std::vector<std::string> &values = it->second;
	if (!values.empty() && !values[0].empty()) {
		short size;
		ZLTextStyleEntry::SizeUnit unit;
		parseLength(values[0], size, unit);
		entry.setLength(name, size, unit);
	}
}
开发者ID:ALEXGUOQ,项目名称:FBReader,代码行数:13,代码来源:StyleSheetTable.cpp

示例13: handleStartElement

void SerializingParser::handleStartElement(const std::string& tag, const std::string&  ns, const AttributeMap& attributes) {
	boost::shared_ptr<XMLElement> element(new XMLElement(tag, ns));
	for (AttributeMap::const_iterator i = attributes.begin(); i != attributes.end(); ++i) {
		element->setAttribute((*i).first, (*i).second);
	}

	if (elementStack_.empty()) {
		rootElement_ = element;
	}
	else {
		(*(elementStack_.end() - 1))->addNode(element);
	}
	elementStack_.push_back(element);
}
开发者ID:bessey,项目名称:picnic-doc-server,代码行数:14,代码来源:SerializingParser.cpp

示例14: TemplateDefinitionError

bool
TemplateBuilder::getRequiredBooleanAttribute(
  const AttributeMap& attributes,
  const std::string& name)
{
  AttributeMap::const_iterator it = attributes.find(name);
  if(it == attributes.end())
  {
    std::string errMsg;
    errMsg +=
      "[ERR S1] Missing required attribute \"" + name + "\"";
    throw TemplateDefinitionError(errMsg);
  }
  return getOptionalBooleanAttribute(attributes, name, false);
}
开发者ID:clearctvm,项目名称:MarketData.Quickfast,代码行数:15,代码来源:XMLTemplateParser.cpp

示例15: writeSparse

	void writeSparse(QFile& file, const AttributeMap& data)
	{
		FNTRACE("ini", "", "writeSparse", QString("file %1, %2 rows of data").arg(file.fileName()).arg(data.size()));

		if (!file.open(QIODevice::WriteOnly | QIODevice::Text | QIODevice::Truncate))
			ETHROW(Exception(QString("Unable to open %1 for writing.").arg(file.fileName())));

		file.resize(0);
		QTextStream fout(&file);

		int max_key_length = 0;
		for (AttributeMap::const_iterator iter = data.begin(); iter != data.end(); ++iter)
		{
			if (iter.key().length() > max_key_length)
				max_key_length = iter.key().length();
		}
		for (AttributeMap::const_iterator iter = data.begin(); iter != data.end(); ++iter)
		{
			fout << iter.key();
			for (int i = iter.key().length(); i < max_key_length; ++i)
				fout << ' ';
			fout << " = " << iter.value() << "\n";
		}
	}
开发者ID:devnev,项目名称:ds1edit-loader,代码行数:24,代码来源:iniparser.cpp


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