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

C++ boost::iterator_range类代码示例

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

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



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

示例1: ancestor_iterator

    ancestor_iterator(boost::iterator_range<ParentIterator> r)
        :parent_it(r.begin()), parent_end(r.end()), depth(0) {
        if (parent_it != parent_end) {
            c.reset(new typename super::value_type(*parent_it));
            find_next_parent();
        }

    };
开发者ID:vdav,项目名称:xtpath,代码行数:8,代码来源:ancestor_iterator.hpp


示例2: found_object

 void found_object(boost::iterator_range<Iterator> m) {
     std::string s(m.begin(), m.end());
     cout << "Found object name :" << s <<endl;
     method.is_object=true;
     iface_objects.push_back( s );
     method.name = s;
     cout << method << endl;
 }
开发者ID:psoetens,项目名称:rtt2-conversion,代码行数:8,代码来源:rtt2-converter.cpp


示例3: variable

        explicit variable(boost::iterator_range<Iterator> const& token) :
            _position(token.begin().position())
        {
            // Remove the $ from the name
            auto it = token.begin();
            ++it;
            _name.assign(it, token.end());

            validate_name();
        }
开发者ID:iankronquist,项目名称:puppetcpp,代码行数:10,代码来源:variable.hpp


示例4: string_generate

 inline bool string_generate(OutputIterator& sink
   , boost::iterator_range<Iterator> const& r, CharEncoding, Tag)
 {
     Iterator end = r.end();
     for (Iterator it = r.begin(); it != end; ++it)
     {
         *sink = spirit::char_class::convert<CharEncoding>::to(Tag(), *it);
         ++sink;
     }
     return detail::sink_is_good(sink);
 }
开发者ID:QuentinRougemont,项目名称:MicrosatDemogInference,代码行数:11,代码来源:string_generate.hpp


示例5: attribute_iterator

 attribute_iterator(boost::iterator_range<ParentIterator> r)
     :parent_it(r.begin()), parent_end(r.end()) {
     if (parent_it != parent_end) {
         auto attributes = (*parent_it).attributes();
         attribute_it = attributes.begin();
         attribute_end = attributes.end();
         if (attribute_it == attribute_end) {
             go_to_next();
         }
     }
 }
开发者ID:vdav,项目名称:xtpath,代码行数:11,代码来源:attribute_iterator.hpp


示例6: descendant_iterator

    descendant_iterator(boost::iterator_range<ParentIterator> r)
        :parent_it(r.begin()), parent_end(r.end()), depth(0) {
        if (parent_it != parent_end) {
            c.reset(new typename super::value_type(*parent_it));
            if (c->has_children()) {
                c->first_child();
                depth++;
            } else {
                find_next_leaf();
            }
        }

    };
开发者ID:vdav,项目名称:xtpath,代码行数:13,代码来源:descendant_iterator.hpp


示例7: regex

        explicit regex(boost::iterator_range<Iterator> const& token) :
            _position(token.begin().position())
        {
            auto start = token.begin();
            auto end = token.end();

            if (start != end) {
                ++start;
            }

            // Move the end to the position before the closing / character
            auto last = start;
            for (auto current = start; current != end; ++current) {
                last = current;
            }
            _value.assign(start, last);
        }
开发者ID:iankronquist,项目名称:puppetcpp,代码行数:17,代码来源:regex.hpp


示例8: apply

			static boost::tuple< boost::iterator_range<InputIterator>, size_t >
			apply(unsigned long& v, boost::iterator_range<InputIterator> const& input){
				
				auto iter = input.begin();
				auto const& end = input.end();

				unsigned char * raw_int = reinterpret_cast<unsigned char*>(&v);
				unsigned char const * const raw_int_end = raw_int+sizeof(v);

				while(raw_int!=raw_int_end){

					if( iter==end ) STCRYPT_THROW_EXCEPTION( sio::exception::underflow() );

					*raw_int = *iter;
					++iter;
					++raw_int;
				}

				return boost::make_tuple( boost::make_iterator_range(iter, end), sizeof(unsigned long) );

			}
开发者ID:abelepereira,项目名称:stcrypt,代码行数:21,代码来源:util-sio.hpp


示例9: response_callback_with_reply

// callback to receive reply from server
// reply - pointer to reply string
// cv - pointer to condition variable to notify sender with
void response_callback_with_reply(boost::iterator_range<char const *> const &a,
                                  boost::system::error_code const &error_code,
                                  std::string *reply,
                                  std::condition_variable *cv)
{
    if (!error_code) {
        //std::unique_lock<std::mutex> scoped_lock(reply_mutex);
        reply->append(a.begin());
    } else {
        if (error_code == boost::asio::error::eof) {
            // notify request sender with condition variable about transfer finish
            cv->notify_all();
        }
    }
}
开发者ID:ksergy1,项目名称:interview,代码行数:18,代码来源:client.cpp


示例10: unpackAndUncompressInteger

void unpackAndUncompressInteger(
        const boost::iterator_range<detail::ByteSequence::const_iterator>&
                range,
        Integer& value) {
    unsigned char* valuePointer = reinterpret_cast<unsigned char*>(&value);
    detail::ByteSequence::const_iterator iterator = range.begin();
    const unsigned char& size = *iterator;
    ++iterator;
    constexpr unsigned char maxSize = static_cast<unsigned char>(sizeof(value));
    unsigned char leadingZeroBytes = maxSize - size;
    PackedValue packedValue;
    unsigned char* valueArray =
            reinterpret_cast<unsigned char*>(&packedValue) + leadingZeroBytes;
    std::copy(iterator, iterator + size, valueArray);
    //value = static_cast<Integer>(packedValue - getOffset<Integer>());
}
开发者ID:andrasnemeth,项目名称:comparable-serialization,代码行数:16,代码来源:Sequentialize.hpp


