Reformatting of class.h and class.cpp

This commit is contained in:
Walter Julius Hennecke 2012-12-31 21:19:39 +01:00
parent 2459be24a1
commit 862d4c102f
2 changed files with 449 additions and 507 deletions

View file

@ -113,8 +113,8 @@ class ClassDef
ClassDef(); ClassDef();
~ClassDef(); ~ClassDef();
ClassDef( const char *classname, const char *classID, const char *superclass, ClassDef( const char* classname, const char* classID, const char* superclass, ResponseDef<Class>* responses, void* ( *newInstance )( void ), int classSize );
ResponseDef<Class> *responses, void *( *newInstance )( void ), int classSize );
void BuildResponseList( void ); void BuildResponseList( void );
void Shutdown( void ); void Shutdown( void );
}; };
@ -126,7 +126,6 @@ class ClassDef
***********************************************************************/ ***********************************************************************/
class SafePtrBase; class SafePtrBase;
class Class; class Class;
class SafePtrBase class SafePtrBase
@ -194,6 +193,7 @@ class Class
Class(); Class();
virtual ~Class(); virtual ~Class();
void warning( const char* function, const char* fmt, ... ); void warning( const char* function, const char* fmt, ... );
void error( const char* function, const char* fmt, ... ); void error( const char* function, const char* fmt, ... );
qboolean inheritsFrom( ClassDef* c ) const; qboolean inheritsFrom( ClassDef* c ) const;
@ -224,20 +224,12 @@ void ClassEvents( const char *classname, qboolean dump = false );
void DumpAllClasses( int typeFlag = EVENT_ALL, int outputType = OUTPUT_ALL, const char* filename = NULL); void DumpAllClasses( int typeFlag = EVENT_ALL, int outputType = OUTPUT_ALL, const char* filename = NULL);
void DumpClass( FILE* class_file, const char* className, int typeFlag = 0); void DumpClass( FILE* class_file, const char* className, int typeFlag = 0);
inline qboolean Class::inheritsFrom inline qboolean Class::inheritsFrom(ClassDef* c) const
(
ClassDef *c
) const
{ {
return checkInheritance( c, classinfo() ); return checkInheritance( c, classinfo() );
} }
inline qboolean Class::isInheritedBy inline qboolean Class::isInheritedBy(ClassDef*c ) const
(
ClassDef *c
) const
{ {
return checkInheritance( classinfo(), c ); return checkInheritance( classinfo(), c );
} }
@ -256,11 +248,7 @@ inline qboolean Class::isInheritedBy
***********************************************************************/ ***********************************************************************/
inline void SafePtrBase::AddReference inline void SafePtrBase::AddReference(Class* ptr)
(
Class *ptr
)
{ {
if ( !ptr->SafePtrList ) if ( !ptr->SafePtrList )
{ {
@ -273,11 +261,7 @@ inline void SafePtrBase::AddReference
} }
} }
inline void SafePtrBase::RemoveReference inline void SafePtrBase::RemoveReference(Class* ptr)
(
Class *ptr
)
{ {
if ( ptr->SafePtrList == this ) if ( ptr->SafePtrList == this )
{ {
@ -297,11 +281,7 @@ inline void SafePtrBase::RemoveReference
} }
} }
inline void SafePtrBase::Clear inline void SafePtrBase::Clear(void)
(
void
)
{ {
if ( ptr ) if ( ptr )
{ {
@ -322,20 +302,12 @@ inline SafePtrBase::~SafePtrBase()
Clear(); Clear();
} }
inline Class * SafePtrBase::Pointer inline Class* SafePtrBase::Pointer(void)
(
void
)
{ {
return ptr; return ptr;
} }
inline void SafePtrBase::InitSafePtr inline void SafePtrBase::InitSafePtr(Class* newptr)
(
Class *newptr
)
{ {
if ( ptr != newptr ) if ( ptr != newptr )
{ {
@ -403,67 +375,37 @@ inline SafePtr<T>& SafePtr<T>::operator=( T * const obj )
} }
template<class T> template<class T>
inline int operator== inline int operator==(SafePtr<T> a, T* b)
(
SafePtr<T> a,
T* b
)
{ {
return a.ptr == b; return a.ptr == b;
} }
template<class T> template<class T>
inline int operator!= inline int operator!=(SafePtr<T> a, T* b)
(
SafePtr<T> a,
T* b
)
{ {
return a.ptr != b; return a.ptr != b;
} }
template<class T> template<class T>
inline int operator== inline int operator==(T* a, SafePtr<T> b)
(
T* a,
SafePtr<T> b
)
{ {
return a == b.ptr; return a == b.ptr;
} }
template<class T> template<class T>
inline int operator!= inline int operator!=(T* a, SafePtr<T> b)
(
T* a,
SafePtr<T> b
)
{ {
return a != b.ptr; return a != b.ptr;
} }
template<class T> template<class T>
inline int operator== inline int operator==(SafePtr<T> a, SafePtr<T> b)
(
SafePtr<T> a,
SafePtr<T> b
)
{ {
return a.ptr == b.ptr; return a.ptr == b.ptr;
} }
template<class T> template<class T>
inline int operator!= inline int operator!=(SafePtr<T> a,SafePtr<T> b)
(
SafePtr<T> a,
SafePtr<T> b
)
{ {
return a.ptr != b.ptr; return a.ptr != b.ptr;
} }