// Copyright (c) 2015 OPEN CASCADE SAS // // This file is part of Open CASCADE Technology software library. // // This library is free software; you can redistribute it and/or modify it under // the terms of the GNU Lesser General Public License version 2.1 as published // by the Free Software Foundation, with special exception defined in the file // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT // distribution for complete text of the license and disclaimer of any warranty. // // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. #ifndef _StdLPersistent_Collection_HeaderFile #define _StdLPersistent_Collection_HeaderFile #include #include #include #include #include #include #include #include #include #include #include #include #include #include class StdLPersistent_Collection { // Converters struct noConversion; struct byteConverter; struct boolConverter; struct stringConverter; struct referenceConverter; // Base templates template class booleanArrayBase : public Base { public: //! Read persistent data from a file. Standard_EXPORT virtual void Read (StdObjMgt_ReadData& theReadData); protected: template inline void import (const ArrayHandle& theArray, Converter theConverter) const; protected: Standard_Integer myLower; Standard_Integer myUpper; }; template class directArrayBase : public Base { protected: template inline void import (const ArrayHandle& theArray, Converter theConverter) const; }; template class arrayBase : public Base { protected: template inline void import (const ArrayHandle& theArray, Converter theConverter) const; }; template class listBase : public Base { protected: template inline void import (const ArrayHandle& theArray, Converter theConverter) const; }; template class mapBase : public Base { protected: template inline void import (const ArrayHandle& theArray, Converter theConverter) const; }; // Instance templates template class BaseT, class HArrayClass, class AttribClass, class Converter> class instance : public BaseT ::SingleRef> { public: //! Import transient attribuite from the persistent data. Standard_EXPORT virtual void ImportAttribute(); }; template class instance_1 : public Instance { public: //! Read persistent data from a file. Standard_EXPORT virtual void Read (StdObjMgt_ReadData& theReadData); //! Import transient attribuite from the persistent data. Standard_EXPORT virtual void ImportAttribute(); private: Standard_Boolean myDelta; }; // Collection type specialization template struct booleanArrayT : instance {}; template struct directArrayT : instance {}; template struct arrayT : instance {}; template struct listT : instance {}; template struct mapT : instance {}; // Internal array types typedef StdLPersistent_HArray1::Integer integer; typedef StdLPersistent_HArray1::Real real; typedef StdLPersistent_HArray1::Persistent persistent; public: // Final specialization typedef booleanArrayT BooleanArray; typedef directArrayT IntegerArray; typedef directArrayT RealArray; typedef arrayT ByteArray; typedef arrayT ExtStringArray; typedef arrayT ReferenceArray; typedef listT IntegerList; typedef listT RealList; typedef listT BooleanList; typedef listT ExtStringList; typedef listT ReferenceList; typedef mapT IntPackedMap; typedef instance_1 IntegerArray_1; typedef instance_1 RealArray_1; typedef instance_1 ByteArray_1; typedef instance_1 ExtStringArray_1; typedef instance_1 IntPackedMap_1; }; #endif