23 using namespace basis;
35 auto_synchronizer l(*_locking)
38 #define LOG(to_print) \
39 CLASS_EMERGENCY_LOG(program_wide_logger::get(), to_print)
41 list_manager::list_manager(
const string_array &list_name,
bool backgrounded)
71 int indy = locked_find(classifier);
78 int indy = locked_find(classifier);
87 for (
int i = 0; i < _entries->
elements(); i++) {
100 int indy = locked_find(classifier);
102 _entries->
zap(indy, indy);
106 int list_manager::locked_find(
const string_array &classifier)
108 for (
int i = 0; i < _entries->
elements(); i++) {
110 if (_entries->
get(i)->classifier().length() != classifier.
length())
115 bool problems =
false;
116 for (
int j = classifier.
length() - 1; j >= 0; j--) {
117 if (_entries->
get(i)->classifier()[j] != classifier[j]) {
122 if (problems)
continue;
126 return common::NOT_FOUND;
132 int indy = locked_find(classifier);
141 for (
int i = 0; i < _entries->
elements(); i++)
148 #ifdef DEBUG_LIST_MANAGER
168 _entries->
borrow(indy)->merge(*bun);
181 #ifdef DEBUG_LIST_MANAGER
182 LOG(
astring(
"removing entry now due to merge outcome: ")
183 + _entries->
borrow(indy)->text_form());
185 _entries->
zap(indy, indy);
190 #ifdef DEBUG_LIST_MANAGER
void reset(int number=0, const contents *initial_contents=NULL_POINTER)
Resizes this array and sets the contents from an array of contents.
int length() const
Returns the current reported length of the allocated C array.
Provides a dynamically resizable ASCII character string.
A very common template for a dynamic array of bytes.
Outcomes describe the state of completion for an operation.
An infoton is an individual request parcel with accompanying information.
const structures::string_array & classifier() const
this array of strings is the "name" for this infoton.
Provides a way of identifying users of an octopus object.
Identifies requests made on an octopus by users.
Manages a service within an octopus by processing certain infotons.
const structures::string_array & group() const
returns the name of the group that this tentacle services.
@ NO_HANDLER
no handler for that type of infoton.
int elements() const
the maximum number of elements currently allowed in this amorph.
basis::outcome zap(int start, int end)
Removes a range of indices from the amorph.
void reset()
cleans out all of the contents.
const contents * get(int field) const
Returns a constant pointer to the information at the index "field".
contents * borrow(int field)
Returns a pointer to the information at the index "field".
An array of strings with some additional helpful methods.
Provides a structure for managing a collection of synchronizables.
bool zap(const structures::string_array &classifier)
void retrieve(bundle_list &to_fill) const
bool update(const structures::string_array &classifier, int offset=0)
virtual void expunge(const octopi::octopus_entity &to_remove)
called to remove traces of the entity "to_remove".
void clean(int older_than)
bool is_listed(const structures::string_array &classifier)
virtual basis::outcome consume(octopi::infoton &to_chow, const octopi::octopus_request_id &item_id, basis::byte_array &transformed)
this is the main function that processes infotons for this tentacle.
const structures::string_array & list_name() const
synchronizable * clone_object(const structures::string_array &classifier)
Encapsulates all of the attributes known for an object.
virtual basis::astring text_form() const =0
local version just makes text_form() more functional.
virtual clonable * clone() const =0
must be provided to allow creation of a copy of this object.
timely::time_stamp _updated
Represents a point in time relative to the operating system startup time.
#define formal(parameter)
This macro just eats what it's passed; it marks unused formal parameters.
#define NULL_POINTER
The value representing a pointer to nothing.
#define FUNCDEF(func_in)
FUNCDEF sets the name of a function (and plugs it into the callstack).
The guards collection helps in testing preconditions and reporting errors.
void WHACK(contents *&ptr)
deletion with clearing of the pointer.
bool non_negative(const type &a)
non_negative returns true if "a" is greater than or equal to zero.
bool negative(const type &a)
negative returns true if "a" is less than zero.
A dynamic container class that holds any kind of object via pointers.