本文整理汇总了C++中buffer类的典型用法代码示例。如果您正苦于以下问题:C++ buffer类的具体用法?C++ buffer怎么用?C++ buffer使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了buffer类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: _handler
void link::recv_handler(buffer<uint8>& buff, size_t rbytes, const boost::system::error_code& ec)
{
if (ec) {
mih::message pm;
_handler(pm, ec);
} else {
mih::frame* fm = mih::frame::cast(buff.get(), rbytes);
if (fm) {
mih::message pm(*fm);
_handler(pm, ec);
}
}
void* rbuff = buff.get();
size_t rlen = buff.size();
_sock.async_receive(boost::asio::buffer(rbuff, rlen),
boost::bind(&link::recv_handler,
this,
bindrv(buff),
boost::asio::placeholders::bytes_transferred,
boost::asio::placeholders::error));
}
开发者ID:shtrom,项目名称:odtone,代码行数:27,代码来源:link.cpp
示例2: parse_quoted_symbol_or_token
static name parse_quoted_symbol_or_token(parser & p, buffer<token_entry> & new_tokens, bool & used_default, notation_entry_group grp) {
used_default = false;
if (p.curr_is_quoted_symbol()) {
environment const & env = p.env();
auto pp_tk = p.get_name_val();
auto tks = utf8_trim(pp_tk.to_string());
auto tkcs = tks.c_str();
check_not_forbidden(tkcs);
p.next();
if (p.curr_is_token(get_colon_tk())) {
p.next();
unsigned prec = parse_precedence(p);
new_tokens.push_back(mk_token_entry(tkcs, prec, grp));
} else if (!get_precedence(env, tkcs, grp)) {
new_tokens.push_back(mk_token_entry(tkcs, LEAN_DEFAULT_PRECEDENCE, grp));
used_default = true;
}
return pp_tk;
} else if (p.curr_is_keyword()) {
auto tk = p.get_token_info().token();
check_not_forbidden(tk.to_string().c_str());
p.next();
return tk;
} else {
throw parser_error("invalid notation declaration, symbol expected", p.pos());
}
}
开发者ID:GallagherCommaJack,项目名称:lean,代码行数:27,代码来源:notation_cmd.cpp
示例3: next_utf_core
void scanner::next_utf_core(char c, buffer<char> & cs) {
cs.push_back(c);
while (m_uskip > 0) {
next();
cs.push_back(curr());
}
}
开发者ID:cpehle,项目名称:lean,代码行数:7,代码来源:scanner.cpp
示例4: Get_PTEx
bool Get_PTEx(buffer &c)
{
return c.addStr("PTExˆ\6\0\0", 8)
&& c.add<u8>(0, 1056)
&& c.add<u8>(1, 44)
&& c.addStr("\0\0\0\0\1\0\1\0\0\0\0\0\1\0\1\0\0\0\1\0\0\0\0\1\0\0\0\0\1\1\0\0\0\1\1\0\0\0\0\0\0\0\0\0", 44)
&& c.add<u8>(1, 528);
}
开发者ID:heinermann,项目名称:Chkdraft,代码行数:8,代码来源:DefaultCHK.cpp
示例5: out
inline void device_buf::out(byte p)
{
// TODO: If out_buf was resized so that it would be full at the next flush moment,
// we only need to do one check here.
out_buf.put(p);
if(out_buf.size() > out_buffer_size)
flush(); // Time to flush
}
开发者ID:coyun,项目名称:gvl,代码行数:8,代码来源:device_buf.hpp
示例6: Get_MRGN
bool Get_MRGN(buffer &c, u16 width, u16 height)
{
return c.addStr("MRGN\0\5\0\0", 8)
&& c.add<u8>(0, 1268)
&& c.add<u32>(width * 32) // 'Anywhere' x-end
&& c.add<u32>(height * 32) // 'Anywhere' y-end
&& c.addStr("\3\0\0\0", 4); // 'Anywhere' string number (3) and elevation (all)
}
开发者ID:heinermann,项目名称:Chkdraft,代码行数:8,代码来源:DefaultCHK.cpp
示例7: Get_PTEC
bool Get_PTEC(buffer &c)
{
return c.addStr("PTEC\220\3\0\0", 8)
&& c.add<u8>(0, 576)
&& c.add<u8>(1, 24)
&& c.addStr("\0\0\0\0\1\0\1\0\0\0\0\0\1\0\1\0\0\0\1\0\0\0\0", 23)
&& c.add<u8>(1, 289);
}
开发者ID:heinermann,项目名称:Chkdraft,代码行数:8,代码来源:DefaultCHK.cpp
示例8: Get_UPGR
bool Get_UPGR(buffer &c)
{
return c.addStr("UPGRÔ\6\0\0", 8)
&& c.add<u8>(0, 1104)
&& c.addStr("\3\3\3\3\3\3\3\3\3\3\3\3\3\3\3\3\1\1\0\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1", 45)
&& c.add<u8>(0, 47)
&& c.add<u8>(1, 552);
}
开发者ID:heinermann,项目名称:Chkdraft,代码行数:8,代码来源:DefaultCHK.cpp
示例9: copy_limbs
friend void copy_limbs(imp * p, buffer<name::imp *> & limbs) {
limbs.clear();
while (p != nullptr) {
limbs.push_back(p);
p = p->m_prefix;
}
std::reverse(limbs.begin(), limbs.end());
}
开发者ID:syohex,项目名称:lean,代码行数:8,代码来源:name.cpp
示例10: enqueue_unmap_buffer
/// Enqueues a command to unmap \p buffer from the host memory space.
///
/// \see_opencl_ref{clEnqueueUnmapMemObject}
event enqueue_unmap_buffer(const buffer &buffer,
void *mapped_ptr,
const wait_list &events = wait_list())
{
BOOST_ASSERT(buffer.get_context() == this->get_context());
return enqueue_unmap_mem_object(buffer.get(), mapped_ptr, events);
}
开发者ID:ariosx,项目名称:compute,代码行数:11,代码来源:command_queue.hpp
示例11: append
static void append(buffer &json, const char *key, const std::string &value)
{
json.append("\"" , 1);
json.append( key, strlen(key) ); //"key"
json.append("\":", 2);
append(json, value);
}
开发者ID:jkhoogland,项目名称:jsonpack,代码行数:8,代码来源:strings.hpp
示例12: buffer
buffer(buffer const& b)
: m_begin(0)
, m_size(0)
, m_capacity(0)
{
if (b.size() == 0) return;
resize(b.size());
std::memcpy(m_begin, b.begin(), b.size());
}
开发者ID:Meonardo,项目名称:libtorrent,代码行数:9,代码来源:buffer.hpp
示例13: Get_PUPx
bool Get_PUPx(buffer &c)
{
return c.addStr("PUPx\16\t\0\0", 8)
&& c.add<u8>(0, 1464)
&& c.add<u8>(3, 16)
&& c.addStr("\1\1\0\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\0\0\1\0\1\0\1\1\1\1", 39)
&& c.add<u8>(0, 67)
&& c.add<u8>(1, 732);
}
开发者ID:heinermann,项目名称:Chkdraft,代码行数:9,代码来源:DefaultCHK.cpp
示例14: A_upper_input
character A_upper_calltype A_upper_input(bool writeback, character c, buffer& ib) {
if (writeback) {
ib.push_front(c);
return 0;
} else {
if (ib.size() > 0) return ib.pop_front();
return (character)fgetc(stdin);
}
}
开发者ID:Execsl,项目名称:usnap,代码行数:9,代码来源:skeleton.cpp
示例15: buffer
buffer(buffer const& b)
: m_begin(0)
, m_end(0)
, m_last(0)
{
if (b.size() == 0) return;
resize(b.size());
std::memcpy(m_begin, b.begin(), b.size());
}
开发者ID:naroya,项目名称:fdm,代码行数:9,代码来源:buffer.hpp
示例16: list_cases_on_core
unsigned list_cases_on_core(list<A> const & l, buffer<vm_obj> & data) {
if (empty(l)) {
return 0;
} else {
data.push_back(to_obj(head(l)));
data.push_back(list_to_obj(tail(l)));
return 1;
}
}
开发者ID:soonhokong,项目名称:lean-osx,代码行数:9,代码来源:vm_list.cpp
示例17: make_json
JSONPACK_API_BEGIN_NAMESPACE
////============================== MAKE_JSON ==============================================
static inline void make_json(buffer &json, const std::string &UNUSED(key) )
{
json.erase_last_comma();
json.append("}\0", 2);
}
开发者ID:jkhoogland,项目名称:jsonpack,代码行数:10,代码来源:serializer_cpp11.hpp
示例18: copy_from
void copy_from(buffer& source)
{
source.unmap();
source.bind();
GL(glBindTexture(GL_TEXTURE_2D, id_));
GL(glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, width_, height_, FORMAT[stride_], TYPE[stride_], NULL));
GL(glBindTexture(GL_TEXTURE_2D, 0));
source.unbind();
source.map(); // Just map it back since map will orphan buffer.
}
开发者ID:Mistobaan,项目名称:CasparCG,代码行数:10,代码来源:texture.cpp
示例19: copy_to
void copy_to(buffer& dest)
{
dest.unmap();
dest.bind();
GL(glBindTexture(GL_TEXTURE_2D, id_));
GL(glReadBuffer(GL_COLOR_ATTACHMENT0));
GL(glReadPixels(0, 0, width_, height_, FORMAT[stride_], TYPE[stride_], NULL));
GL(glBindTexture(GL_TEXTURE_2D, 0));
dest.unbind();
GL(glFlush());
}
开发者ID:Mistobaan,项目名称:CasparCG,代码行数:11,代码来源:texture.cpp
示例20: mk_fresh_name
static name mk_fresh_name(environment const & env, buffer<name> const & names, name const & s) {
unsigned i = 1;
name c = s;
while (true) {
if (!env.find(c) &&
std::find(names.begin(), names.end(), c) == names.end())
return c;
c = s.append_after(i);
i++;
}
}
开发者ID:bmalehorn,项目名称:lean,代码行数:11,代码来源:projection.cpp
注:本文中的buffer类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论