CFx SDK Documentation
2020SP3
|
Go to the documentation of this file.
24 #ifndef __OdGsFilerV100Impl_H__
25 #define __OdGsFilerV100Impl_H__
71 for (
OdUInt32 nb = 0; nb < nBytes; nb++)
85 operator const void*()
const {
return this; }
119 typedef std::map<OdUInt32, AbstractTyp>
RegsMap;
124 template<OdUInt32 nBytes>
struct Procs
127 typedef std::map<ProcTyp, ProcTyp>
RegMap;
129 static void makeSubst(
void *pPlace,
const void *pSubstitution)
140 if (pPlace && pSubstitution)
142 runSubst(pPlace, pSubstitution, pAct);
151 if (itReg != pRegMap->end())
153 runSubst(pPlace, itReg->second, pAct);
155 pRegMap->erase(itReg);
158 else if (pSubstitution)
162 if (itSub != pSubMap->end())
164 for (
OdInt32 n = 0; n < itSub->second.m_nVoids; n++)
165 runSubst(itSub->second.at(n)->m_pVoid, pSubstitution, itSub->second.at(n)->m_pAct);
167 pSubMap->erase(itSub);
174 if (pRegMap && pSubMap)
178 if ((itReg != pRegMap->end()) && (itSub != pSubMap->end()))
180 for (
OdInt32 n = 0; n < itSub->second.m_nVoids; n++)
181 runSubst(itSub->second.at(n)->m_pVoid, itReg->second, itSub->second.at(n)->m_pAct);
185 if (itReg != pRegMap->end())
186 pRegMap->erase(itReg);
187 if (itSub != pSubMap->end())
188 pSubMap->erase(itSub);
196 if (itReg != pRegMap->end())
197 pRegMap->erase(itReg);
202 if (itSub != pSubMap->end())
203 pSubMap->erase(itSub);
211 if (pRegMap && pSubMap)
213 OD_TYPENAME RegMap::iterator itReg = pRegMap->begin();
214 while (itReg != pRegMap->end())
216 OD_TYPENAME SubstMap::iterator itSub = pSubMap->find(itReg->first);
217 if (itSub != pSubMap->end())
219 for (
OdInt32 n = 0; n < itSub->second.m_nVoids; n++)
220 runSubst(itSub->second.at(n)->m_pVoid, itReg->second, itSub->second.at(n)->m_pAct);
227 if (pRegMap) {
delete pRegMap; impl.
m_regs[nBytes].m_pContainer =
NULL; }
228 if (pSubMap) {
delete pSubMap; impl.
m_substs[nBytes].m_pContainer =
NULL; }
242 subst(impl, pValue,
NULL,
NULL, pSubstitution,
false);
254 if (itReg != pRegMap->end())
256 runSubst(pPlace, itReg->second, pAct);
265 pMap[*(
const ProcTyp*)pValue].add(pPlace, pAct);
268 subst(impl, pValue, pPlace, pAct,
NULL,
false);
279 if (it != pRegMap->end())
285 if (it != pSubMap->end())
291 if (pRegMap) {
delete pRegMap; impl.
m_regs[nBytes].m_pContainer =
NULL; }
292 if (pSubMap) {
delete pSubMap; impl.
m_substs[nBytes].m_pContainer =
NULL; }
300 OdRxObjectSubstitutionActuator() { }
301 virtual void applySubstitution(
void *pPlace,
const void *pValue, SetPtrFunc pSetFunc)
307 } g_rxObjectActuator;
330 kOpenedForWrite = (1 << 0),
332 kLastFlag = kOpenedForWrite
373 , m_nCurSection(kEOFSection)
374 , m_nCurSectionSize(0)
443 #endif // __OdGsFilerV100Impl_H__
#define GETBIT(flags, bit)
bool operator<=(const OdString &s1, const OdString &s2)
virtual void skipSection() const
virtual void wrSectionEnd(Section section)
virtual void runSubstitutions(const void *pValue=NULL, OdUInt32 size=0, bool bClear=true)
virtual Section rdSection() const
virtual OdRxObjectPtr getArbitraryData(const OdChar *pName) const
OdGsFiler::SubstitutionActuator * m_pAct
static void clear(OdGsFiler_SubstitutorImpl &impl, const void *pValue)
virtual bool isPtrRegistered(const void *pPtr) const
void setWriting(bool bSet)
virtual void wrSectionBegin(Section section)
virtual void rdBackSection() const
virtual Substitutor * subst() const
virtual void wrDbHash(const OdDbBaseDatabase *pDb)
virtual OdUInt32 version() const
OdUInt32 m_nCurSectionSize
OdSmartPtr< OdGsFilerDbLinker > OdGsFilerDbLinkerPtr
std::map< OdUInt32, AbstractTyp > RegsMap
virtual void unregisterPtr(const void *pPtr)
virtual void applySubstitution(void *pPlace, const void *pValue, SetPtrFunc pSetFunc)
static int compare(const DataTyp &t1, const DataTyp &t2)
virtual void setReadSections(OdUInt64 nSections)
virtual void setVersion(OdUInt32 nVersion)
virtual bool isReadSection(Section section) const
virtual void setSubstitutor(OdRxObject *pSubst)
virtual void setReadSection(Section section, bool bSet)
virtual void clearRegisteredPtrs()
OdGsFiler::Section m_type
virtual ~OdGsFilerDbLinker()
static void subst(OdGsFiler_SubstitutorImpl &impl, const void *pValue, void *pPlace, OdGsFiler::SubstitutionActuator *pAct, const void *pSubstitution, bool bClear)
#define SETBIT(flags, bit, value)
OdStack< WrSectionData > m_sectionStack
virtual void wrHandle(OdDbStub *pHandle)
OdGsFilerDbLinkerPtr m_pLinker
std::map< ProcTyp, VoidArry > SubstMap
virtual void setArbitraryData(const OdChar *pName, OdRxObject *pObject)
OdUInt64 m_nSectionsToRead
virtual void rdRawData(void *pData, OdUInt32 nDataSize) const
virtual OdDbStub * handleToDbStub(OdUInt64 nHandle) const =0
std::map< OdString, OdRxObjectPtr > ArbDataMap
virtual OdStreamBufPtr getStream() const
virtual void clearSubstitutions(const void *pValue=NULL, OdUInt32 size=0)
virtual OdDbStub * rdHandle() const
WrSectionData(OdGsFiler::Section section, OdUInt32 tell)
virtual bool isWriteSection(Section section) const
virtual void wrEOFSection()
bool contains(void *pVoid)
virtual void makeSubstitutions(bool bClear=true) const
virtual bool checkDbHash(const OdDbBaseDatabase *pDb)
void add(void *pVoid, OdGsFiler::SubstitutionActuator *pAct)
std::map< ProcTyp, ProcTyp > RegMap
virtual void registerSubstitution(const void *pValue, const void *pSubstitution, OdUInt32 size=sizeof(OdIntPtr), bool bRegister=true, bool bImmediate=false)
bool DAI_EXPORT operator!=(const OdDAI::OdSelect &left, const OdDAI::OdSelect &right)
OdSmartPtr< OdGsFiler_SubstitutorImpl > m_subst
OdUInt32 headerTestChunk() const
virtual Section curSection() const
virtual OdDbBaseDatabase * getDatabase(OdDbStub *pStub) const =0
virtual void requestSubstitution(void *pPlace, const void *pValue, OdUInt32 size=sizeof(OdIntPtr), bool bRegister=true, bool bImmediate=true)
bool operator>(const OdString &s1, const OdString &s2)
virtual void clearArbitraryData()
virtual void wrRawData(const void *pData, OdUInt32 nDataSize)
bool operator>=(const OdString &s1, const OdString &s2)
static void runSubst(void *pPlace, const void *pSubstitution, OdGsFiler::SubstitutionActuator *pActuator)
~OdGsFiler_SubstitutorImpl()
virtual void requestSubstitution(OdBaseObjectPtr *pPlace, const void *pValue, bool bRegister=true, bool bImmediate=true)
static OdSmartPtr< TInterface > createObject()
bool operator<(const OdString &s1, const OdString &s2)
static OdGsFiler::SubstitutionActuator g_defActuator
virtual bool checkEOF() const
virtual void setWriteSection(Section section, bool bSet)
virtual void clearSubstitutions(const void *pValue=NULL, OdUInt32 size=0)=0
virtual void registerPtr(const void *pPtr)
virtual void setDatabase(const OdDbBaseDatabase *pDb)
virtual void requestSubstitution(void *pPlace, OdGsFiler::SubstitutionActuator *pActuator, const void *pValue, OdUInt32 size=sizeof(OdIntPtr), bool bRegister=true, bool bImmediate=true)
virtual void wrClass(OdRxObject *pObj)
static void req(OdGsFiler_SubstitutorImpl &impl, void *pPlace, OdGsFiler::SubstitutionActuator *pAct, const void *pValue, bool bRegister, bool bImmediate)
std::map< OdUInt32, AbstractTyp > SubstsMap
virtual OdUInt64 stubToDbHandle(OdDbStub *pStub) const =0
virtual OdBinaryData getDbHash(const OdDbBaseDatabase *pDb) const
#define GS_TOOLKIT_EXPORT
std::set< const void * > RegPtrsSet
virtual OdDbBaseDatabase * getDatabase() const
OdUInt64 m_nSectionsToWrite
bool DAI_EXPORT operator==(const OdFileDescriptionAuto &left, const OdFileDescriptionAuto &right)
virtual OdRxObjectPtr rdClass() const
virtual void setWriteSections(OdUInt64 nSections)
virtual OdDbBaseDatabase * getDatabase() const =0
static void reg(OdGsFiler_SubstitutorImpl &impl, const void *pValue, const void *pSubstitution, bool bRegister, bool bImmediate)
virtual bool setStream(OdStreamBuf *pStream, bool bWrite=false)
virtual OdRxObjectPtr getSubstitutor() const
OdGsFiler_SubstitutorImpl::DataTyp< nBytes > ProcTyp
virtual bool hasArbitraryData(const OdChar *pName) const
static void makeSubst(void *pPlace, const void *pSubstitution)