24#ifndef __OdGsFilerV100Impl_H__ 
   25#define __OdGsFilerV100Impl_H__ 
  109      for (
OdUInt32 nb = 0; nb < nBytes; nb++)
 
  123    operator const void*() 
const { 
return this; }
 
  157  typedef std::map<OdUInt32, AbstractTyp> 
RegsMap;
 
  162  template<OdUInt32 nBytes> 
struct Procs 
  165    typedef std::map<ProcTyp, ProcTyp> 
RegMap;
 
  167    static void makeSubst(
void *pPlace, 
const void *pSubstitution)
 
  178      if (pPlace && pSubstitution)
 
  180        runSubst(pPlace, pSubstitution, pAct);
 
  189          if (itReg != pRegMap->end())
 
  191            runSubst(pPlace, itReg->second, pAct);
 
  193              pRegMap->erase(itReg);
 
  196        else if (pSubstitution)
 
  200          if (itSub != pSubMap->end())
 
  202            for (
OdInt32 n = 0; n < itSub->second.m_nVoids; n++)
 
  203              runSubst(itSub->second.at(n)->m_pVoid, pSubstitution, itSub->second.at(n)->m_pAct);
 
  205              pSubMap->erase(itSub);
 
  212          if (pRegMap && pSubMap)
 
  216            if ((itReg != pRegMap->end()) && (itSub != pSubMap->end()))
 
  218              for (
OdInt32 n = 0; n < itSub->second.m_nVoids; n++)
 
  219                runSubst(itSub->second.at(n)->m_pVoid, itReg->second, itSub->second.at(n)->m_pAct);
 
  223              if (itReg != pRegMap->end())
 
  224                pRegMap->erase(itReg);
 
  225              if (itSub != pSubMap->end())
 
  226                pSubMap->erase(itSub);
 
  234              if (itReg != pRegMap->end())
 
  235                pRegMap->erase(itReg);
 
  240              if (itSub != pSubMap->end())
 
  241                pSubMap->erase(itSub);
 
  249      if (pRegMap && pSubMap)
 
  251        OD_TYPENAME RegMap::iterator itReg = pRegMap->begin();
 
  252        while (itReg != pRegMap->end())
 
  254          OD_TYPENAME SubstMap::iterator itSub = pSubMap->find(itReg->first);
 
  255          if (itSub != pSubMap->end())
 
  257            for (
OdInt32 n = 0; n < itSub->second.m_nVoids; n++)
 
  258              runSubst(itSub->second.at(n)->m_pVoid, itReg->second, itSub->second.at(n)->m_pAct);
 
  265        if (pRegMap) { 
delete pRegMap; impl.
m_regs[nBytes].m_pContainer = NULL; }
 
  266        if (pSubMap) { 
delete pSubMap; impl.
m_substs[nBytes].m_pContainer = NULL; }
 
  280        subst(impl, pValue, NULL, NULL, pSubstitution, 
false);
 
  292            if (itReg != pRegMap->end())
 
  294              runSubst(pPlace, itReg->second, pAct);
 
  303        pMap[*(
const ProcTyp*)pValue].add(pPlace, pAct);
 
  306        subst(impl, pValue, pPlace, pAct, NULL, 
false);
 
  317          if (it != pRegMap->end())
 
  323          if (it != pSubMap->end())
 
  329        if (pRegMap) { 
delete pRegMap; impl.
m_regs[nBytes].m_pContainer = NULL; }
 
  330        if (pSubMap) { 
delete pSubMap; impl.
m_substs[nBytes].m_pContainer = NULL; }
 
  338    OdRxObjectSubstitutionActuator() { }
 
  339    virtual void applySubstitution(
void *pPlace, 
const void *pValue, SetPtrFunc pSetFunc)
 
  345  } g_rxObjectActuator;
 
  368    kOpenedForWrite = (1 << 0),
 
  370    kLastFlag = kOpenedForWrite
 
  424    , m_nCurSection(kEOFSection)
 
  425    , m_nCurSectionSize(0)
 
