Kaydet (Commit) 612a60ce authored tarafından Jörg Barfurth's avatar Jörg Barfurth

#91896# Complete transition to sharable data structures; remove non-sharable versions of algorithms

üst 0dcc1df0
...@@ -2,9 +2,9 @@ ...@@ -2,9 +2,9 @@
* *
* $RCSfile: groupnodeaccess.hxx,v $ * $RCSfile: groupnodeaccess.hxx,v $
* *
* $Revision: 1.1 $ * $Revision: 1.2 $
* *
* last change: $Author: jb $ $Date: 2002-02-11 14:29:07 $ * last change: $Author: jb $ $Date: 2002-03-28 08:47:03 $
* *
* The Contents of this file are made available subject to the terms of * The Contents of this file are made available subject to the terms of
* either of the following licenses * either of the following licenses
...@@ -139,20 +139,6 @@ namespace configmgr ...@@ -139,20 +139,6 @@ namespace configmgr
GroupNodeAddress toGroupNodeAddress(memory::Accessor const & _aAccess, NodeAddress const & _aNodeAddr); GroupNodeAddress toGroupNodeAddress(memory::Accessor const & _aAccess, NodeAddress const & _aNodeAddr);
GroupNodeAddress toGroupNodeAddress(memory::UpdateAccessor & _aAccess, NodeAddress const & _aNodeAddr); GroupNodeAddress toGroupNodeAddress(memory::UpdateAccessor & _aAccess, NodeAddress const & _aNodeAddr);
// ------------------------------------------------------------------------- // -------------------------------------------------------------------------
#ifdef NON_SHARABLE_DATA
inline
NodeAccess::Name GroupNodeAccess::getName() const
{ return NodeAccess::wrapName( data().getName() ); }
inline
NodeAccess::Attributes GroupNodeAccess::getAttributes() const
{ return data().getAttributes(); }
inline
bool GroupNodeAccess::isDefault() const
{ return data().isDefault(); }
#else // SHARABLE_DATA
inline inline
NodeAccess::Name GroupNodeAccess::getName() const NodeAccess::Name GroupNodeAccess::getName() const
{ return NodeAccess::wrapName( data().info.getName(m_aAccessor) ); } { return NodeAccess::wrapName( data().info.getName(m_aAccessor) ); }
...@@ -165,8 +151,6 @@ namespace configmgr ...@@ -165,8 +151,6 @@ namespace configmgr
bool GroupNodeAccess::isDefault() const bool GroupNodeAccess::isDefault() const
{ return data().info.isDefault(); } { return data().info.isDefault(); }
#endif // SHARABLE_DATA
// ------------------------------------------------------------------------- // -------------------------------------------------------------------------
} }
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
......
...@@ -2,9 +2,9 @@ ...@@ -2,9 +2,9 @@
* *
* $RCSfile: nodeaccess.hxx,v $ * $RCSfile: nodeaccess.hxx,v $
* *
* $Revision: 1.1 $ * $Revision: 1.2 $
* *
* last change: $Author: jb $ $Date: 2002-02-11 14:29:07 $ * last change: $Author: jb $ $Date: 2002-03-28 08:47:03 $
* *
* The Contents of this file are made available subject to the terms of * The Contents of this file are made available subject to the terms of
* either of the following licenses * either of the following licenses
...@@ -84,61 +84,6 @@ namespace configmgr ...@@ -84,61 +84,6 @@ namespace configmgr
// ------------------------------------------------------------------------- // -------------------------------------------------------------------------
using memory::Accessor; using memory::Accessor;
// ------------------------------------------------------------------------- // -------------------------------------------------------------------------
#ifdef NON_SHARABLE_DATA
// -------------------------------------------------------------------------
class NodeAccess
{
public:
typedef configuration::Name Name;
typedef node::Attributes Attributes;
typedef NodeAddress NodeAddressType;
typedef NodeAddress::AddressType AddressType;
typedef NodeAddress::DataType const DataType;
typedef DataType * NodePointerType;
static NodeAccess emptyNode() { return NodeAccess(); }
NodeAccess(Accessor const& _aAccessor, NodeAddressType const& _aNodeRef)
: m_aAccessor(_aAccessor)
, m_pData(_aNodeRef.m_pData)
{}
NodeAccess(Accessor const& _aAccessor, NodePointerType _pNode)
: m_aAccessor(_aAccessor)
, m_pData(_aAccessor.address(_pNode))
{}
bool isValid() const { return m_pData.is(); }
Name getName() const { return wrapName( data().getName() ); }
Attributes getAttributes() const { return data().getAttributes(); }
bool isDefault() const { return data().isDefault(); }
bool isLocalized() const { return data().isLocalized(); }
NodeAddressType address() const { return NodeAddressType(m_pData); }
Accessor accessor() const { return m_aAccessor; }
DataType& data() const { return *static_cast<NodePointerType>(m_aAccessor.validate(m_pData)); }
NodePointerType getDataPtr() const { return static_cast<NodePointerType>(m_aAccessor.access(m_pData)); }
AddressType rawAddress() const { return m_pData; }
static Name wrapName(rtl::OUString const& _aNameString)
{ return configuration::makeName( _aNameString, Name::NoValidate() ); }
static NodeAddress::DataType* access(NodeAddressType const& _aNodeRef, memory::UpdateAccessor& _rUpdateAccess);
static NodeAddress::DataType const* access(NodeAddressType const& _aNodeRef, Accessor const& _rReaderAccess)
{ return static_cast<NodePointerType>(_rReaderAccess.access(_aNodeRef.m_pData)); }
private:
NodeAccess() : m_aAccessor(NULL), m_pData() {}
Accessor m_aAccessor;
AddressType m_pData;
};
// -------------------------------------------------------------------------
#else // SHARABLE_DATA
// ------------------------------------------------------------------------- // -------------------------------------------------------------------------
class NodeAccess class NodeAccess
{ {
...@@ -197,8 +142,6 @@ namespace configmgr ...@@ -197,8 +142,6 @@ namespace configmgr
NodeAddress getSubnodeAddress(memory::Accessor const& _aAccess, NodeAddress const & _aNodeAddress, NodeAccess::Name const & _aName); NodeAddress getSubnodeAddress(memory::Accessor const& _aAccess, NodeAddress const & _aNodeAddress, NodeAccess::Name const & _aName);
NodeAddress getSubnodeAddress(memory::UpdateAccessor& _aAccess, NodeAddress const & _aNodeAddress, NodeAccess::Name const & _aName); NodeAddress getSubnodeAddress(memory::UpdateAccessor& _aAccess, NodeAddress const & _aNodeAddress, NodeAccess::Name const & _aName);
// ------------------------------------------------------------------------- // -------------------------------------------------------------------------
#endif // SHARABLE_DATA
// -------------------------------------------------------------------------
} }
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
} // namespace configmgr } // namespace configmgr
......
...@@ -2,9 +2,9 @@ ...@@ -2,9 +2,9 @@
* *
* $RCSfile: pointer.hxx,v $ * $RCSfile: pointer.hxx,v $
* *
* $Revision: 1.1 $ * $Revision: 1.2 $
* *
* last change: $Author: jb $ $Date: 2002-02-11 14:29:07 $ * last change: $Author: jb $ $Date: 2002-03-28 08:47:03 $
* *
* The Contents of this file are made available subject to the terms of * The Contents of this file are made available subject to the terms of
* either of the following licenses * either of the following licenses
...@@ -66,11 +66,9 @@ ...@@ -66,11 +66,9 @@
#include <sal/types.h> #include <sal/types.h>
#endif #endif
#ifndef NON_SHARABLE_DATA #ifndef INCLUDED_SHARABLE_BASETYPES_HXX
#ifndef INCLUDED_SHARABLE_BASETYPES_HXX #include "types.hxx"
#include "types.hxx" #endif
#endif
#endif // SHARABLE_DATA
namespace configmgr namespace configmgr
{ {
...@@ -87,11 +85,7 @@ namespace configmgr ...@@ -87,11 +85,7 @@ namespace configmgr
friend class Accessor; friend class Accessor;
friend class UpdateAccessor; friend class UpdateAccessor;
#ifdef NON_SHARABLE_DATA
typedef void const * AddressType;
#else // SHARABLE_DATA
typedef sharable::Address AddressType; typedef sharable::Address AddressType;
#endif // SHARABLE_DATA
AddressType m_value; AddressType m_value;
......
...@@ -2,9 +2,9 @@ ...@@ -2,9 +2,9 @@
* *
* $RCSfile: setnodeaccess.hxx,v $ * $RCSfile: setnodeaccess.hxx,v $
* *
* $Revision: 1.1 $ * $Revision: 1.2 $
* *
* last change: $Author: jb $ $Date: 2002-02-11 14:29:07 $ * last change: $Author: jb $ $Date: 2002-03-28 08:47:03 $
* *
* The Contents of this file are made available subject to the terms of * The Contents of this file are made available subject to the terms of
* either of the following licenses * either of the following licenses
...@@ -149,31 +149,6 @@ namespace configmgr ...@@ -149,31 +149,6 @@ namespace configmgr
SetNodeAddress toSetNodeAddress(memory::Accessor const & _aAccess, NodeAddress const & _aNodeAddr); SetNodeAddress toSetNodeAddress(memory::Accessor const & _aAccess, NodeAddress const & _aNodeAddr);
SetNodeAddress toSetNodeAddress(memory::UpdateAccessor & _aAccess, NodeAddress const & _aNodeAddr); SetNodeAddress toSetNodeAddress(memory::UpdateAccessor & _aAccess, NodeAddress const & _aNodeAddr);
// ------------------------------------------------------------------------- // -------------------------------------------------------------------------
#ifdef NON_SHARABLE_DATA
inline
NodeAccess::Name SetNodeAccess::getName() const
{ return NodeAccess::wrapName( data().getName() ); }
inline
NodeAccess::Name SetNodeAccess::getElementTemplateName() const
{ return NodeAccess::wrapName( data().getElementTemplateName() ); }
inline
NodeAccess::Name SetNodeAccess::getElementTemplateModule() const
{ return NodeAccess::wrapName( data().getElementTemplateModule() ); }
inline
NodeAccess::Attributes SetNodeAccess::getAttributes() const
{ return data().getAttributes(); }
inline
bool SetNodeAccess::isDefault() const
{ return data().isDefault(); }
inline
bool SetNodeAccess::isLocalizedValueSetNode() const
{ return isLocalizedValueSet(data()); }
#else // SHARABLE_DATA
inline inline
NodeAccess::Name SetNodeAccess::getName() const NodeAccess::Name SetNodeAccess::getName() const
{ return NodeAccess::wrapName( data().info.getName(m_aAccessor) ); } { return NodeAccess::wrapName( data().info.getName(m_aAccessor) ); }
...@@ -197,8 +172,6 @@ namespace configmgr ...@@ -197,8 +172,6 @@ namespace configmgr
inline inline
bool SetNodeAccess::isLocalizedValueSetNode() const bool SetNodeAccess::isLocalizedValueSetNode() const
{ return data().isLocalizedValue(); } { return data().isLocalizedValue(); }
#endif // SHARABLE_DATA
// ------------------------------------------------------------------------- // -------------------------------------------------------------------------
} }
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
......
...@@ -2,9 +2,9 @@ ...@@ -2,9 +2,9 @@
* *
* $RCSfile: treeaccessor.hxx,v $ * $RCSfile: treeaccessor.hxx,v $
* *
* $Revision: 1.1 $ * $Revision: 1.2 $
* *
* last change: $Author: jb $ $Date: 2002-02-11 14:29:07 $ * last change: $Author: jb $ $Date: 2002-03-28 08:47:03 $
* *
* The Contents of this file are made available subject to the terms of * The Contents of this file are made available subject to the terms of
* either of the following licenses * either of the following licenses
...@@ -148,21 +148,6 @@ namespace configmgr ...@@ -148,21 +148,6 @@ namespace configmgr
DataAddressType m_pBase; DataAddressType m_pBase;
}; };
// ------------------------------------------------------------------------- // -------------------------------------------------------------------------
#ifdef NON_SHARABLE_DATA
// -------------------------------------------------------------------------
inline
TreeAccessor::Name TreeAccessor::getName() const
{
return wrapName( data().getName() );
}
// -------------------------------------------------------------------------
inline
NodeAddress TreeAccessor::rootAddress(DataAddressType const& p) const
{
return NodeAddress(p.m_pData);
}
// -------------------------------------------------------------------------
#else // SHARABLE_DATA
// ------------------------------------------------------------------------- // -------------------------------------------------------------------------
inline inline
TreeAccessor::Name TreeAccessor::getName() const TreeAccessor::Name TreeAccessor::getName() const
...@@ -180,7 +165,6 @@ namespace configmgr ...@@ -180,7 +165,6 @@ namespace configmgr
return NodeAddress( memory::Pointer(aAddr) ); return NodeAddress( memory::Pointer(aAddr) );
} }
// ------------------------------------------------------------------------- // -------------------------------------------------------------------------
#endif // SHARABLE_DATA
} }
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
} // namespace configmgr } // namespace configmgr
......
...@@ -2,9 +2,9 @@ ...@@ -2,9 +2,9 @@
* *
* $RCSfile: treesegment.hxx,v $ * $RCSfile: treesegment.hxx,v $
* *
* $Revision: 1.1 $ * $Revision: 1.2 $
* *
* last change: $Author: jb $ $Date: 2002-02-11 14:29:07 $ * last change: $Author: jb $ $Date: 2002-03-28 08:50:15 $
* *
* The Contents of this file are made available subject to the terms of * The Contents of this file are made available subject to the terms of
* either of the following licenses * either of the following licenses
...@@ -103,15 +103,10 @@ namespace configmgr ...@@ -103,15 +103,10 @@ namespace configmgr
typedef configuration::Name Name; typedef configuration::Name Name;
typedef std::auto_ptr<INode> RawTreeData; typedef std::auto_ptr<INode> RawTreeData;
typedef rtl::OUString RawName; typedef rtl::OUString RawName;
#ifdef NON_SHARABLE_DATA
typedef INode const * NodeDataPtr;
typedef INode const * TreeDataPtr;
typedef INode * TreeDataUpdatePtr;
#else // SHARABLE_DATA
typedef sharable::Node const * NodeDataPtr; typedef sharable::Node const * NodeDataPtr;
typedef sharable::TreeFragment const * TreeDataPtr; typedef sharable::TreeFragment const * TreeDataPtr;
typedef sharable::TreeFragment * TreeDataUpdatePtr; typedef sharable::TreeFragment * TreeDataUpdatePtr;
#endif // SHARABLE_DATA
static TreeSegment createNew(RawTreeData _aTree, RawName const & _aTypeName) static TreeSegment createNew(RawTreeData _aTree, RawName const & _aTypeName)
{ return createNewSegment(_aTree,_aTypeName); } { return createNewSegment(_aTree,_aTypeName); }
......
...@@ -2,9 +2,9 @@ ...@@ -2,9 +2,9 @@
* *
* $RCSfile: updatehelper.hxx,v $ * $RCSfile: updatehelper.hxx,v $
* *
* $Revision: 1.2 $ * $Revision: 1.3 $
* *
* last change: $Author: jb $ $Date: 2002-02-11 13:47:54 $ * last change: $Author: jb $ $Date: 2002-03-28 08:50:15 $
* *
* The Contents of this file are made available subject to the terms of * The Contents of this file are made available subject to the terms of
* either of the following licenses * either of the following licenses
...@@ -74,18 +74,6 @@ namespace configmgr ...@@ -74,18 +74,6 @@ namespace configmgr
namespace data { class NodeAddress; class NodeAccess; } namespace data { class NodeAddress; class NodeAccess; }
//.......................................................................... //..........................................................................
#ifdef NON_SHARABLE_DATA
// adjust a set of changes to the target tree, return true, if there are changes left
bool adjustUpdateToTree(SubtreeChange & _rUpdateTree, ISubtree const& _aTargetTree);
// apply a already matching set of changes to the target tree
void applyUpdateToTree(SubtreeChange& _anUpdateTree, ISubtree& _aTree);
// apply a set of changes to the target tree
void applyUpdateWithAdjustmentToTree(SubtreeChange& _anUpdateTree, ISubtree& _aTree);
#else // SHARABLE_DATA
// adjust a set of changes to the target tree, return true, if there are changes left // adjust a set of changes to the target tree, return true, if there are changes left
bool adjustUpdateToTree(SubtreeChange & _rUpdateTree, data::NodeAccess const & _aRootNode); bool adjustUpdateToTree(SubtreeChange & _rUpdateTree, data::NodeAccess const & _aRootNode);
...@@ -99,9 +87,6 @@ namespace configmgr ...@@ -99,9 +87,6 @@ namespace configmgr
// apply a set of changes to the target tree // apply a set of changes to the target tree
void applyUpdateWithAdjustmentToTree(SubtreeChange& _anUpdateTree, memory::UpdateAccessor& _anUpdateAccess, data::NodeAddress _aRootNode); void applyUpdateWithAdjustmentToTree(SubtreeChange& _anUpdateTree, memory::UpdateAccessor& _anUpdateAccess, data::NodeAddress _aRootNode);
#endif // SHARABLE_DATA
// apply a set of changes to the target tree, return true, if there are changes found // apply a set of changes to the target tree, return true, if there are changes found
bool createUpdateFromDifference(SubtreeChange& _rResultingUpdateTree, data::NodeAccess const & _aExistingData, ISubtree const & _aNewData); bool createUpdateFromDifference(SubtreeChange& _rResultingUpdateTree, data::NodeAccess const & _aExistingData, ISubtree const & _aNewData);
......
...@@ -2,9 +2,9 @@ ...@@ -2,9 +2,9 @@
* *
* $RCSfile: valuenodeaccess.hxx,v $ * $RCSfile: valuenodeaccess.hxx,v $
* *
* $Revision: 1.1 $ * $Revision: 1.2 $
* *
* last change: $Author: jb $ $Date: 2002-02-11 14:29:07 $ * last change: $Author: jb $ $Date: 2002-03-28 08:47:03 $
* *
* The Contents of this file are made available subject to the terms of * The Contents of this file are made available subject to the terms of
* either of the following licenses * either of the following licenses
...@@ -143,36 +143,7 @@ namespace configmgr ...@@ -143,36 +143,7 @@ namespace configmgr
ValueNodeAddress toValueNodeAddress(memory::Accessor const & _aAccess, NodeAddress const & _aNodeAddr); ValueNodeAddress toValueNodeAddress(memory::Accessor const & _aAccess, NodeAddress const & _aNodeAddr);
ValueNodeAddress toValueNodeAddress(memory::UpdateAccessor & _aAccess, NodeAddress const & _aNodeAddr); ValueNodeAddress toValueNodeAddress(memory::UpdateAccessor & _aAccess, NodeAddress const & _aNodeAddr);
// ------------------------------------------------------------------------- // -------------------------------------------------------------------------
#ifdef NON_SHARABLE_DATA
inline
NodeAccess::Name ValueNodeAccess::getName() const
{ return NodeAccess::wrapName( data().getName() ); }
inline
NodeAccess::Attributes ValueNodeAccess::getAttributes() const
{ return data().getAttributes(); }
inline
bool ValueNodeAccess::isDefault() const
{ return data().isDefault(); }
inline
bool ValueNodeAccess::isLocalized() const
{ return data().isLocalized(); }
inline
uno::Any ValueNodeAccess::getValue() const
{ return data().getValue(); }
inline
uno::Any ValueNodeAccess::getUserValue() const
{ return data().getUserValue(); }
inline
uno::Any ValueNodeAccess::getDefaultValue() const
{ return data().getDefault(); }
#else // SHARABLE_DATA
inline inline
NodeAccess::Name ValueNodeAccess::getName() const NodeAccess::Name ValueNodeAccess::getName() const
{ return NodeAccess::wrapName( data().info.getName(m_aAccessor) ); } { return NodeAccess::wrapName( data().info.getName(m_aAccessor) ); }
...@@ -200,7 +171,6 @@ namespace configmgr ...@@ -200,7 +171,6 @@ namespace configmgr
inline inline
uno::Any ValueNodeAccess::getDefaultValue() const uno::Any ValueNodeAccess::getDefaultValue() const
{ return data().getDefaultValue(m_aAccessor); } { return data().getDefaultValue(m_aAccessor); }
#endif // SHARABLE_DATA
// ------------------------------------------------------------------------- // -------------------------------------------------------------------------
} }
......
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