taskrambler  0.1.8
Web server and task management solution.
hashable.c File Reference
#include <stdlib.h>
#include <stdio.h>
#include <stdarg.h>
#include "class.h"
#include "hash/interface/hashable.h"
+ Include dependency graph for hashable.c:

Go to the source code of this file.

Functions

unsigned long hashableGetHash (void *hashable)
 
void hashableHandleDouble (void *hashable, void *new_hashable)
 

Variables

const struct interface i_Hashable
 

Detailed Description

Author
Georg Hopp

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.

Definition in file hashable.c.

Function Documentation

unsigned long hashableGetHash ( void *  hashable)

Definition at line 36 of file hashable.c.

References i_Hashable::getHash, HAS_PARENT, and IFACE_GET.

Referenced by hashAddComp(), hashDeleteComp(), and hashGetComp().

37 {
38  unsigned long ret;
39 
40  //RETCALL(hashable, Hashable, getHash, ret);
41  do {
42  struct i_Hashable * iface;
43  //_CALL(GET_CLASS(hashable), Hashable, getHash);
44  do {
45  class_ptr class = GET_CLASS(hashable);
46  iface = (struct i_Hashable *)IFACE_GET(class, &i_Hashable);
47  while ((NULL == iface || NULL == iface->getHash) && HAS_PARENT(class)) {
48  class = class->parent;
49  iface = (struct i_Hashable *)IFACE_GET(class, &i_Hashable);
50  }
51  assert(NULL != iface->getHash);
52  } while(0);
53 
54  ret = iface->getHash(hashable);
55  } while(0);
56 
57 
58  return ret;
59 }
class_ptr parent
Definition: class/class.h:135
#define IFACE_GET(class, iface)
Definition: class/class.h:85
#define HAS_PARENT(class)
Definition: class/class.h:86

+ Here is the caller graph for this function:

void hashableHandleDouble ( void *  hashable,
void *  new_hashable 
)

Definition at line 62 of file hashable.c.

References CALL, and i_Hashable::handleDouble.

Referenced by hashAdd().

63 {
64  CALL(hashable, Hashable, handleDouble, new_hashable);
65 }
#define CALL(object, _iface, method,...)
Definition: class/class.h:106
fptr_hashableHandleDouble handleDouble
Definition: hashable.h:37

+ Here is the caller graph for this function:

Variable Documentation

const struct interface i_Hashable
Initial value:
= {
"hashable",
2
}

Definition at line 30 of file hashable.c.