std::pair<boost::mpi::communicator, int> mpi_process_group::actual_communicator_and_tag(int tag, int block) const { if (tag >= max_tags * static_cast<int>(impl_->blocks.size())) // Use the out-of-band reply communicator return std::make_pair(impl_->oob_reply_comm, tag); else // Use the normal communicator and translate the tag return std::make_pair(impl_->comm, encode_tag(block == -1? my_block_number() : block, tag)); }
/* * Write the encoding of the byte(s) */ DER_Encoder& DER_Encoder::add_object(ASN1_Tag type_tag, ASN1_Tag class_tag, const uint8_t rep[], size_t length) { std::vector<uint8_t> hdr; encode_tag(hdr, type_tag, class_tag); encode_length(hdr, length); if(m_subsequences.size()) { m_subsequences[m_subsequences.size()-1].add_bytes(hdr.data(), hdr.size(), rep, length); } else if(m_append_output) { m_append_output(hdr.data(), hdr.size()); m_append_output(rep, length); } else { m_default_outbuf += hdr; m_default_outbuf += std::make_pair(rep, length); } return (*this); }
static bool encode_endgroup(void *c, const void *hd) { return encode_tag(c, hd) && commit(c); }
static void *encode_startgroup(void *c, const void *hd) { return (encode_tag(c, hd) && commit(c)) ? c : UPB_BREAK; }
static void *encode_startdelimfield(void *c, const void *hd) { bool ok = encode_tag(c, hd) && commit(c) && start_delim(c); return ok ? c : UPB_BREAK; }