33 #ifndef _UCOMMON_LINKED_H_
34 #define _UCOMMON_LINKED_H_
36 #ifndef _UCOMMON_CONFIG_H_
40 #ifndef _UCOMMON_OBJECT_H_
85 virtual void release(
void) __OVERRIDE;
90 virtual void retain(
void) __OVERRIDE;
157 virtual void release(
void) __OVERRIDE;
212 unsigned count(
void)
const;
228 virtual void lock_index(
void);
234 virtual void unlock_index(
void);
420 virtual void clearId(
void);
429 void add(
NamedObject **hash,
char *name,
unsigned size = 1);
436 static void purge(
NamedObject **hash,
unsigned size);
453 static unsigned count(
NamedObject **hash,
unsigned size);
504 static unsigned keyindex(
const char *name,
unsigned size);
538 virtual int compare(
const char *name)
const;
545 inline bool equal(
const char *name)
const {
546 return (compare(name) == 0);
555 return compare(name) == 0;
564 return compare(name) != 0;
651 NamedTree *getChild(
const char *name)
const;
659 NamedTree *getLeaf(
const char *name)
const;
668 return static_cast<NamedTree *
>(Child.begin());
685 return static_cast<NamedTree *
>(Child.getIndexed(index));
700 inline operator bool()
const {
717 void setId(
char *name);
730 return (Child.begin() == NULL);
738 return (Parent == NULL);
771 friend class ObjectQueue;
827 return polypointer_cast<
DLinkedObject *>(Root->head) ==
this;
835 return polypointer_cast<
DLinkedObject *>(Root->tail) ==
this;
908 template <
typename T,
class O = LinkedObject>
958 inline void set(
const T& typed_value) {
971 inline T& operator*() {
975 inline operator T&() {
979 inline void operator()(
const T data) {
1018 ptr =
static_cast<T*
>(pointer);
1022 ptr =
static_cast<T*
>(pointer);
1030 ptr =
static_cast<T*
>(index->
begin());
1061 ptr =
static_cast<T*
>(index->
begin());
1069 ptr =
static_cast<T*
>(pointer);
1092 inline operator T*()
const {
1100 ptr =
static_cast<T*
>(ptr->getPrev());
1107 ptr =
static_cast<T*
>(ptr->getNext());
1115 return static_cast<T*
>(ptr->getNext());
1124 return static_cast<T*
>(ptr->getPrev());
1131 ptr =
static_cast<T*
>(ptr->getNext());
1138 ptr =
static_cast<T*
>(ptr->getPrev());
1146 return (ptr->getNext() != NULL);
1154 return (ptr->getPrev() != NULL);
1161 inline operator bool()
const {
1162 return (ptr != NULL);
1170 return (ptr == NULL);
1173 inline bool is()
const {
1174 return (ptr != NULL);
1204 template <
typename T>
1223 value = source.value;
1247 inline const T&
get(void)
const {
1265 return (node == NULL) ? NULL : node->value;
1273 return (!Child.
begin() && value != NULL);
1304 inline void set(
const T& reference) {
1330 return static_cast<treemap*
>(Parent);