示例11: unpackAndUnshiftInteger

    std::size_t unpackAndUnshiftInteger(
            const boost::iterator_range<detail::ByteSequence::const_iterator>&
                    range,
            Integer& value) {
        PackedValue packedValue = boost::endian::big_to_native(
                *reinterpret_cast<const PackedValue*>(&*range.begin()));

        if (packedValue >= getOffsetZero<PackedValue>()) {
            value = static_cast<Integer>(
                    packedValue - getOffset<Integer, PackedValue>());
        } else {
            value = static_cast<Integer>(packedValue) -
                    getOffset<Integer, PackedValue>();
        }

        return sizeof(value);
    }
开发者ID:andrasnemeth,项目名称:comparable-serialization,代码行数:17,代码来源:Sequentialize.hpp


示例12: found_arg_desc

    void found_arg_desc(boost::iterator_range<Iterator> m) {
        std::string s(m.begin(), m.end());
//        cout << "Found arg desc :" << s <<endl;
        bf::get<1>(method.args.back()) = s;
    }
开发者ID:psoetens,项目名称:rtt2-conversion,代码行数:5,代码来源:rtt2-converter.cpp


示例13: found_arg

    void found_arg(boost::iterator_range<Iterator> m) {
        std::string s(m.begin(), m.end());
//        cout << "Found arg :" << s <<endl;
        method.args.push_back( arg_desc_type(s,"") );
    }
开发者ID:psoetens,项目名称:rtt2-conversion,代码行数:5,代码来源:rtt2-converter.cpp


示例14: found_desc

    void found_desc(boost::iterator_range<Iterator> m) {
        std::string s(m.begin(), m.end());
//        cout << "Found description :" << s <<endl;
        method.description = s;
    }
开发者ID:psoetens,项目名称:rtt2-conversion,代码行数:5,代码来源:rtt2-converter.cpp


示例15: Parser

Parser::Parser(boost::iterator_range<ByteBuffer::const_iterator> range) :
    Parser(range.begin(), range.end())
{
}
开发者ID:riebl,项目名称:vanetza,代码行数:4,代码来源:parser.cpp


示例16: operator

 result_type operator() (boost::iterator_range<Iterator> const& range) const
 { return !range.empty(); }
开发者ID:brycelelbach,项目名称:prana,代码行数:2,代码来源:predicate.cpp


示例17: type

 explicit type(boost::iterator_range<Iterator> const& token) :
     _position(token.begin().position()),
     _name(token.begin(), token.end())
 {
 }
开发者ID:iankronquist,项目名称:puppetcpp,代码行数:5,代码来源:type.hpp


示例18: found_completion

    void found_completion(boost::iterator_range<Iterator> m) {
        std::string s(m.begin(), m.end());
//        cout << "Found C/C++ function :" << s <<endl;
        method.completion = s;
    }
开发者ID:psoetens,项目名称:rtt2-conversion,代码行数:5,代码来源:rtt2-converter.cpp


示例19: found_caller

    void found_caller(boost::iterator_range<Iterator> m) {
        std::string s(m.begin(), m.end());
//        cout << "Found C++ caller :" << s <<endl;
        method.caller = s;
    }
开发者ID:psoetens,项目名称:rtt2-conversion,代码行数:5,代码来源:rtt2-converter.cpp


示例20: a

    std::string a("wangBing");
    boost::to_upper(a);
    std::cout << a << std::endl;
    std::string b = boost::to_lower_copy(a);
    std::cout << a << " " << b << std::endl;

    std::cout << "---------erase---------" << std::endl;
    a = "wangbing hehe   wangbing   ";
    boost::erase_first(a, "hehe");
    std::cout << a << std::endl;

    std::cout << "---------find---------" << std::endl;
    a = "wangbing hehe   wangbing   b1234_";
    boost::regex rx("b[0-9]+_");
    b = "hehe";
    boost::iterator_range< std::string::iterator> it = boost::find_first(a, b);
    std::cout << (it.end() - it.begin()) << " " << std::string(it.begin(), it.end()) << std::endl;
    it = boost::find_regex(a, rx);
    std::cout << (it.end() - it.begin()) << " " << std::string(it.begin(), it.end()) << std::endl;
    
    std::cout << "---------predicate---------" << std::endl;
    a = "wangbing hehe   wangbing   b1234_";
    if(boost::starts_with(a, "wangbing")) {
        std::cout << "hehe" << std::endl;
    }

    std::cout << "---------replace---------" << std::endl;
    a = "wangbing hehe   wangbing   b1234_";
    std::string re = boost::replace_first_copy(a, "wangbing", "WANGBING");
    std::cout << re << std::endl << a << std::endl;
开发者ID:zzucainiao,项目名称:code-backup,代码行数:30,代码来源:stringAlgorithm.cpp



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C++ boost::mt19937类代码示例发布时间:2022-05-31
下一篇:
C++ boost::intrusive_ptr类代码示例发布时间:2022-05-31
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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