home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Chip 1997 October
/
Chip_1997-10_cd.bin
/
tema
/
sybase
/
powerj
/
hpp.z
/
WOBJECT.HPP
< prev
next >
Wrap
C/C++ Source or Header
|
1996-10-18
|
4KB
|
132 lines
/* %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Copyright (C) 1994, by WATCOM International Inc. All rights %
% reserved. No part of this software may be reproduced or %
% used in any form or by any means - graphic, electronic or %
% mechanical, including photocopying, recording, taping or %
% information storage and retrieval systems - except with the %
% written permission of WATCOM International Inc. %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
*/
/*************************************************************************
*
* WObject -- Base WClass object
*
*************************************************************************/
#ifndef _WOBJECT_HPP_INCLUDED
#define _WOBJECT_HPP_INCLUDED
#ifndef _WNO_PRAGMA_PUSH
#pragma pack(push,8);
#pragma enum int;
#endif
#ifndef _WDEF_HPP_INCLUDED
# include "wdef.hpp"
#endif
#if defined( _DEBUG ) && defined( new )
# define _REINCLUDE_WNEW
# undef new
# undef delete
#endif
// Random signature values
#define WOBJECT_VALID_FLAG 3235818270
#define WOBJECT_DELETED_FLAG 3735928559
class WCMCLASS WObject {
WDeclareRoot( WObject );
public:
/**********************************************************
* Constructors and Destructors
*********************************************************/
WObject();
virtual ~WObject();
/**********************************************************
* Properties
*********************************************************/
// VerificationFlag
WULong GetVerificationFlag();
/**********************************************************
* Others
*********************************************************/
// GetInterface
//
// If the object supports an interface, return it. The
// caller must cast the return value to the correct type.
virtual void *GetInterface( const WChar *iface ) const;
/**********************************************************
* Operators
*********************************************************/
int operator==( const WObject & obj ) const
{ return( CompareToSelf( obj ) == 0 ); }
int operator!=( const WObject & obj ) const
{ return( CompareToSelf( obj ) != 0 ); }
int operator<=( const WObject & obj ) const
{ return( CompareToSelf( obj ) <= 0 ); }
int operator<( const WObject & obj ) const
{ return( CompareToSelf( obj ) < 0 ); }
int operator>=( const WObject & obj ) const
{ return( CompareToSelf( obj ) >= 0 ); }
int operator>( const WObject & obj ) const
{ return( CompareToSelf( obj ) > 0 ); }
int CompareToSelf( const WObject & obj ) const;
//
// Memory allocation/deallocation. This ensures that all
// new/delete calls are performed in the correct free list.
//
void *operator new( size_t s );
void *operator new( size_t s, const WChar *funcName,
const WChar *fileName, WULong line );
void *operator new( size_t, void * );
void *operator new []( size_t );
void *operator new []( size_t, const WChar *funcName,
const WChar *fileName, WULong line );
void *operator new []( size_t, void * );
void operator delete( void *p );
void operator delete []( void *p );
/**********************************************************
* Data members
*********************************************************/
private:
WULong _verificationFlag;
};
// Re-include to redefine new & delete
#ifdef _REINCLUDE_WNEW
# include "wnew.hpp"
# undef _REINCLUDE_WNEW
#endif
#ifndef _WNO_PRAGMA_PUSH
#pragma enum pop;
#pragma pack(pop);
#endif
#endif // _WOBJECT_HPP_INCLUDED