36 class mailbox :
public virtual basis::root_object
91 OKAY = basis::common::OKAY,
94 DEFINE_OUTCOME(APPLY_WHACK, -47,
"Removes the current letter, but "
96 DEFINE_OUTCOME(APPLY_WHACK_STOP, -48,
"Halts apply and trashes the "
121 mailbox_bank *_packages;
Provides a dynamically resizable ASCII character string.
Outcomes describe the state of completion for an operation.
A virtual base class for pieces of "mail". Used by the mailbox object.
Implements a thread safe "mail" delivery system.
void get_ids(structures::int_set &to_fill)
stuffs the set "to_fill" with the ids of all mailboxes present.
void drop_off(const structures::unique_int &id, letter *package)
drops a "package" in the mailbox for "id".
int waiting(const structures::unique_int &id) const
returns the number of items waiting for the "id" specified, if any.
basis::outcome apply_function(letter ¤t, int uid, void *data_link)
the "apply_function" is what a user of apply() must provide.
bool pick_up(const structures::unique_int &id, letter *&package)
returns true if the mailbox for "id" had a "package" to be delivered.
bool close_out(const structures::unique_int &id)
dumps all packages stored for the "id" and shuts down its mailbox.
void clean_up()
removes any empty mailboxes from our list.
void show(basis::astring &to_fill)
provides a picture of what's waiting in the mailbox.
void limit_boxes(int max_letters)
establishes a limit on the number of letters.
void apply(apply_function *to_apply, void *data_link)
calls the "to_apply" function on possibly every letter in the mailbox.
@ OKAY
continue apply process.
A simple object that wraps a templated set of ints.
A unique identifier based on integers.