/usr/include/sipxtapi/rtcp/BaseClass.h is in libsipxtapi-dev 3.3.0~test17-2.1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 | //
// Copyright (C) 2006-2013 SIPez LLC. All rights reserved.
//
// Copyright (C) 2004-2006 SIPfoundry Inc.
// Licensed by SIPfoundry under the LGPL license.
//
// Copyright (C) 2004-2006 Pingtel Corp. All rights reserved.
// Licensed to SIPfoundry under a Contributor Agreement.
//
// $$
///////////////////////////////////////////////////////////////////////////////
// Border Guard
#ifndef _BaseClass_h /* [ */
#define _BaseClass_h
#include "rtcp/RtcpConfig.h"
#include "os/OsSysLog.h"
// Includes
#ifdef WIN32 /* [ */
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#include <objbase.h>
#include <stdio.h>
#ifdef PINGTEL_PRINTF
#include "os/OsDefs.h"
#else
#define osPrintf printf
#endif
// Required for VC7 compatibility
#if _MSC_VER >= 1300
#ifndef interface
#define interface __interface
#endif
#endif
#endif /* WIN32 ] */
#ifdef _VXWORKS /* [ */
#include <vxworks.h>
#include <stdio.h>
#include <inetLib.h>
#include <hostLib.h>
#include <string.h>
#include "os/OsDefs.h"
// Windows Compatability
#define interface struct
// Make sure that WAIT FOREVER is defined
#ifndef WAIT_FOREVER
#define WAIT_FOREVER VX_WAIT_FOREVER
#endif /* WAIT_FOREVER */
#endif /* _VXWORKS ] */
// Static Declarations
// static unsigned long sulTotalReferenceCount = 0;
extern bool bPingtelDebug;
#ifndef WIN32 /* [ */
#ifdef __pingtel_on_posix__ /* [ */
#include <os/OsBSem.h>
typedef OsBSem * CRITICAL_SECTION;
#define interface struct
#endif /* __pingtel_on_posix__ ] */
#ifdef _VXWORKS /* [ */
#include <semLib.h>
typedef SEM_ID CRITICAL_SECTION;
#endif /* _VXWORKS ] */
/*|><|************************************************************************
*
* Functions: CriticalSection support
*
*
* Inputs: CRITICAL_SECTION *csSynchronized
*
* Outputs: None
*
* Returns: None
*
* Description: Compatability functions that map to
* complementary calls under Win32.
*
*
*************************************************************************|<>|*/
void InitializeCriticalSection(CRITICAL_SECTION *csSynchronized);
void EnterCriticalSection(CRITICAL_SECTION *csSynchronized);
void LeaveCriticalSection(CRITICAL_SECTION *csSynchronized);
void DeleteCriticalSection(CRITICAL_SECTION *csSynchronized);
#endif /* NOT _WIN32 ] */
/**
*
* Class Name: CBaseClass
*
* Inheritance: CBaseClass - Base Class Implementation
*
*
* Interfaces: None
*
* Description: The CBaseClass Class contains functions common to all class
* within the Pingtel programming environment.
*
* Notes: The CBaseClass is inherited by all RTCP Report objects.
*
*/
class CBaseClass
{
// Public Methods
public:
/**
*
* Method Name: CBaseClass() - Constructor
*
*
* Inputs: None
*
*
* Outputs: None
*
* Returns: None
*
* Description: The CBaseClass is an abstract class that is initialized by a
* derived object at construction time.
*
* Usage Notes:
*
*/
CBaseClass CBASECLASS_PROTO_ARGS((const char* pDerivedType = "Unknown", int callLineNum = 0));
/**
*
* Method Name: ~CBaseClass() - Destructor
*
*
* Inputs: None
*
* Outputs: None
*
* Returns: None
*
* Description: Shall deallocate and/or release all resources which were
* acquired over the course of runtime.
*
* Usage Notes:
*
*
*/
virtual ~CBaseClass(void);
/**
*
* Method Name: Initialize
*
*
* Inputs: None
*
* Outputs: None
*
* Returns: bool
*
* Description: Performs runtime initialization that may be failure prone
* and therefore inappropriate for execution within a constructor.
*
* Usage Notes:
*
*
*/
virtual bool Initialize(void);
/**
*
* Method Name: IsInitialized
*
*
* Inputs: None
*
* Outputs: None
*
* Returns: Boolean True/False
*
* Description: Returns a boolean specifying whether an object has already
* been created and initialized.
*
* Usage Notes:
*
*
*/
bool IsInitialized(void);
void setAutomatic(bool);
/**
*
* Method Name: AddRef
*
*
* Inputs: None
*
* Outputs: None
*
* Returns: unsigned long
*
* Description: Increments the number of references to this object.
*
* Usage Notes:
*
*
*/
virtual unsigned long AddRef ADD_RELEASE_PROTO_ARGS((int callLineNum));
/**
*
* Method Name: Release
*
*
* Inputs: None
*
* Outputs: None
*
* Returns: unsigned long
*
* Description: Decrements the number of references to this object.
*
* Usage Notes:
*
*
*/
virtual unsigned long Release ADD_RELEASE_PROTO_ARGS((int callLineNum));
static bool AllowDeletes(void);
static void s_SetAllowDeletes(int v);
// protected:
/**
*
* Attribute Name: m_bInitialized
*
* Type: bool
*
* Description: This member shall store an indicator of whether
* construction time initialization completed successfully.
*
*/
bool m_bInitialized;
bool m_bAutomatic;
/**
*
* Attribute Name: m_ulReferences
*
* Type: int
*
* Description: This member shall keep track of the number of references
* to an object.
*
*/
int m_ulReferences;
#ifdef RTCP_DEBUG_REFCOUNTS /* [ */
const char* m_DerivedType;
int m_Line;
#endif /* RTCP_DEBUG_REFCOUNTS ] */
static bool s_bAllowDeletes;
};
/**
*
* Method Name: Initialize
*
*
* Inputs: None
*
* Outputs: None
*
* Returns: bool
*
* Description: Performs runtime initialization that may be failure prone and
* therefore inappropriate for execution within a constructor.
*
* Usage Notes:
*
*
*/
inline bool CBaseClass::Initialize(void)
{
// Set initialization flag to TRUE
m_bInitialized = TRUE;
return(TRUE);
}
/**
*
* Method Name: IsInitialized
*
*
* Inputs: None
*
* Outputs: None
*
* Returns: Boolean True/False
*
* Description: Returns a boolean specifying whether an object instance has
* already been created and initialized.
*
* Usage Notes:
*
*
*/
inline bool CBaseClass::IsInitialized(void)
{
return(m_bInitialized);
}
inline void CBaseClass::setAutomatic(bool yesNo)
{
m_bAutomatic = yesNo;
}
inline bool CBaseClass::AllowDeletes(void)
{
return(s_bAllowDeletes);
}
/**
*
* Macro Name: DECLARE_IBASE_M
*
*
* Inputs: None
*
* Outputs: None
*
* Returns: None
*
* Description: This implements the IBaseClass functions used and exposed by
* derived classes.
*
* Usage Notes:
*
*
*/
#define DECLARE_IBASE_M \
unsigned long AddRef ADD_RELEASE_PROTO_ARGS((int callLineNum)) \
{ \
if (callLineNum > 0) OsSysLog::add(FAC_MP, PRI_DEBUG, __FILE__ " %p->AddRef(%d), count: %d", this, callLineNum, m_ulReferences); \
return CBaseClass::AddRef(ADD_RELEASE_CALL_ARGS(callLineNum)); \
} \
unsigned long Release ADD_RELEASE_PROTO_ARGS((int callLineNum)) \
{ \
int ulRefCount; \
if((ulRefCount = CBaseClass::Release(ADD_RELEASE_CALL_ARGS(callLineNum))) == 0) \
{ \
if (CBaseClass::AllowDeletes()) { \
delete this; \
} else { \
if (callLineNum > 0) OsSysLog::add(FAC_MP, PRI_DEBUG, __FILE__ " %p->Release(%d) [would delete this]", this, callLineNum); \
} \
} \
if (callLineNum > 0) OsSysLog::add(FAC_MP, PRI_DEBUG, __FILE__ " %p->Release(%d), count: %d", this, callLineNum, ulRefCount); \
return(ulRefCount); \
}
#endif /* ] */
|