1
/* Copyright (c) 2007 SNAP Innovation GmbH
3
* BLOB Streaming for MySQL
5
* This program is free software; you can redistribute it and/or modify
6
* it under the terms of the GNU General Public License as published by
7
* the Free Software Foundation; either version 2 of the License, or
8
* (at your option) any later version.
10
* This program is distributed in the hope that it will be useful,
11
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
* GNU General Public License for more details.
15
* You should have received a copy of the GNU General Public License
16
* along with this program; if not, write to the Free Software
17
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19
* Paul McCullagh (H&G2JCtL)
24
* A base class for all TeamDrive classes.
28
#ifndef __CSOBJECT_H__
29
#define __CSOBJECT_H__
38
virtual ~CSObject() { }
40
virtual void retain();
41
virtual void release();
44
* All objects are sortable, hashable and linkable,
45
* as long as these methods are implemented:
47
virtual CSObject *getKey();
48
virtual int compareKey(CSObject *);
49
virtual u_int hashKey();
50
virtual CSObject *getHashLink();
51
virtual void setHashLink(CSObject *);
52
virtual CSObject *getNextLink();
53
virtual CSObject *getPrevLink();
54
virtual void setNextLink(CSObject *);
55
virtual void setPrevLink(CSObject *);
58
static void *operator new(size_t size, const char *func, const char *file, u_int line) {
59
return cs_mm_malloc(func, file, line, size);
62
static void operator delete(void *ptr, size_t size) {
66
//virtual void retain(const char *func, const char *file, u_int line);
67
//virtual void release(const char *func, const char *file, u_int line);
71
class CSRefObject : public CSObject {
74
virtual ~CSRefObject();
76
virtual void retain();
77
virtual void release();
79
//virtual void retain(const char *func, const char *file, u_int line);
80
//virtual void release(const char *func, const char *file, u_int line);
89
class CSSharedRefObject : public CSObject, public CSSync {
92
virtual ~CSSharedRefObject();
94
virtual void retain();
95
virtual void release();
97
//virtual void retain(const char *func, const char *file, u_int line);
98
//virtual void release(const char *func, const char *file, u_int line);
108
#define new new(__FUNC__, __FILE__, __LINE__)
113
virtual void returnToPool() = 0;