/*
 * DatabaseDAO.h
 *
 *  Created on: Dec 14, 2010
 *      Author: WEHRLE Geoffrey
 */

#ifndef DATABASEDAO_H_
#define DATABASEDAO_H_

#include "user.h"
#include "group.h"

#include "problema.h"
#include "result.h"
#include "method.h"

Group*       createGroup(Group *);
User*        createUser(User *);

Problema*    createProblem(Problema *, unsigned int id_group);
ResultArray* createResultat(ResultArray *);

ResultArray* createBenchmark(ResultArray *);

/* 
unsigned int createRole(Role *);
unsigned int createDroit(Droit *);
unsigned int createAuthorization(Role *, Droit *);
unsigned int createMethod(Method *);
*/

Group*       readGroup(unsigned int id);
User*        readUser(unsigned int id);

Problema*    readProblema(unsigned int id);
ResultArray* readResult(unsigned int id);

Group*       updateGroup(Group *);
User*        updateUser(User *);

Problema*    updateProblema(Problema *);
Result*      updateResult(Result *);

Group**      getGroups();
User**       getUsers();

Problema**	 getProblema();
ResultArray** getResults();

User*        authentify(char* login, char* password);

boolean      addUserGroup(unsigned int id_user, unsigned int id_group);
boolean      dropUserGroup(unsigned int id_user, unsigned int id_group);

boolean      switchGroupManager(unsigned int id_new_respo, unsigned int id_group);

boolean      deleteGroup(Group *);
boolean      deleteUser(unsigned int id);

boolean      deleteProblema(unsigned int id);
boolean      deleteResult(unsigned int id);

#endif /* DATABASEDAO_H_ */
