diff options
author | Matthias Huetsch <mhu@openoffice.org> | 2001-03-13 19:37:59 +0000 |
---|---|---|
committer | Matthias Huetsch <mhu@openoffice.org> | 2001-03-13 19:37:59 +0000 |
commit | 2744bacc5220c15f8148807afa739bf8a9186c60 (patch) | |
tree | 9a280eaa5a05ad772bb51f7d38deb9771a521278 /store/inc | |
parent | 12abacc97a24f3f72474f0d2fc21a60b9cc38459 (diff) |
Major revision. Removed usage of module 'vos'.
Diffstat (limited to 'store/inc')
-rw-r--r-- | store/inc/store/filelckb.hxx | 40 | ||||
-rw-r--r-- | store/inc/store/lockbyte.hxx | 29 | ||||
-rw-r--r-- | store/inc/store/memlckb.hxx | 42 | ||||
-rw-r--r-- | store/inc/store/object.hxx | 116 |
4 files changed, 145 insertions, 82 deletions
diff --git a/store/inc/store/filelckb.hxx b/store/inc/store/filelckb.hxx index a9ef520e9..26bcd3c97 100644 --- a/store/inc/store/filelckb.hxx +++ b/store/inc/store/filelckb.hxx @@ -2,9 +2,9 @@ * * $RCSfile: filelckb.hxx,v $ * - * $Revision: 1.1.1.1 $ + * $Revision: 1.2 $ * - * last change: $Author: hr $ $Date: 2000-09-18 15:18:31 $ + * last change: $Author: mhu $ $Date: 2001-03-13 20:37:59 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -54,13 +54,13 @@ * * All Rights Reserved. * - * Contributor(s): _______________________________________ + * Contributor(s): Matthias Huetsch <matthias.huetsch@sun.com> * * ************************************************************************/ #ifndef _STORE_FILELCKB_HXX_ -#define _STORE_FILELCKB_HXX_ "$Revision: 1.1.1.1 $" +#define _STORE_FILELCKB_HXX_ "$Revision: 1.2 $" #ifndef _SAL_TYPES_H_ #include <sal/types.h> @@ -73,9 +73,6 @@ #include <osl/mutex.hxx> #endif -#ifndef _STORE_MACROS_HXX_ -#include <store/macros.hxx> -#endif #ifndef _STORE_OBJECT_HXX_ #include <store/object.hxx> #endif @@ -83,9 +80,8 @@ #include <store/lockbyte.hxx> #endif -#ifdef _USE_NAMESPACE -namespace store { -#endif +namespace store +{ class OFileLockBytes_Impl; @@ -95,12 +91,12 @@ class OFileLockBytes_Impl; * *======================================================================*/ class OFileLockBytes : - public NAMESPACE_STORE(ILockBytes), - public NAMESPACE_STORE(OStoreObject) + public store::OStoreObject, + public store::ILockBytes { - VOS_DECLARE_CLASSINFO (VOS_NAMESPACE (OFileLockBytes, store)); - public: + /** Construction. + */ OFileLockBytes (void); /** create. @@ -177,18 +173,19 @@ public: /** Delegate multiple inherited IReference. */ - virtual RefCount SAL_CALL acquire (void); - virtual RefCount SAL_CALL release (void); - virtual RefCount SAL_CALL referenced (void) const; + virtual oslInterlockedCount SAL_CALL acquire (void); + virtual oslInterlockedCount SAL_CALL release (void); protected: + /** Destruction. + */ virtual ~OFileLockBytes (void); private: /** Representation. */ - NAMESPACE_OSL(Mutex) m_aMutex; - OFileLockBytes_Impl *m_pImpl; + osl::Mutex m_aMutex; + OFileLockBytes_Impl *m_pImpl; /** Not implemented. */ @@ -201,9 +198,8 @@ private: * The End. * *======================================================================*/ -#ifdef _USE_NAMESPACE -} -#endif + +} // namespace store #endif /* !_STORE_FILELCKB_HXX_ */ diff --git a/store/inc/store/lockbyte.hxx b/store/inc/store/lockbyte.hxx index dbab735ca..cf84bd03c 100644 --- a/store/inc/store/lockbyte.hxx +++ b/store/inc/store/lockbyte.hxx @@ -2,9 +2,9 @@ * * $RCSfile: lockbyte.hxx,v $ * - * $Revision: 1.1.1.1 $ + * $Revision: 1.2 $ * - * last change: $Author: hr $ $Date: 2000-09-18 15:18:31 $ + * last change: $Author: mhu $ $Date: 2001-03-13 20:37:59 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -54,39 +54,35 @@ * * All Rights Reserved. * - * Contributor(s): _______________________________________ + * Contributor(s): Matthias Huetsch <matthias.huetsch@sun.com> * * ************************************************************************/ #ifndef _STORE_LOCKBYTE_HXX_ -#define _STORE_LOCKBYTE_HXX_ "$Revision: 1.1.1.1 $" +#define _STORE_LOCKBYTE_HXX_ "$Revision: 1.2 $" #ifndef _SAL_TYPES_H_ #include <sal/types.h> #endif -#ifndef _VOS_REFERNCE_HXX_ -#include <vos/refernce.hxx> +#ifndef _RTL_REF_HXX_ +#include <rtl/ref.hxx> #endif #ifndef _STORE_TYPES_H_ #include <store/types.h> #endif -#ifndef _STORE_MACROS_HXX_ -#include <store/macros.hxx> -#endif -#ifdef _USE_NAMESPACE -namespace store { -#endif +namespace store +{ /*======================================================================== * * ILockBytes interface. * *======================================================================*/ -class ILockBytes : public NAMESPACE_VOS(IReference) +class ILockBytes : public rtl::IReference { public: /** @@ -153,6 +149,8 @@ public: sal_uInt32 nBytes) = 0; protected: + /** Destruction. + */ virtual ~ILockBytes (void) {} }; @@ -161,9 +159,8 @@ protected: * The End. * *======================================================================*/ -#ifdef _USE_NAMESPACE -} -#endif + +} // namespace store #endif /* !_STORE_LOCKBYTE_HXX_ */ diff --git a/store/inc/store/memlckb.hxx b/store/inc/store/memlckb.hxx index a78b946b6..573dd3356 100644 --- a/store/inc/store/memlckb.hxx +++ b/store/inc/store/memlckb.hxx @@ -2,9 +2,9 @@ * * $RCSfile: memlckb.hxx,v $ * - * $Revision: 1.1.1.1 $ + * $Revision: 1.2 $ * - * last change: $Author: hr $ $Date: 2000-09-18 15:18:31 $ + * last change: $Author: mhu $ $Date: 2001-03-13 20:37:59 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -54,25 +54,22 @@ * * All Rights Reserved. * - * Contributor(s): _______________________________________ + * Contributor(s): Matthias Huetsch <matthias.huetsch@sun.com> * * ************************************************************************/ #ifndef _STORE_MEMLCKB_HXX_ -#define _STORE_MEMLCKB_HXX_ "$Revision: 1.1.1.1 $" +#define _STORE_MEMLCKB_HXX_ "$Revision: 1.2 $" #ifndef _SAL_TYPES_H_ #include <sal/types.h> #endif -#ifndef _VOS_MUTEX_HXX_ -#include <vos/mutex.hxx> +#ifndef _OSL_MUTEX_HXX_ +#include <osl/mutex.hxx> #endif -#ifndef _STORE_MACROS_HXX_ -#include <store/macros.hxx> -#endif #ifndef _STORE_OBJECT_HXX_ #include <store/object.hxx> #endif @@ -80,9 +77,8 @@ #include <store/lockbyte.hxx> #endif -#ifdef _USE_NAMESPACE -namespace store { -#endif +namespace store +{ class OMemoryLockBytes_Impl; @@ -92,12 +88,12 @@ class OMemoryLockBytes_Impl; * *======================================================================*/ class OMemoryLockBytes : - public NAMESPACE_STORE(ILockBytes), - public NAMESPACE_STORE(OStoreObject) + public store::OStoreObject, + public store::ILockBytes { - VOS_DECLARE_CLASSINFO (VOS_NAMESPACE (OMemoryLockBytes, store)); - public: + /** Construction. + */ OMemoryLockBytes (void); /** Read at Offset into Buffer. @@ -165,17 +161,18 @@ public: /** Delegate multiple inherited IReference. */ - virtual RefCount SAL_CALL acquire (void); - virtual RefCount SAL_CALL release (void); - virtual RefCount SAL_CALL referenced (void) const; + virtual oslInterlockedCount SAL_CALL acquire (void); + virtual oslInterlockedCount SAL_CALL release (void); protected: + /** Destruction. + */ virtual ~OMemoryLockBytes (void); private: /** Representation. */ - NAMESPACE_VOS(OMutex) m_aMutex; + osl::Mutex m_aMutex; OMemoryLockBytes_Impl *m_pImpl; /** Not implemented. @@ -189,9 +186,8 @@ private: * The End. * *======================================================================*/ -#ifdef _USE_NAMESPACE -} -#endif + +} // namespace store #endif /* !_STORE_MEMLCKB_HXX_ */ diff --git a/store/inc/store/object.hxx b/store/inc/store/object.hxx index c5caa83da..9a52f3e0f 100644 --- a/store/inc/store/object.hxx +++ b/store/inc/store/object.hxx @@ -2,9 +2,9 @@ * * $RCSfile: object.hxx,v $ * - * $Revision: 1.1.1.1 $ + * $Revision: 1.2 $ * - * last change: $Author: hr $ $Date: 2000-09-18 15:18:31 $ + * last change: $Author: mhu $ $Date: 2001-03-13 20:37:59 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -54,65 +54,139 @@ * * All Rights Reserved. * - * Contributor(s): _______________________________________ + * Contributor(s): Matthias Huetsch <matthias.huetsch@sun.com> * * ************************************************************************/ #ifndef _STORE_OBJECT_HXX_ -#define _STORE_OBJECT_HXX_ "$Revision: 1.1.1.1 $" +#define _STORE_OBJECT_HXX_ "$Revision: 1.2 $" #ifndef _SAL_TYPES_H_ #include <sal/types.h> #endif -#ifndef _VOS_OBJECT_HXX_ -#include <vos/object.hxx> -#endif -#ifndef _VOS_REFERNCE_HXX_ -#include <vos/refernce.hxx> +#ifndef _RTL_REF_HXX_ +#include <rtl/ref.hxx> #endif -#ifndef _STORE_MACROS_HXX_ -#include <store/macros.hxx> +#ifndef _OSL_INTERLCK_H_ +#include <osl/interlck.h> #endif -#ifdef _USE_NAMESPACE -namespace store { -#endif +namespace store +{ + +/*======================================================================== + * + * IStoreHandle interface. + * + *======================================================================*/ +class IStoreHandle : public rtl::IReference +{ +public: + /** Replaces dynamic_cast type checking. + */ + virtual sal_Bool SAL_CALL isKindOf (sal_uInt32 nTypeId) = 0; +}; + + +/** Template helper function as dynamic_cast replacement. + */ +template<class store_handle_type> +store_handle_type * SAL_CALL query ( + IStoreHandle * pHandle, store_handle_type *); + + +/** Template helper class as type safe Reference to store_handle_type. + */ +template<class store_handle_type> +class OStoreHandle : public rtl::Reference<store_handle_type> +{ +public: + OStoreHandle (store_handle_type * pHandle) + : rtl::Reference<store_handle_type> (pHandle) + {} + + static store_handle_type * SAL_CALL query (void * pHandle) + { + return store::query ( + static_cast<IStoreHandle*>(pHandle), + static_cast<store_handle_type*>(0)); + } +}; /*======================================================================== * * OStoreObject interface. * *======================================================================*/ -class OStoreObject : - public NAMESPACE_VOS(OReference), - public NAMESPACE_VOS(OObject) +class OStoreObject : public store::IStoreHandle { - VOS_DECLARE_CLASSINFO (VOS_NAMESPACE (OStoreObject, store)); + /** Template function specialization as dynamic_cast replacement. + */ + friend inline OStoreObject* + SAL_CALL query (IStoreHandle *pHandle, OStoreObject*); public: + /** Construction. + */ OStoreObject (void); + /** Allocation. + */ + static void* operator new (size_t n); + static void operator delete (void *p); + + /** IStoreHandle. + */ + virtual sal_Bool SAL_CALL isKindOf (sal_uInt32 nTypeId); + + /** IReference. + */ + virtual oslInterlockedCount SAL_CALL acquire (void); + virtual oslInterlockedCount SAL_CALL release (void); + protected: + /** Destruction. + */ virtual ~OStoreObject (void); private: + /** The IStoreHandle TypeId. + */ + static const sal_uInt32 m_nTypeId; + + /** Representation. + */ + oslInterlockedCount m_nRefCount; + /** Not implemented. */ OStoreObject (const OStoreObject&); OStoreObject& operator= (const OStoreObject&); }; +/** Template function specialization as dynamic_cast replacement. + */ +inline OStoreObject* +SAL_CALL query (IStoreHandle *pHandle, OStoreObject*) +{ + if (pHandle && pHandle->isKindOf (OStoreObject::m_nTypeId)) + { + // Handle is kind of OStoreObject. + return static_cast<OStoreObject*>(pHandle); + } + return 0; +} + /*======================================================================== * * The End. * *======================================================================*/ -#ifdef _USE_NAMESPACE -} -#endif + +} // namespace store #endif /* !_STORE_OBJECT_HXX_ */ |