1
/* Copyright (c) 2008 PrimeBase Technologies GmbH, Germany
3
* PrimeBase Media Stream 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
* Original author: Paul McCullagh (H&G2JCtL)
20
* Continued development: Barry Leslie
24
* A basic syncronized object.
43
* ---------------------------------------------------------------
47
void CSObject::retain()
49
CSException::throwAssertion(CS_CONTEXT, "Non-referenced object cannot be referenced");
52
void CSObject::release()
59
void CSObject::retain(const char *func, const char *file, uint32_t line)
61
CSException::throwAssertion(CS_CONTEXT, "Non-referenced object cannot be referenced");
64
void CSObject::release(const char *func, const char *file, uint32_t line)
71
CSObject *CSObject::getKey() { CSException::throwCoreError(CS_CONTEXT, CS_ERR_IMPL_MISSING, __FUNC__); return NULL; }
73
int CSObject::compareKey(CSObject *) { CSException::throwCoreError(CS_CONTEXT, CS_ERR_IMPL_MISSING, __FUNC__); return 0; }
75
uint32_t CSObject::hashKey() { CSException::throwCoreError(CS_CONTEXT, CS_ERR_IMPL_MISSING, __FUNC__); return 0; }
77
CSObject *CSObject::getHashLink() { CSException::throwCoreError(CS_CONTEXT, CS_ERR_IMPL_MISSING, __FUNC__); return NULL; }
79
void CSObject::setHashLink(CSObject *) { CSException::throwCoreError(CS_CONTEXT, CS_ERR_IMPL_MISSING, __FUNC__); }
81
CSObject *CSObject::getNextLink() { CSException::throwCoreError(CS_CONTEXT, CS_ERR_IMPL_MISSING, __FUNC__); return NULL; }
83
CSObject *CSObject::getPrevLink() { CSException::throwCoreError(CS_CONTEXT, CS_ERR_IMPL_MISSING, __FUNC__); return NULL; }
85
void CSObject::setNextLink(CSObject *) { CSException::throwCoreError(CS_CONTEXT, CS_ERR_IMPL_MISSING, __FUNC__); }
87
void CSObject::setPrevLink(CSObject *) { CSException::throwCoreError(CS_CONTEXT, CS_ERR_IMPL_MISSING, __FUNC__); }
89
* ---------------------------------------------------------------
92
CSRefObject::CSRefObject():
98
cs_mm_track_memory(NULL, NULL, 0, this, true, iRefCount, iTrackMe);
102
CSRefObject::~CSRefObject()
104
ASSERT(iRefCount == 0);
107
void CSRefObject::retain()
110
CSException::throwAssertion(CS_CONTEXT, "Freed object being retained.");
114
cs_mm_track_memory(NULL, NULL, 0, this, true, iRefCount, iTrackMe);
118
void CSRefObject::release()
123
cs_mm_track_memory(NULL, NULL, 0, this, false, iRefCount, iTrackMe);
137
void CSRefObject::retain(const char *func, const char *file, uint32_t line)
140
cs_mm_print_track(func, file, line, this, true, iRefCount);
143
void CSRefObject::release(const char *func, const char *file, uint32_t line)
147
cs_mm_track_memory(func, file, line, this, false, iRefCount, iTrackMe);
161
* ---------------------------------------------------------------
162
* SHARED REFERENCE OBJECTS
165
CSSharedRefObject::CSSharedRefObject():
172
cs_mm_track_memory(NULL, NULL, 0, this, true, iRefCount, iTrackMe);
176
CSSharedRefObject::~CSSharedRefObject()
178
ASSERT(iRefCount == 0);
181
void CSSharedRefObject::retain()
186
cs_mm_track_memory(NULL, NULL, 0, this, true, iRefCount, iTrackMe);
191
void CSSharedRefObject::release()
197
cs_mm_track_memory(NULL, NULL, 0, this, false, iRefCount, iTrackMe);
211
void CSSharedRefObject::startTracking()
214
cs_mm_track_memory(NULL, NULL, 0, this, true, iRefCount, iTrackMe);
220
void CSSharedRefObject::retain(const char *func, const char *file, uint32_t line)
224
cs_mm_print_track(func, file, line, this, true, iRefCount);
228
void CSSharedRefObject::release(const char *func, const char *file, uint32_t line)
233
cs_mm_track_memory(func, file, line, this, false, iRefCount, iTrackMe);