Example #1
0
	virtual ~request_handlers()
	{
		std::for_each(
			boost::make_transform_iterator(request_handlers_.begin(), get_spec()),
			boost::make_transform_iterator(request_handlers_.end(), get_spec()),
			std::default_delete<request_spec>());
		std::for_each(
			boost::make_transform_iterator(request_handlers_.begin(), get_handler()),
			boost::make_transform_iterator(request_handlers_.end(), get_handler()),
			std::default_delete<request_handler>());
	}
 void create_frequencies( double g )
 {
     boost::mt19937 rng;
     boost::cauchy_distribution<> cauchy( 0.0 , g );
     boost::variate_generator< boost::mt19937&, boost::cauchy_distribution<> > gen( rng , cauchy );
     generate( m_omega.begin() , m_omega.end() , gen );
 }
inline std::string to_string( const container_type<F>& container, const char* delimeter = "; ") {
    std::stringstream ss;
    for(auto it = container.begin(); std::next(it)!=container.end(); ++it)
        ss << *it << delimeter;
    ss << container.back();
    return ss.str();
}
 static inline void build_half_hull(container_type const& input,
         container_type& output,
         point_type const& left, point_type const& right)
 {
     output.push_back(left);
     for(iterator it = input.begin(); it != input.end(); ++it)
     {
         add_to_hull<Factor>(*it, output);
     }
     add_to_hull<Factor>(right, output);
 }
Example #5
0
	request_handler *find(std::string const &request)
	{
		auto end(boost::make_transform_iterator(request_handlers_.end(), get_spec()));
		auto found_spec(
			std::find_if(
				boost::make_transform_iterator(request_handlers_.begin(), get_spec()),
				end,
				spec_conformed(request)));
		if (found_spec == end) return 0;
		auto found_pair(found_spec.base());
		return found_pair->second;
	}
std::vector<std::string> create_paths( const std::string& directory, const container_type<std::string>& file_names, const std::string& suffix=".txt" ) {
    std::vector<std::string> ret;

    for( auto it=file_names.begin(); it!=file_names.end(); ++it) {
        std::stringstream ss;
        ss << directory << "/" << *it << suffix;
        bfs::path p( ss.str());
        p = bfs::absolute(p);
        p.make_preferred();
        ret.push_back( p.string());
    }
    return ret;
}
	void handler_clear_backup(container_type& cont) const
	{
		typedef typename container_type::iterator iter_type;

		for(iter_type i = cont.begin(), isize = cont.end(); i != isize; ++i)
		{
			if(i->second)
			{
				i->second->close();
			}
		}

		cont.clear();
	}
			AsynchronousBufferReaderList(
				in_iterator_type ina,
				in_iterator_type ine,
				uint64_t rnumbuffers = 16, 
				uint64_t rbufsize = 32,
				uint64_t offset = 0)
			: 
				C(ina,ine), ita(C.begin()), ite(C.end()), numbuffers(rnumbuffers), bufsize(rbufsize)
			{
				while ( ita != ite && offset >= getFileSize(*ita) )
				{
					offset -= getFileSize(*ita);
					ita++;
				}

				if ( ita != ite )
				{
					reader = UNIQUE_PTR_MOVE(reader_ptr_type(new AsynchronousBufferReader(*ita, numbuffers,bufsize,offset)));
				}
			}
Example #9
0
		static const_iterator                        end(const container_type& p) { return p.end(); }
Example #10
0
 bool hit_test(value_type x,value_type y, double) const
 {      
     return point_inside_path(x,y,cont_.begin(),cont_.end());
 } 
Example #11
0
 static typename result_of::const_handle_type<container_type, iterator_handle_tag>::type handle( container_type const & container, value_type const & value )
 {
   for (typename container_type::const_iterator it = container.begin(); it != container.end(); ++it)
     if ( &(*it) == &value ) return it;
   return container.end();
 }
Example #12
0
 void set_handle_invalid( container_type const & container, handle_type & handle, iterator_handle_tag )
 { handle = container.end(); }
Example #13
0
    iterator end() const
    {
	return cont_.end();
    }
Example #14
0
		iterator end() {
			return container_.end();
		}
Example #15
0
	iterator       end()          { return values.end();    }
Example #16
0
 const_iterator end() const              { return list.end();   }
Example #17
0
 iterator end()                          { return list.end();   }
Example #18
0
 std::pair<iterator, bool> force_emplace(Args&&... args)
 {
     return result_pair(list.emplace(list.end(), std::forward<Args>(args)...), true);
 }
Example #19
0
 bool hit_test(value_type x,value_type y, double tol) const
 {      
     return point_on_path(x,y,cont_.begin(),cont_.end(),tol);
 } 
Example #20
0
		const_iterator end() const {
			return container_.end();
		}
Example #21
0
File: main.cpp Project: CCJY/coliru
 static void sort(container_type<size_t> &front, comparator_type comp) {
   std::sort(front.begin(), front.end(), comp);
 }
Example #22
0
 void operator() (container_type & src_container, viennagrid::view<base_container_type, handle_container_tag> & dst_view)
 {
     for (typename container_type::iterator it = src_container.begin(); it != src_container.end(); ++it)
         if (pred_( *it ))
             dst_view.insert_handle( it.handle() );
 }
Example #23
0
 BigUInt(const container_type& array) : 
     data(array.begin(), array.end()) 
 {
 }