Example #1
0
void DNASequence::NotifyAfter(SequencePosIterator begin, SequencePosIterator end, NotifyFunction after)
{
    if(after)
    {
        SequencePosIterator nowBegin = begin;
        while(nowBegin != end)
        {
            SequencePosIterator nowEnd = nowBegin;
            for(; nowEnd != end && nowEnd->actual != SEPARATION_CHAR; ++nowEnd);
            StrandIterator pbegin(nowBegin, positive);
            StrandIterator pend(nowEnd, positive);
            after(pbegin, pend);
            after(pend.Invert(), pbegin.Invert());
            nowBegin = nowEnd != end ? ++nowEnd : nowEnd;
        }
    }

    size_t pos = 0;
    std::vector<boost::reference_wrapper<SequencePosIterator> > resubscribe;
    for(; begin != end; ++begin, ++pos)
    {
        if(toReplace_[pos] != iteratorStore_.end())
        {
            IteratorPlace it = toReplace_[pos];
            **it = begin;
            resubscribe.push_back(boost::ref(**it));
            it = iteratorStore_.erase(it);
        }
    }

    toReplace_.clear();
    assert(posEnd_.back() == --sequence_.end());
    std::for_each(resubscribe.begin(), resubscribe.end(), boost::bind(&DNASequence::SubscribeIterator, boost::ref(*this), _1));
}
Example #2
0
////////////////////////////////////////////////////////////////////////////
// path.itr
path::iterator path::begin() const
{
    path_view_iterator pit = pbegin(*this);
    iterator it;
    it.__path_ptr_ = this;
    it.__pos_ = pit.__pos_;
    it.__elem_.__assign_view(*pit);
    return it;
}
Example #3
0
string_view path::__parent_path() const
{
    if (empty() || pbegin(*this) == --pend(*this)) {
        return {};
    }
    auto end_it = --(--pend(*this));
    auto end_i = parser::end_of(__pn_, end_it.__pos_);
    return string_view(__pn_).substr(0, end_i+1);
}
Example #4
0
API bool buGetFileLine(BuFile* file, uint64_t address, const char** filename, unsigned int* line)
{
    GetFileLineContext context = {false, address, nullptr, nullptr, 0, pbegin(file->symtab)};

    bfd_map_over_sections(file->abfd.get(), GetFileLineContext::find_address_in_section, &context);

    *filename = CoTaskStrDup(context.filename);
    *line = context.line;

    return context.found;
}
Example #5
0
BuLinetab* buLinetabOpen(BuFile* file)
{
    DecodedLineVMExtractor vm;
    if (!decodedLineProcess(file->abfd.get(), pbegin(file->symtab), &vm)) return 0;

    std::vector<std::string> files(vm.pathcache.size());

    for (auto& p: vm.pathcache)
    {
        // not sure why moving the map key compiles, but it's for the best since it saves reallocations
        files[p.second] = std::move(p.first);
    }

    return new BuLinetab(std::move(files), std::move(vm.lines));
}
	void OpenGLGuiGraphics::drawLine(int32_t x1, int32_t y1, int32_t x2, int32_t y2) {
		const fcn::ClipRectangle& top = mClipStack.top();
		x1 += top.xOffset;
		x2 += top.xOffset;
		y1 += top.yOffset;
		y2 += top.yOffset;

		Point pbegin(static_cast<int32_t>(ceil(x1 + 0.375f)), static_cast<int32_t>(ceil(y1 + 0.375f)));
		Point pend(static_cast<int32_t>(ceil(x2 + 0.625f)), static_cast<int32_t>(ceil(y2 + 0.625f)));

		m_renderbackend->drawLine(pbegin, pend,
			mColor.r, mColor.g, mColor.b, mColor.a);
		m_renderbackend->putPixel(pbegin.x, pbegin.y,
			mColor.r, mColor.g, mColor.b, mColor.a);
		m_renderbackend->putPixel(pend.x, pend.y,
			mColor.r, mColor.g, mColor.b, mColor.a);
	}
	void SdlGuiGraphics::drawLine(int32_t x1, int32_t y1, int32_t x2, int32_t y2) {
		const fcn::ClipRectangle& top = mClipStack.top();
		x1 += top.xOffset;
		x2 += top.xOffset;
		y1 += top.yOffset;
		y2 += top.yOffset;

		Point pbegin(x1, y1);
		Point pend(x2, y2);

		m_renderbackend->drawLine(pbegin, pend,
			mColor.r, mColor.g, mColor.b, mColor.a);
		m_renderbackend->putPixel(pbegin.x, pbegin.y,
			mColor.r, mColor.g, mColor.b, mColor.a);
		m_renderbackend->putPixel(pend.x, pend.y,
			mColor.r, mColor.g, mColor.b, mColor.a);
	}
Example #8
0
void DNASequence::NotifyBefore(SequencePosIterator begin, SequencePosIterator end, NotifyFunction before)
{
    if(before)
    {
        SequencePosIterator nowBegin = begin;
        while(nowBegin != end)
        {
            SequencePosIterator nowEnd = nowBegin;
            for(; nowEnd != end && nowEnd->actual != SEPARATION_CHAR; ++nowEnd);
            StrandIterator pbegin(nowBegin, positive);
            StrandIterator pend(nowEnd, positive);
            before(pbegin, pend);
            before(pend.Invert(), pbegin.Invert());
            nowBegin = nowEnd != end ? ++nowEnd : nowEnd;
        }
    }

    for(; begin != end; ++begin)
    {
        toReplace_.push_back(iteratorStore_.find(&begin));
    }
}
Example #9
0
BuSymtab* buSymtabOpen(BuFile* file)
{
    std::vector<BuSymbolOwn> symbols = getSymbols(file->abfd.get(), pbegin(file->symtab), file->symtab.size());

    return new BuSymtab(std::move(symbols));
}