[prev in list] [next in list] [prev in thread] [next in thread]
List: helix-server-cvs
Subject: [Server-cvs]
From: dcollins () helixcommunity ! org
Date: 2010-09-20 21:04:34
Message-ID: 201009202104.o8KL48W5020131 () mailer ! progressive-comp ! com
[Download RAW message or body]
Update of /cvsroot/server/engine/registry/pub
In directory cvs01.internal.helixcommunity.org:/tmp/cvs-serv26940/server/engine/registry/pub
Modified Files:
regprop.h servreg.h
Log Message:
Synopsis
========
Implements Helix Server registry updates related to 64-bit Large File Support
Branches: SERVER_CURRENT_RN (HEAD)
Reviewers: Chytanya, server-dev
Description
===========
This implements INT64 support in the Helix Server registry. 64-bit
integers would be available in the registry on both 64-bit and 32-bit
platforms.
The COM APIs were extended a number of years ago in anticipation of
adding 64-bit integer support to the registry, so this check-in provides
the underlying implementation. A small amount of refactoring of the
registry was necessary to accomplish this.
The constants INT64_MIN, INT64_MAX and UINT64_MAX are added to
common/include/hxmon.h (if not already defined) to support the
BoundedModifyInt64ByName() and BoundedModifyInt64ById() calls.
This does not change anywhere to use the new 64-bit registry
functionality. Most registry usage will continue to use 32-bit integers
since they are often more than sufficient. Data items will be migrated
to use the new 64-bit registry values as a seperate check-in.
This does not extend the IHXActiveRegistry-related interfaces to allow
for 64-bit integers. This will be added as a seperate check-in.
These changes are implented so that the impact on non-64-bit builds,
and non-server builds, should be minimal, ideally transparent.
Files Affected
==============
common/include/hxmon.h
common/runtime/pub/hlxclib/limits.h
server/engine/context/hxreg.cpp
server/engine/context/pub/hxreg.h
server/engine/registry/servreg.cpp
server/engine/registry/pub/regprop.h
server/engine/registry/pub/servreg.h
Testing Performed
=================
Unit Tests:
- N/A
Integration Tests:
- N/A (not tested yet, will test when the first items are migrated to use 64-bits)
Leak Tests:
- N/A
Performance Tests:
- N/A
Platforms Tested: N/A
Build verified: linux-rhel5-x86_64, sunos-5.10-sparc64, win-x86_64-vc10
QA Hints
========
* N/A
Index: servreg.h
===================================================================
RCS file: /cvsroot/server/engine/registry/pub/servreg.h,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- servreg.h 30 May 2009 19:11:00 -0000 1.4
+++ servreg.h 20 Sep 2010 21:04:31 -0000 1.5
@@ -38,8 +38,6 @@
#ifndef _SERV_REG_H_
#define _SERV_REG_H_
-#include <limits.h>
-
#include "hxtypes.h"
#include "hxcom.h"
@@ -197,12 +195,24 @@
Process* proc,
INT32 nMin=INT_MIN,
INT32 nMax=INT_MAX);
- HX_RESULT BoundedModifyInt(const UINT32 id,
+ HX_RESULT BoundedModifyInt(const UINT32 ulId,
INT32 nDelta,
INT32* pValue,
Process* proc,
INT32 nMin=INT_MIN,
INT32 nMax=INT_MAX);
+ HX_RESULT BoundedModifyInt64(const char* szName,
+ INT64 nDelta,
+ INT64* pValue,
+ Process* proc,
+ INT64 nMin=INT64_MIN,
+ INT64 nMax=INT64_MAX);
+ HX_RESULT BoundedModifyInt64(const UINT32 ulId,
+ INT64 nDelta,
+ INT64* pValue,
+ Process* proc,
+ INT64 nMin=INT64_MIN,
+ INT64 nMax=INT64_MAX);
HX_RESULT SetAndReturnInt(const char* szName,
INT32 nValue,
INT32* pOldValue,
@@ -217,7 +227,7 @@
HX_RESULT GetIntRef (const UINT32 ulId,
INT32** ppValue,
Process* pProc);
- UINT32 AddInt64 (const char* szName,
+ UINT32 AddInt64 (const char* szPropName,
const INT64 nValue,
Process* proc);
HX_RESULT GetInt64 (const char* szName,
@@ -250,13 +260,13 @@
INT64 nValue,
INT64* pOldValue,
Process* proc);
- UINT32 AddInt64Ref (const char* szName,
+ UINT32 AddInt64Ref (const char* szPropName,
INT64* pValue,
Process* proc);
HX_RESULT GetInt64Ref (const char* szName,
INT64** ppValue,
Process* proc);
- HX_RESULT GetInt64Ref (const UINT32 id,
+ HX_RESULT GetInt64Ref (const UINT32 ulId,
INT64** ppValue,
Process* proc);
@@ -268,11 +278,13 @@
*/
UINT32 AddComp(const char* szPropName);
- UINT32 AddInt(const char* szPropName, const INT32 iValue);
+ UINT32 AddInt(const char* szPropName, HXPropType type, const INT64 nValue);
HX_RESULT GetInt(const char* szPropName, INT32* pValue);
HX_RESULT GetInt(const UINT32 ulId, INT32* pValue);
HX_RESULT SetInt(const char* szPropName, const INT32 iValue);
HX_RESULT SetInt(const UINT32 ulId, const INT32 iValue);
+ HX_RESULT BoundedModifyInt(const UINT32 ulId, INT32 nDelta, INT32* \
pValue, INT32 nMin, INT32 nMax); + HX_RESULT BoundedModifyInt64(const \
UINT32 ulId, INT64 nDelta, INT64* pValue, INT64 nMin, INT64 nMax);
UINT32 AddStr(const char* szPropName, IHXBuffer* pValue);
HX_RESULT SetStr(const char* szPropName, IHXBuffer* pValue);
@@ -287,10 +299,17 @@
HX_RESULT GetBuf(const char* szPropName, IHXBuffer** ppBuffer);
HX_RESULT GetBuf(const UINT32 ulId, IHXBuffer** ppBuffer);
- UINT32 AddIntRef(const char* szPropName, INT32* pValue);
+ UINT32 AddIntRef(const char* szPropName, const HXPropType type, void* pValue);
HX_RESULT GetIntRef(const char* szPropName, INT32** ppValue);
HX_RESULT GetIntRef(const UINT32 ulId, INT32** ppValue);
+ HX_RESULT GetInt64(const char* szPropName, INT64* pValue);
+ HX_RESULT GetInt64(const UINT32 ulId, INT64* pValue);
+ HX_RESULT SetInt64(const char* szPropName, const INT64 nValue);
+ HX_RESULT SetInt64(const UINT32 ulId, const INT64 nValue);
+ HX_RESULT GetInt64Ref(const char* szPropName, INT64** ppValue);
+ HX_RESULT GetInt64Ref(const UINT32 ulId, INT64** ppValue);
+
HX_RESULT SetReadOnly(const char* szPropName, BOOL bValue);
HX_RESULT SetReadOnly(UINT32 ulId, BOOL bValue);
@@ -527,7 +546,8 @@
ServRegDB_node* _addInt(ServRegKey* pKey,
char* szPropName,
- INT32 iValue,
+ HXPropType type,
+ INT64 nValue,
ServRegDB_dict* pOwnerDB);
ServRegDB_node* _addBuf(ServRegKey* pKey,
@@ -537,7 +557,9 @@
HXPropType type = PT_BUFFER);
ServRegDB_node* _addIntRef(ServRegKey* pKey,
- char* szPropName, INT32* pValue,
+ char* szPropName,
+ HXPropType type,
+ void* pValue,
ServRegDB_dict* pOwnerDB);
HX_RESULT _find(ServRegDB_node** ppNode, ServRegProperty** ppProp, const char* \
szPropName);
Index: regprop.h
===================================================================
RCS file: /cvsroot/server/engine/registry/pub/regprop.h,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- regprop.h 30 May 2009 19:11:00 -0000 1.4
+++ regprop.h 20 Sep 2010 21:04:31 -0000 1.5
@@ -74,7 +74,9 @@
HX_RESULT buf_val(IHXBuffer* v, HXPropType t = PT_BUFFER);
HX_RESULT int_val(const INT32 v);
+ HX_RESULT int64_val(const INT64 v);
HX_RESULT int_ref_val(INT32* v);
+ HX_RESULT int64_ref_val(INT64* v);
HX_RESULT db_val(ServRegDB_dict* v);
// accessor methods
@@ -93,6 +95,12 @@
INT32 get_int_ref_val() const;
HX_RESULT get_int_ref(INT32** v) const;
INT32* get_int_ref() const;
+ HX_RESULT get_int64_val(INT64* v) const;
+ INT64 get_int64_val() const;
+ HX_RESULT get_int64_ref_val(INT64* v) const;
+ INT64 get_int64_ref_val() const;
+ HX_RESULT get_int64_ref(INT64** v) const;
+ INT64* get_int64_ref() const;
HX_RESULT get_db_val(ServRegDB_dict** v) const;
const ServRegDB_dict* get_db_val() const;
@@ -124,9 +132,11 @@
BOOL _read_only;
union VALUE
{
- IHXBuffer* t_buf;
+ IHXBuffer* t_buf;
INT32 t_int;
INT32* t_iref;
+ INT64 t_int64;
+ INT64* t_i64ref;
ServRegDB_dict* t_imp;
} _prop_val;
};
@@ -251,6 +261,25 @@
}
inline HX_RESULT
+ServRegProperty::int64_val(const INT64 v)
+{
+ if (_read_only)
+ {
+ return HXR_FAIL;
+ }
+ else if (_prop_type != PT_INTEGER64)
+ {
+ _prop_val.t_int64 = 0;
+ return HXR_FAIL;
+ }
+ else
+ {
+ _prop_val.t_int64 = v;
+ return HXR_OK;
+ }
+}
+
+inline HX_RESULT
ServRegProperty::int_ref_val(INT32* v)
{
if (_read_only)
@@ -270,6 +299,25 @@
}
inline HX_RESULT
+ServRegProperty::int64_ref_val(INT64* v)
+{
+ if (_read_only)
+ {
+ return HXR_FAIL;
+ }
+ else if (_prop_type != PT_INT64REF)
+ {
+ _prop_val.t_i64ref = 0;
+ return HXR_FAIL;
+ }
+ else
+ {
+ _prop_val.t_i64ref = v;
+ return HXR_OK;
+ }
+}
+
+inline HX_RESULT
ServRegProperty::buf_val(IHXBuffer* v, HXPropType t)
{
HX_RESULT theErr = HXR_OK;
@@ -375,6 +423,21 @@
}
inline HX_RESULT
+ServRegProperty::get_int64_val(INT64* v) const
+{
+ if (_prop_type != PT_INTEGER64)
+ {
+ *v = 0;
+ return HXR_FAIL;
+ }
+ else
+ {
+ *v = _prop_val.t_int64;
+ return HXR_OK;
+ }
+}
+
+inline HX_RESULT
ServRegProperty::get_int_ref_val(INT32* v) const
{
if (_prop_type != PT_INTREF)
@@ -390,6 +453,21 @@
}
inline HX_RESULT
+ServRegProperty::get_int64_ref_val(INT64* v) const
+{
+ if (_prop_type != PT_INT64REF)
+ {
+ *v = 0;
+ return HXR_FAIL;
+ }
+ else
+ {
+ *v = *_prop_val.t_i64ref;
+ return HXR_OK;
+ }
+}
+
+inline HX_RESULT
ServRegProperty::get_int_ref(INT32** v) const
{
if (_prop_type != PT_INTREF)
@@ -405,6 +483,21 @@
}
inline HX_RESULT
+ServRegProperty::get_int64_ref(INT64** v) const
+{
+ if (_prop_type != PT_INT64REF)
+ {
+ *v = 0;
+ return HXR_FAIL;
+ }
+ else
+ {
+ *v = _prop_val.t_i64ref;
+ return HXR_OK;
+ }
+}
+
+inline HX_RESULT
ServRegProperty::get_db_val(ServRegDB_dict** v) const
{
if (_prop_type != PT_COMPOSITE)
@@ -428,6 +521,15 @@
return _prop_val.t_int;
}
+inline INT64
+ServRegProperty::get_int64_val() const
+{
+ if (_prop_type != PT_INTEGER64)
+ return 0;
+ else
+ return _prop_val.t_int64;
+}
+
inline const IHXBuffer*
ServRegProperty::get_buf_val(HXPropType t) const
{
@@ -452,6 +554,17 @@
}
}
+inline INT64*
+ServRegProperty::get_int64_ref() const
+{
+ if (_prop_type != PT_INT64REF)
+ return 0;
+ else
+ {
+ return _prop_val.t_i64ref;
+ }
+}
+
inline const ServRegDB_dict*
ServRegProperty::get_db_val() const
{
_______________________________________________
Server-cvs mailing list
Server-cvs@helixcommunity.org
http://lists.helixcommunity.org/mailman/listinfo/server-cvs
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic