1
/* Copyright (C) 2000-2005 Thomas Bopp, Thorsten Hampel, Ludger Merkens
3
* This program is free software; you can redistribute it and/or modify
4
* it under the terms of the GNU General Public License as published by
5
* the Free Software Foundation; either version 2 of the License, or
6
* (at your option) any later version.
8
* This program is distributed in the hope that it will be useful,
9
* but WITHOUT ANY WARRANTY; without even the implied warranty of
10
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11
* GNU General Public License for more details.
13
* You should have received a copy of the GNU General Public License
14
* along with this program; if not, write to the Free Software
15
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18
inherit "/kernel/module";
23
#include <exception.h>
24
#include <attributes.h>
27
static mapping mObjects = ([ ]);
28
static mapping mID = ([ ]);
30
static int oid_length = 4; // nr of bytes for object ids
31
static int persistence_id;
34
#define PROXY "/kernel/proxy.pike"
36
mixed new_object(string id, object obj, string prog_name)
38
if ( !obj->query_attribute(OBJ_TEMP) )
41
//int newid = __id | (get_persistence_id() << OID_BITS);
42
int newid = _Persistence->make_object_id( __id );
43
object p = new(PROXY, newid, obj);
45
_Persistence->set_proxy_status(p, PSTAT_SAVE_OK);
47
return ({ newid, p });
50
object find_object(int|string id)
52
if ( objectp(mObjects[id]) )
56
bool delete_object(object p)
61
int|object load_object(object proxy, int|object oid)
66
void save_object(object proxy, void|string ident, void|string index)
70
void require_save(object proxy, void|string indent, void|string index)
74
object lookup(string identifier)
79
mixed lookup_user(string identifier, void|string password)
84
mixed lookup_group(string identifier)
89
static void init_module()
91
persistence_id = _Persistence->register( "none", this_object() );
94
int get_persistence_id() { return persistence_id; }
95
string get_identifier() { return "persistence:none"; }