Kaydet (Commit) 21f33403 authored tarafından Ivo Hinkelmann's avatar Ivo Hinkelmann

INTEGRATION: CWS configrefactor01 (1.14.42); FILE MERGED

2007/01/12 14:50:47 mmeeks 1.14.42.4: Another big prune of memory::Accessor ...
2007/01/11 20:16:06 mmeeks 1.14.42.3: Submitted by: mmeeks
More re-factoring, lots of locking rationalized, drastically reduced
the mutex count, also removed ~300k interlocked increments with a non-interlocking
SimpleReferencedObject base
2007/01/11 10:35:39 mmeeks 1.14.42.2: Submitted by: mmeeks

Large scale re-factoring, remove fine-grained locking in favor of a simple,
single global lock (still in progress).
Identify and fix various hot-spots.
Remove otherwise empty / non-compiled files.
Kill UpdateAccessor
2007/01/08 20:49:04 mmeeks 1.14.42.1: Issue number:
Submitted by: mmeeks
Substantial configmgr re-factoring #1 ...
	+ remove endless typedef chains
	+ remove custom allocator & associated complexity
	+ remove Pointer, and 'Address' classes
üst 8ae7edcd
...@@ -4,9 +4,9 @@ ...@@ -4,9 +4,9 @@
* *
* $RCSfile: nodeimplobj.hxx,v $ * $RCSfile: nodeimplobj.hxx,v $
* *
* $Revision: 1.14 $ * $Revision: 1.15 $
* *
* last change: $Author: hr $ $Date: 2006-06-19 23:33:36 $ * last change: $Author: ihi $ $Date: 2007-11-23 14:45:12 $
* *
* The Contents of this file are made available subject to * The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1. * the terms of GNU Lesser General Public License Version 2.1.
...@@ -36,6 +36,9 @@ ...@@ -36,6 +36,9 @@
#ifndef CONFIGMGR_NODEIMPLOBJECTS_HXX_ #ifndef CONFIGMGR_NODEIMPLOBJECTS_HXX_
#define CONFIGMGR_NODEIMPLOBJECTS_HXX_ #define CONFIGMGR_NODEIMPLOBJECTS_HXX_
#ifndef INCLUDED_SHARABLE_NODE_HXX
#include "node.hxx"
#endif
#ifndef CONFIGMGR_CONFIGNODEBEHAVIOR_HXX_ #ifndef CONFIGMGR_CONFIGNODEBEHAVIOR_HXX_
#include "nodeimpl.hxx" #include "nodeimpl.hxx"
#endif #endif
...@@ -48,12 +51,9 @@ ...@@ -48,12 +51,9 @@
#ifndef CONFIGMGR_VALUENODEBEHAVIOR_HXX_ #ifndef CONFIGMGR_VALUENODEBEHAVIOR_HXX_
#include "valuenodeimpl.hxx" #include "valuenodeimpl.hxx"
#endif #endif
#ifndef CONFIGMGR_NODEADDRESS_HXX
#include "nodeaddress.hxx"
#endif
#ifndef _SALHELPER_SIMPLEREFERENCEOBJECT_HXX_ #ifndef CONFIGMGR_UTILITY_HXX_
#include <salhelper/simplereferenceobject.hxx> #include "utility.hxx"
#endif #endif
#ifndef INCLUDED_MEMORY #ifndef INCLUDED_MEMORY
...@@ -73,7 +73,7 @@ namespace configmgr ...@@ -73,7 +73,7 @@ namespace configmgr
// Value Nodes // Value Nodes
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
class ValueMemberNode::DeferredImpl : public salhelper::SimpleReferenceObject class ValueMemberNode::DeferredImpl : public configmgr::SimpleReferenceObject
{ {
data::ValueNodeAddress m_aValueRef; data::ValueNodeAddress m_aValueRef;
...@@ -81,18 +81,18 @@ namespace configmgr ...@@ -81,18 +81,18 @@ namespace configmgr
bool m_bToDefault; bool m_bToDefault;
bool m_bChange; bool m_bChange;
public: public:
explicit DeferredImpl(data::ValueNodeAccess const& _aValueNode) ; explicit DeferredImpl(data::ValueNodeAccess const& _aValueNode);
/// does this wrap a change /// does this wrap a change
bool isChange() const { return m_bChange; } bool isChange() const { return m_bChange; }
/// retrieve the underlying (original) node location /// retrieve the underlying (original) node location
data::ValueNodeAddress getOriginalNodeAddress() const data::ValueNodeAddress getOriginalNodeAddress() const
{ return m_aValueRef; } { return m_aValueRef; }
/// retrieve the underlying (original) node /// retrieve the underlying (original) node
data::ValueNodeAccess getOriginalNode(data::Accessor const& _aAccessor) const data::ValueNodeAccess getOriginalNode() const
{ return data::ValueNodeAccess(_aAccessor,m_aValueRef); } { return data::ValueNodeAccess(m_aValueRef); }
/// Does this node change to default /// Does this node change to default
bool isToDefault() const { return m_bToDefault; } bool isToDefault() const { return m_bToDefault; }
...@@ -108,14 +108,12 @@ namespace configmgr ...@@ -108,14 +108,12 @@ namespace configmgr
public: public:
// commit protocol // commit protocol
std::auto_ptr<ValueChange> preCommitChange(data::Accessor const& _aAccessor); std::auto_ptr<ValueChange> preCommitChange();
void finishCommit(ValueChange& rChange, data::Accessor const& _aAccessor); void finishCommit(ValueChange& rChange);
void revertCommit(ValueChange& rChange, data::Accessor const& _aAccessor); void revertCommit(ValueChange& rChange);
void failedCommit(ValueChange& rChange, data::Accessor const& _aAccessor); void failedCommit(ValueChange& rChange);
// void commitDirect(data::Accessor const& _aAccessor);
ValueChangeImpl* collectChange(data::Accessor const& _aAccessor); ValueChangeImpl* collectChange();
ValueChangeImpl* adjustToChange(ValueChange const& rExternalChange); ValueChangeImpl* adjustToChange(ValueChange const& rExternalChange);
// notification protocol // notification protocol
...@@ -141,12 +139,12 @@ namespace configmgr ...@@ -141,12 +139,12 @@ namespace configmgr
public: public:
// commit protocol // commit protocol
std::auto_ptr<SubtreeChange> preCommitValueChanges(data::Accessor const& _aAccessor); std::auto_ptr<SubtreeChange> preCommitValueChanges();
void finishCommit(data::Accessor const& _aAccessor, SubtreeChange& rChange); void finishCommit(SubtreeChange& rChange);
void revertCommit(data::Accessor const& _aAccessor, SubtreeChange& rChange); void revertCommit(SubtreeChange& rChange);
void failedCommit(data::Accessor const& _aAccessor, SubtreeChange& rChange); void failedCommit(SubtreeChange& rChange);
void collectValueChanges(data::Accessor const& _aAccessor, NodeChanges& rChanges, TreeImpl* pParent, NodeOffset nNode) const; void collectValueChanges(NodeChanges& rChanges, TreeImpl* pParent, NodeOffset nNode) const;
public: public:
// data access // data access
...@@ -157,7 +155,7 @@ namespace configmgr ...@@ -157,7 +155,7 @@ namespace configmgr
MemberChange findValueChange(Name const& aName); MemberChange findValueChange(Name const& aName);
using GroupNodeImpl::makeValueMember; using GroupNodeImpl::makeValueMember;
ValueMemberNode makeValueMember(data::Accessor const& _aAccessor, Name const& _aName, bool _bForUpdate); ValueMemberNode makeValueMember(Name const& _aName, bool _bForUpdate);
private: private:
typedef std::map< Name, MemberChange > MemberChanges; typedef std::map< Name, MemberChange > MemberChanges;
...@@ -178,13 +176,13 @@ namespace configmgr ...@@ -178,13 +176,13 @@ namespace configmgr
public: public:
bool hasChanges() const; bool hasChanges() const;
void markChanged(); void markChanged();
void collectElementChanges(data::Accessor const& _aAccessor, NodeChanges& rChanges) const; void collectElementChanges(NodeChanges& rChanges) const;
public: public:
std::auto_ptr<SubtreeChange> preCommitChanges(data::Accessor const& _aAccessor, ElementList& _rRemovedElements); std::auto_ptr<SubtreeChange> preCommitChanges(ElementList& _rRemovedElements);
void failedCommit(data::Accessor const& _aAccessor, SubtreeChange& rChanges); void failedCommit(SubtreeChange& rChanges);
void finishCommit(data::Accessor const& _aAccessor, SubtreeChange& rChanges); void finishCommit(SubtreeChange& rChanges);
void revertCommit(data::Accessor const& _aAccessor, SubtreeChange& rChanges); void revertCommit(SubtreeChange& rChanges);
void insertNewElement(Name const& aName, Element const& aNewElement); void insertNewElement(Name const& aName, Element const& aNewElement);
void removeOldElement(Name const& aName); void removeOldElement(Name const& aName);
...@@ -193,20 +191,20 @@ namespace configmgr ...@@ -193,20 +191,20 @@ namespace configmgr
// NodeImpl implementation // NodeImpl implementation
virtual bool doIsEmpty() const; virtual bool doIsEmpty() const;
virtual ElementTreeImpl* doFindElement(Name const& aName) ; virtual ElementTreeImpl* doFindElement(Name const& aName) ;
virtual SetNodeVisitor::Result doDispatchToElements(data::Accessor const& _aAccessor, SetNodeVisitor& aVisitor); virtual SetNodeVisitor::Result doDispatchToElements(SetNodeVisitor& aVisitor);
virtual void doDifferenceToDefaultState(data::Accessor const& _aAccessor, SubtreeChange& _rChangeToDefault, ISubtree& _rDefaultTree); virtual void doDifferenceToDefaultState(SubtreeChange& _rChangeToDefault, ISubtree& _rDefaultTree);
virtual SetElementChangeImpl* doAdjustToAddedElement(data::Accessor const& _aAccessor, Name const& aName, AddNode const& aAddNodeChange, Element const & aNewElement); virtual SetElementChangeImpl* doAdjustToAddedElement(Name const& aName, AddNode const& aAddNodeChange, Element const & aNewElement);
virtual SetElementChangeImpl* doAdjustToRemovedElement(data::Accessor const& _aAccessor, Name const& aName, RemoveNode const& aRemoveNodeChange); virtual SetElementChangeImpl* doAdjustToRemovedElement(Name const& aName, RemoveNode const& aRemoveNodeChange);
virtual SetElementChangeImpl* doAdjustChangedElement(data::Accessor const& _aAccessor, NodeChangesInformation& rLocalChanges, Name const& aName, Change const& aChange); virtual SetElementChangeImpl* doAdjustChangedElement(NodeChangesInformation& rLocalChanges, Name const& aName, Change const& aChange);
virtual void doTransferElements(ElementSet& rReplacement); virtual void doTransferElements(ElementSet& rReplacement);
// Implementation // Implementation
private: private:
void rebuildElement(data::Accessor const& _aAccessor, Name const& aName, Element const& _aElement); void rebuildElement(Name const& aName, Element const& _aElement);
private: private:
ElementSet m_aChangedData; ElementSet m_aChangedData;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment