//! Memory manager used by hash. MemoryManager memory_manager() const { return MemoryManager(ib_hash_pool(ib())); }
Connection ConstTransaction::connection() const { return Connection(ib()->conn); }
boost::posix_time::ptime ConstTransaction::started_time() const { return ib_to_ptime(ib()->tv_created); }
VarStore Transaction::var_store() const { return VarStore(ib()->var_store); }
MemoryPool ConstTransaction::memory_pool() const { return MemoryPool(ib()->mp); }
ParsedNameValue ConstTransaction::request_header() const { return ParsedNameValue(ib()->request_header->head); }
void Transaction::destroy() const { ib_tx_destroy(ib()); }
const char* ConstContext::name() const { return ib_context_name_get(ib()); }
const char* ConstContext::full_name() const { return ib_context_full_get(ib()); }
MemoryManager Context::memory_manager() { return MemoryManager(ib_context_get_mm(ib())); }
const char* ConstContext::type() const { return ib_context_type_get(ib()); }
ImageDraw::operator Image() const { GuiLock __; XImage *xim = XGetImage(Xdisplay, dw, 0, 0, max(size.cx, 1), max(size.cy, 1), AllPlanes, ZPixmap); if(!xim) return Null; Visual *v = DefaultVisual(Xdisplay, Xscreenno); RasterFormat fmt; RGBA palette[256]; switch(xim->depth) { case 15: case 16: if(xim->byte_order == LSBFirst) fmt.Set16le(v->red_mask, v->green_mask, v->blue_mask); else fmt.Set16be(v->red_mask, v->green_mask, v->blue_mask); break; case 8: { int n = min(v->map_entries, 256); XColor colors[256]; for(int i = 0; i < 256; i++) { colors[i].pixel = i; colors[i].flags = DoRed|DoGreen|DoBlue; } XQueryColors(Xdisplay, Xcolormap, colors, n); XColor *s = colors; XColor *e = s + n; while(s < e) { RGBA& t = palette[s->pixel]; t.r = s->red >> 8; t.g = s->green >> 8; t.b = s->blue >> 8; t.a = 255; s++; } fmt.Set8(); break; } default: if(xim->bits_per_pixel == 32) if(xim->byte_order == LSBFirst) fmt.Set32le(v->red_mask, v->green_mask, v->blue_mask); else fmt.Set32be(v->red_mask, v->green_mask, v->blue_mask); else if(xim->byte_order == LSBFirst) fmt.Set24le(v->red_mask, v->green_mask, v->blue_mask); else fmt.Set24be(v->red_mask, v->green_mask, v->blue_mask); break; } ImageBuffer ib(size); const byte *s = (const byte *)xim->data; RGBA *t = ib; for(int y = 0; y < size.cy; y++) { fmt.Read(t, s, size.cx, palette); s += xim->bytes_per_line; t += size.cx; } XDestroyImage(xim); if(has_alpha) { xim = XGetImage(Xdisplay, alpha.dw, 0, 0, max(size.cx, 1), max(size.cy, 1), AllPlanes, ZPixmap); if(xim) { const byte *s = (const byte *)xim->data; t = ib; Buffer<RGBA> line(size.cx); for(int y = 0; y < size.cy; y++) { fmt.Read(line, s, size.cx, palette); for(int x = 0; x < size.cx; x++) (t++)->a = line[x].r; s += xim->bytes_per_line; } XDestroyImage(xim); } } Premultiply(ib); return ib; }
//! Clear hash. void clear() const { ib_hash_clear(ib()); }
/** * Fetch all values into a list. * * Consider using iterators instead. * * @param[in] list List to write values to. **/ void get_all(List<T>& list) const { throw_if_error(ib_hash_get_all(ib(), list.ib())); }
const char* ConstTransaction::path() const { return ib()->path; }
Context ConstContext::parent() const { return Context(ib_context_parent_get(ib())); }
ParsedRequestLine ConstTransaction::request_line() const { return ParsedRequestLine(ib()->request_line); }
Engine ConstContext::engine() const { return Engine(ib_context_get_engine(ib())); }
ConstVarStore ConstTransaction::var_store() const { return ConstVarStore(ib()->var_store); }
boost::posix_time::ptime ConstTransaction::postprocess_time() const { return ib_to_ptime(ib()->tv_created, (ib()->t.postprocess - ib()->t.started)); }
ib_flags_t& Transaction::flags() const { return ib()->flags; }
boost::posix_time::ptime ConstTransaction::logtime_time() const { return ib_to_ptime(ib()->tv_created, (ib()->t.logtime - ib()->t.started)); }
Engine ConstTransaction::engine() const { return Engine(ib()->ib); }
Transaction ConstTransaction::next() const { return Transaction(ib()->next); }
const char* ConstTransaction::id() const { return ib()->id; }
const char* ConstTransaction::hostname() const { return ib()->hostname; }
Context ConstTransaction::context() const { return Context(ib()->ctx); }
const char* ConstTransaction::effective_remote_ip_string() const { return ib()->er_ipstr; }
boost::posix_time::ptime ConstTransaction::request_finished_time() const { return ib_to_ptime(ib()->tv_created, (ib()->t.request_finished - ib()->t.started)); }
//! Number of elements in hash. O(1) size_type size() const { return ib_hash_size(ib()); }