bool operator!=(T left, const OdGiVariant::EnumType right)
bool operator==(T left, const OdGiVariant::EnumType right)
#define GS_TOOLKIT_EXPORT
OdSmartPtr< OdGsFilerDbLinker > OdGsFilerDbLinkerPtr
bool operator>=(const OdString &s1, const OdString &s2)
bool operator<=(const OdString &s1, const OdString &s2)
bool operator<(const OdString &s1, const OdString &s2)
bool operator>(const OdString &s1, const OdString &s2)
#define SETBIT(flags, bit, value)
#define GETBIT(flags, bit)
virtual OdUInt64 stubToDbHandle(OdDbStub *pStub) const =0
virtual OdDbStub * handleToDbStub(OdUInt64 nHandle) const =0
virtual OdBinaryData getDbHash(const OdDbBaseDatabase *pDb) const
virtual OdDbBaseDatabase * getDatabase() const =0
virtual ~OdGsFilerDbLinker()
virtual OdDbBaseDatabase * getDatabase(OdDbStub *pStub) const =0
virtual void wrHandle(OdDbStub *pHandle)
virtual void wrSectionEnd(Section section)
virtual void setReadSections(OdUInt64 nSections)
virtual OdRxObjectPtr rdClass() const
std::map< OdString, OdRxObjectPtr > ArbDataMap
virtual bool checkDbHash(const OdDbBaseDatabase *pDb)
virtual bool setStream(OdStreamBuf *pStream, bool bWrite=false)
virtual void skipSection() const
virtual bool hasArbitraryData(const OdChar *pName) const
virtual bool isWriteSection(Section section) const
OdUInt32 headerTestChunk() const
virtual void unregisterPtr(const void *pPtr)
virtual void wrEOFSection()
OdSmartPtr< OdGsFiler_SubstitutorImpl > m_subst
virtual void wrRawData(const void *pData, OdUInt32 nDataSize)
virtual Section rdSection() const
virtual OdRxObjectPtr getArbitraryData(const OdChar *pName) const
virtual void wrDbHash(const OdDbBaseDatabase *pDb)
OdGsFilerDbLinkerPtr m_pLinker
virtual void setArbitraryData(const OdChar *pName, OdRxObject *pObject)
std::set< const void * > RegPtrsSet
virtual void setWriteSection(Section section, bool bSet)
virtual void rdBackSection() const
virtual void wrClass(OdRxObject *pObj)
virtual void rdRawData(void *pData, OdUInt32 nDataSize) const
virtual OdRxObjectPtr getSubstitutor() const
virtual Section curSection() const
OdUInt64 m_nSectionsToWrite
virtual void setVersion(OdUInt32 nVersion)
virtual void setSubstitutor(OdRxObject *pSubst)
virtual OdDbBaseDatabase * getDatabase() const
virtual void wrSectionBegin(Section section)
virtual void setDatabase(const OdDbBaseDatabase *pDb)
virtual void clearArbitraryData()
virtual void clearRegisteredPtrs()
virtual bool isPtrRegistered(const void *pPtr) const
virtual OdUInt32 version() const
virtual bool isReadSection(Section section) const
virtual void setReadSection(Section section, bool bSet)
virtual OdDbStub * rdHandle() const
virtual bool checkEOF() const
virtual Substitutor * subst() const
virtual void makeSubstitutions(bool bClear=true) const
virtual void registerPtr(const void *pPtr)
OdUInt64 m_nSectionsToRead
void setWriting(bool bSet)
virtual void setWriteSections(OdUInt64 nSections)
OdUInt32 m_nCurSectionSize
OdStack< WrSectionData > m_sectionStack
virtual OdStreamBufPtr getStream() const
static OdSmartPtr< TInterface > createObject()
virtual void applySubstitution(void *pPlace, const void *pValue, SetPtrFunc pSetFunc)
virtual void clearSubstitutions(const void *pValue=NULL, OdUInt32 size=0)=0
static int compare(const DataTyp &t1, const DataTyp &t2)
std::map< ProcTyp, VoidArry > SubstMap
static void subst(OdGsFiler_SubstitutorImpl &impl, const void *pValue, void *pPlace, OdGsFiler::SubstitutionActuator *pAct, const void *pSubstitution, bool bClear)
std::map< ProcTyp, ProcTyp > RegMap
static void clear(OdGsFiler_SubstitutorImpl &impl, const void *pValue)
OdGsFiler_SubstitutorImpl::DataTyp< nBytes > ProcTyp
static void reg(OdGsFiler_SubstitutorImpl &impl, const void *pValue, const void *pSubstitution, bool bRegister, bool bImmediate)
static void runSubst(void *pPlace, const void *pSubstitution, OdGsFiler::SubstitutionActuator *pActuator)
static void req(OdGsFiler_SubstitutorImpl &impl, void *pPlace, OdGsFiler::SubstitutionActuator *pAct, const void *pValue, bool bRegister, bool bImmediate)
static void makeSubst(void *pPlace, const void *pSubstitution)
void add(void *pVoid, OdGsFiler::SubstitutionActuator *pAct)
bool contains(void *pVoid)
OdGsFiler::SubstitutionActuator * m_pAct
~OdGsFiler_SubstitutorImpl()
std::map< OdUInt32, AbstractTyp > SubstsMap
virtual void requestSubstitution(void *pPlace, OdGsFiler::SubstitutionActuator *pActuator, const void *pValue, OdUInt32 size=sizeof(OdIntPtr), bool bRegister=true, bool bImmediate=true)
virtual void requestSubstitution(OdBaseObjectPtr *pPlace, const void *pValue, bool bRegister=true, bool bImmediate=true)
virtual void registerSubstitution(const void *pValue, const void *pSubstitution, OdUInt32 size=sizeof(OdIntPtr), bool bRegister=true, bool bImmediate=false)
virtual void runSubstitutions(const void *pValue=NULL, OdUInt32 size=0, bool bClear=true)
std::map< OdUInt32, AbstractTyp > RegsMap
virtual void requestSubstitution(void *pPlace, const void *pValue, OdUInt32 size=sizeof(OdIntPtr), bool bRegister=true, bool bImmediate=true)
virtual void clearSubstitutions(const void *pValue=NULL, OdUInt32 size=0)
static OdGsFiler::SubstitutionActuator g_defActuator
OdGsFiler::Section m_type
WrSectionData(OdGsFiler::Section section, OdUInt32 tell)