time_stamp _when_added; // when the data became available.
infoton_holder(const octopus_request_id &id = octopus_request_id(),
time_stamp _when_added; // when the data became available.
infoton_holder(const octopus_request_id &id = octopus_request_id(),
: _item(item), _id(id), _when_added() {}
~infoton_holder() { WHACK(_item); }
: _item(item), _id(id), _when_added() {}
~infoton_holder() { WHACK(_item); }
- : _empty_baskets(NIL), _any_item(NIL), _items_held(items_held),
+ : _empty_baskets(NULL_POINTER), _any_item(NULL_POINTER), _items_held(items_held),
bool entity_data_bin::add_item(infoton *to_add,
const octopus_request_id &orig_id)
{
bool entity_data_bin::add_item(infoton *to_add,
const octopus_request_id &orig_id)
{
GRAB_LOCK;
// create a record to add to the appropriate bin.
infoton_holder *holder = new infoton_holder(orig_id, to_add);
GRAB_LOCK;
// create a record to add to the appropriate bin.
infoton_holder *holder = new infoton_holder(orig_id, to_add);
-//#ifdef DEBUG_ENTITY_DATA_BIN
-// #define static_class_name() "entity_data_bin"
-// FUNCDEF("any_item_applier");
-//#endif
+ #define static_class_name() "entity_data_bin"
+ FUNCDEF("any_item_applier");
GRAB_LOCK;
apply_struct apple(_items_held);
_table->apply(any_item_applier, &apple);
GRAB_LOCK;
apply_struct apple(_items_held);
_table->apply(any_item_applier, &apple);
DUMP_STATE;
// retrieve the information from our basket that was provided.
infoton_holder *found = apple._any_item->acquire(0);
DUMP_STATE;
// retrieve the information from our basket that was provided.
infoton_holder *found = apple._any_item->acquire(0);
int entity_data_bin::acquire_for_entity(const octopus_entity &requester,
infoton_list &items, int maximum_size)
{
int entity_data_bin::acquire_for_entity(const octopus_entity &requester,
infoton_list &items, int maximum_size)
{
// this method does not grab the lock because it simply composes other
// class methods without interacting with class data members.
items.reset();
// this method does not grab the lock because it simply composes other
// class methods without interacting with class data members.
items.reset();
infoton *entity_data_bin::acquire_for_identifier(const octopus_request_id &id)
{
FUNCDEF("acquire_for_identifier");
infoton *entity_data_bin::acquire_for_identifier(const octopus_request_id &id)
{
FUNCDEF("acquire_for_identifier");
}
for (int i = 0; i < bask->elements(); i++) {
if (bask->get(i)->_id == id) {
to_return = bask->borrow(i)->_item; // snag the item.
}
for (int i = 0; i < bask->elements(); i++) {
if (bask->get(i)->_id == id) {
to_return = bask->borrow(i)->_item; // snag the item.