diff options
author | Jörg Barfurth <jb@openoffice.org> | 2000-11-16 17:03:39 +0000 |
---|---|---|
committer | Jörg Barfurth <jb@openoffice.org> | 2000-11-16 17:03:39 +0000 |
commit | 4e28514fdda193b0d3f6dce94782b7f99a9abec6 (patch) | |
tree | c15513c9b21fa438cd911293a1234eb141d0336d | |
parent | 3e8b2931d2ca3a2c1482098f3bc30f1428cea293 (diff) |
Added functionality for notification support
-rw-r--r-- | configmgr/source/inc/nodechange.hxx | 14 | ||||
-rw-r--r-- | configmgr/source/treemgr/nodechange.cxx | 40 |
2 files changed, 49 insertions, 5 deletions
diff --git a/configmgr/source/inc/nodechange.hxx b/configmgr/source/inc/nodechange.hxx index 5f37f08e0e37..8a96ce8000f5 100644 --- a/configmgr/source/inc/nodechange.hxx +++ b/configmgr/source/inc/nodechange.hxx @@ -2,9 +2,9 @@ * * $RCSfile: nodechange.hxx,v $ * - * $Revision: 1.1 $ + * $Revision: 1.2 $ * - * last change: $Author: jb $ $Date: 2000-11-07 14:40:31 $ + * last change: $Author: jb $ $Date: 2000-11-16 18:03:38 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -167,6 +167,14 @@ namespace configmgr /// checks whether there are any (non-empty) changes in this bool isEmpty() const; + /// retrieves the total count of changes in this collection + ChangesList::size_type getCount() const { return m_aChanges.size(); } + + /// retrieve information about the changed data + bool getChangesInfo(std::vector<NodeChangeInfo>& rInfos) const; + /// retrieve information about the changed data + bool getChangesInfo(std::vector<ExtendedNodeChangeInfo>& rInfos) const; + /// test all changes NodeChanges& test() { implTest(); return *this; } NodeChanges const& test() const { implTest(); return *this; } @@ -175,7 +183,7 @@ namespace configmgr NodeChanges& apply() { implApply(); return *this; } NodeChanges const& apply() const{ implApply(); return *this; } - /// remove all changes known as doing nothing from this collection. + /// remove all changes known to be doing nothing from this collection. NodeChanges& compact(); /** insert a change into this collection diff --git a/configmgr/source/treemgr/nodechange.cxx b/configmgr/source/treemgr/nodechange.cxx index 1cf2472dbc99..00f00978168b 100644 --- a/configmgr/source/treemgr/nodechange.cxx +++ b/configmgr/source/treemgr/nodechange.cxx @@ -2,9 +2,9 @@ * * $RCSfile: nodechange.cxx,v $ * - * $Revision: 1.2 $ + * $Revision: 1.3 $ * - * last change: $Author: jb $ $Date: 2000-11-14 10:53:36 $ + * last change: $Author: jb $ $Date: 2000-11-16 18:03:39 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -327,6 +327,42 @@ void NodeChanges::reset(Node const& aNode) { } */ + +bool NodeChanges::getChangesInfo(std::vector<NodeChangeInfo>& rInfos) const +{ + if (isEmpty()) return false; + + rInfos.clear(); + rInfos.reserve(getCount()); + + for (Iterator it = begin(); it != end(); ++it) + { + NodeChangeInfo aInfo; + if ( it->getChangeInfo(aInfo) ) + rInfos.push_back(aInfo); + } + + return !rInfos.empty(); +} +//----------------------------------------------------------------------------- + +bool NodeChanges::getChangesInfo(std::vector<ExtendedNodeChangeInfo>& rInfos) const +{ + if (isEmpty()) return false; + + rInfos.clear(); + rInfos.reserve(getCount()); + + for (Iterator it = begin(); it != end(); ++it) + { + ExtendedNodeChangeInfo aInfo; + if ( it->getChangeInfo(aInfo) ) + rInfos.push_back(aInfo); + } + + return !rInfos.empty(); +} +//----------------------------------------------------------------------------- //----------------------------------------------------------------------------- } |