diff --git a/src/xercesc/internal/XSerializeEngine.cpp b/src/xercesc/internal/XSerializeEngine.cpp index 6d325e10d595daea89d58b5a884962f86f006f0d..77318318b360dc56eef6000251172ba0c6257cf0 100644 --- a/src/xercesc/internal/XSerializeEngine.cpp +++ b/src/xercesc/internal/XSerializeEngine.cpp @@ -17,6 +17,9 @@ /* * $Id$ * $Log$ + * Revision 1.22 2004/11/08 03:56:47 peiyongz + * setting/getting Storer level + * * Revision 1.21 2004/10/27 20:38:52 peiyongz * Optimized alignment for various data types * @@ -161,6 +164,7 @@ XSerializeEngine::XSerializeEngine(BinInputStream* inStream , XMLGrammarPool* const gramPool , unsigned long bufSize) :fStoreLoad(mode_Load) +,fStorerLevel(0) ,fGrammarPool(gramPool) ,fInputStream(inStream) ,fOutputStream(0) @@ -185,6 +189,7 @@ XSerializeEngine::XSerializeEngine(BinOutputStream* outStream , XMLGrammarPool* const gramPool , unsigned long bufSize) :fStoreLoad(mode_Store) +,fStorerLevel(0) ,fGrammarPool(gramPool) ,fInputStream(0) ,fOutputStream(outStream) @@ -212,6 +217,7 @@ XSerializeEngine::XSerializeEngine(BinInputStream* inStream , MemoryManager* const manager , unsigned long bufSize) :fStoreLoad(mode_Load) +,fStorerLevel(0) ,fGrammarPool(0) ,fInputStream(inStream) ,fOutputStream(0) @@ -236,6 +242,7 @@ XSerializeEngine::XSerializeEngine(BinOutputStream* outStream , MemoryManager* const manager , unsigned long bufSize) :fStoreLoad(mode_Store) +,fStorerLevel(0) ,fGrammarPool(0) ,fInputStream(0) ,fOutputStream(outStream) diff --git a/src/xercesc/internal/XSerializeEngine.hpp b/src/xercesc/internal/XSerializeEngine.hpp index f574337866a6f70284b7579de1eaef8427c56d4c..ec32fd48d820a0bca5d8c12d0bcb68e2de2a148b 100644 --- a/src/xercesc/internal/XSerializeEngine.hpp +++ b/src/xercesc/internal/XSerializeEngine.hpp @@ -16,6 +16,9 @@ /* * $Log$ + * Revision 1.21 2004/11/08 03:56:47 peiyongz + * setting/getting Storer level + * * Revision 1.20 2004/10/27 20:38:52 peiyongz * Optimized alignment for various data types * @@ -100,6 +103,7 @@ class XSerializedObjectId; class BinOutputStream; class BinInputStream; class XMLGrammarPool; +class XMLGrammarPoolImpl; class XMLStringPool; class XMLUTIL_EXPORT XSerializeEngine @@ -257,6 +261,20 @@ public: ***/ MemoryManager* getMemoryManager() const; + /*** + * + * Get the storer level (the level of the serialize engine + * which created the binary stream that this serialize engine + * is loading). + * + * The level returned is meaningful only when + * the engine isLoading. + * + * Return: level + * + ***/ + inline unsigned short getStorerLevel() const; + /*** * * Write object to the internal buffer. @@ -699,6 +717,12 @@ private: // fStoreLoad: // Indicator: storing(serialization) or loading(de-serialization) // + // fStorerLevel: + // The level of the serialize engine which created the binary + // stream that this serialize engine is loading + // + // It is set by GrammarPool when loading + // // fGrammarPool: // Thw owning GrammarPool which instantiate this SerializeEngine // instance @@ -735,7 +759,9 @@ private: // // fMapCount: // ------------------------------------------------------------------------------- - const short fStoreLoad; + const short fStoreLoad; + short fStorerLevel; + XMLGrammarPool* const fGrammarPool; BinInputStream* const fInputStream; BinOutputStream* const fOutputStream; @@ -775,6 +801,9 @@ private: * object counter ***/ XSerializedObjectId_t fObjectCount; + + //to allow grammar pool to set storer level when loading + friend class XMLGrammarPoolImpl; }; inline bool XSerializeEngine::isStoring() const @@ -868,6 +897,12 @@ const unsigned long XSerializeEngine::getBufCount() const return fBufCount; } +inline +unsigned short XSerializeEngine::getStorerLevel() const +{ + return fStorerLevel; +} + /*** * Ought to be nested class ***/