This structure holds a set of vtable_row_t, which is a set of attributes. The space for the whole mess is allocated by the vtable_t, and the rows must be populated strictly in sequence, and the attributes of the rows likewise must be populated in sequence. As a row is populated, space for the attributes is peeled off the chunk allocated by the vtable. The idea here is to create, without undue heap activity, a string-based (untyped) virtual table containing various and sundry information. The things that can be gathered and stuffed into virtual tables include: Info about the threads, transactions. A server could, if it so chose, convert this information into a relational table. Originally this was used to send across the wire, via RPC, this info to a client in client/server SHORE. Now it has been stripped down. Someday if this facility proves useful, we should make this collect typed information so that the attributes can be int or double. But for now, they are string representations of the values.
Test programs may use ss_m::xct_collect(vtable &) and kin, and output the results with the operator<< for vtable_t.
Definition at line 207 of file vtable.h.
Public Member Functions | |
NORET | vtable_t () |
int | init (int R, int A, int S) |
NORET | ~vtable_t () |
vtable_row_t & | operator[] (int i) const |
ostream & | operator<< (ostream &o) const |
int | quant () const |
Return number of rows filled. | |
int | size () const |
void | filled_one () |
void | back_out (int n) |
int | realloc () |
int vtable_t::init | ( | int | R, | |
int | A, | |||
int | S | |||
) |
Initialize table with R rows, with up to A attributes, each with a maximum size of S bytes.
Definition at line 156 of file vtable.cpp.
References align, vtable_row_t::bytes_required_for(), vtable_row_t::init_for_attributes(), and w_assert1.
Referenced by sthread_t::collect().
Here is the call graph for this function:
Here is the caller graph for this function: