|
From: CVS C. to T. <the...@li...> - 2011-01-16 16:51:50
|
Revision: 615
http://themis.svn.sourceforge.net/themis/?rev=615&view=rev
Author: mark_hellegers
Date: 2011-01-16 16:51:44 +0000 (Sun, 16 Jan 2011)
Log Message:
-----------
Added private variable to store the parent of a BaseEntry and fill it in when adding an entry.
Modified Paths:
--------------
trunk/themis/common/BaseEntry.cpp
trunk/themis/common/BaseEntry.hpp
Modified: trunk/themis/common/BaseEntry.cpp
===================================================================
--- trunk/themis/common/BaseEntry.cpp 2011-01-16 16:16:14 UTC (rev 614)
+++ trunk/themis/common/BaseEntry.cpp 2011-01-16 16:51:44 UTC (rev 615)
@@ -39,6 +39,7 @@
BaseEntry :: BaseEntry(int32 aId) {
fId = aId;
+ fParent = NULL;
}
@@ -59,6 +60,7 @@
void BaseEntry :: addEntry(BaseEntry * aEntry) {
+ aEntry->setParent(this);
fChildEntries.push_back(aEntry);
}
@@ -85,6 +87,18 @@
return result;
}
+void BaseEntry :: setParent(BaseEntry * aParent) {
+
+ fParent = aParent;
+
+}
+
+BaseEntry * BaseEntry :: getParent() {
+
+ return fParent;
+
+}
+
void BaseEntry :: set(const string aName, const char * aValue) {
if (mStrings.count(aName) == 0) {
Modified: trunk/themis/common/BaseEntry.hpp
===================================================================
--- trunk/themis/common/BaseEntry.hpp 2011-01-16 16:16:14 UTC (rev 614)
+++ trunk/themis/common/BaseEntry.hpp 2011-01-16 16:51:44 UTC (rev 615)
@@ -63,6 +63,7 @@
private:
int32 fId;
+ BaseEntry * fParent;
map<string, string> mStrings;
map<string, bool> mBooleans;
@@ -79,6 +80,8 @@
int32 getId() const;
void addEntry(BaseEntry * aEntry);
BaseEntry * getEntry(int32 aId);
+ void setParent(BaseEntry * aParent);
+ BaseEntry * getParent();
void set(const string aName, const char * aValue);
void set(const string aName, const string aValue);
void set(const string aName, const bool aValue);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|