#define _StdLPersistent_HArray1_HeaderFile
#include <StdObjMgt_Persistent.hxx>
-#include <StdLPersistent_HArray1OfPersistent.hxx>
+#include <StdObjMgt_ReadData.hxx>
+
+#include <NCollection_DefineHArray1.hxx>
+
#include <TColStd_HArray1OfInteger.hxx>
#include <TColStd_HArray1OfReal.hxx>
#include <TColStd_HArray1OfByte.hxx>
class TDF_Data;
-class StdLPersistent_HArray1 : protected StdObjMgt_ContentTypes
+DEFINE_HARRAY1 (StdLPersistent_HArray1OfPersistent,
+ NCollection_Array1<Handle(StdObjMgt_Persistent)>)
+
+
+class StdLPersistent_HArray1
{
- class commonBase : public StdObjMgt_Persistent
+ class base : public StdObjMgt_Persistent
{
public:
//! Read persistent data from a file.
protected:
template <class ArrayClass>
- class base : public commonBase
+ class instance : public base
{
public:
typedef Handle(ArrayClass) ArrayHandle;
const Standard_Integer theUpperBound)
{ myArray = new ArrayClass (theLowerBound, theUpperBound); }
- protected:
- Handle(ArrayClass) myArray;
- };
+ virtual void readValue (StdObjMgt_ReadData& theReadData,
+ const Standard_Integer theIndex)
+ { theReadData >> myArray->ChangeValue (theIndex); }
-private:
- template <class ArrayClass, class ValueClass = Value<typename ArrayClass::value_type> >
- class instance : public base<ArrayClass>
- {
protected:
- Standard_EXPORT virtual void readValue (StdObjMgt_ReadData& theReadData,
- const Standard_Integer theIndex);
+ Handle(ArrayClass) myArray;
};
public:
- typedef instance<TColStd_HArray1OfInteger> Integer;
- typedef instance<TColStd_HArray1OfReal> Real;
- typedef instance<TColStd_HArray1OfByte, Value<Standard_Character> >Byte;
- typedef instance<StdLPersistent_HArray1OfPersistent, Reference<> > Persistent;
+ typedef instance<TColStd_HArray1OfInteger> Integer;
+ typedef instance<TColStd_HArray1OfReal> Real;
+ typedef instance<TColStd_HArray1OfByte> Byte;
+ typedef instance<StdLPersistent_HArray1OfPersistent> Persistent;
};
+inline StdObjMgt_ReadData& operator >>
+ (StdObjMgt_ReadData& theReadData, Standard_Byte& theByte)
+ { return theReadData >> reinterpret_cast<Standard_Character&> (theByte); }
+
#endif