A datum in a virtual table is an 64-byte string. The strings usually take the form "name value". A vtable_row_t is an array of these data, and represents a row in a virtual table. It is a structure "imposed" on an already-allocated block of data. This struct does NOT allocate or deallocate anything.
Each "attribute" or entry of the row is identified by an integer.
Definition at line 54 of file vtable.h.
Public Member Functions | |
NORET | vtable_row_t () |
NORET | ~vtable_row_t () |
int | quant () const |
Number of attributes in the row. | |
char * | end () const |
int | size_in_bytes () const |
int | value_size () const |
void | init_for_attributes (int n, int m) |
void | reinit_for_attributes (int n) |
void | set_uint (int a, unsigned int v) |
Convert the unsigned int to a string datum at the location for a. | |
void | set_int (int a, int v) |
Convert the int to a string datum at the location for a. | |
void | set_base (int a, w_base_t::base_stat_t v) |
Convert the base_stat_t to a string datum at the location for a. | |
void | set_base (int a, w_base_t::base_float_t v) |
Convert the base_float_t to a string datum at the location for a. | |
void | set_string (int a, const char *v) |
Copy the string to a string datum at the location for a. | |
const char * | operator[] (int a) const |
Return whatever string is already written to the location for a. | |
ostream & | operator<< (ostream &o) |
int | n () const |
Return the number of entries/locations/attributes for this "row". | |
void | dump (const char *msg) const |
Static Public Member Functions | |
static int | bytes_required_for (int n, int m) |
static int vtable_row_t::bytes_required_for | ( | int | n, | |
int | m | |||
) | [inline, static] |
Return # bytes user must allocate to accommodate n attributes of m bytes each plus whatever overhead we have in this structure.
Definition at line 79 of file vtable.h.
Referenced by vtable_t::init(), and init_for_attributes().
Here is the caller graph for this function:
void vtable_row_t::init_for_attributes | ( | int | n, | |
int | m | |||
) | [inline] |
Initialize a row for n attributes. Must be at least 1. Assumes we have enough space for this to happen. User of this row must have allocated enough space. Let the maximum value size be m.
Definition at line 91 of file vtable.h.
References bytes_required_for(), size_in_bytes(), w_assert0, w_assert1, and w_assert3.
Referenced by vtable_t::init().
Here is the call graph for this function:
Here is the caller graph for this function:
void vtable_row_t::reinit_for_attributes | ( | int | n | ) | [inline] |