Changed: #1440 Constness

--HG--
branch : build_pipeline_v3
hg/feature/build_pipeline_v3
kaetemi 12 years ago
parent 6ee389a1cf
commit e9fcadb737

@ -56,7 +56,7 @@ const ucchar *CAnimatable::DisplayName = ucstring("Animatable").c_str();
const char *CAnimatable::InternalName = "Animatable"; const char *CAnimatable::InternalName = "Animatable";
const char *CAnimatable::InternalNameUnknown = "AnimatableUnknown"; const char *CAnimatable::InternalNameUnknown = "AnimatableUnknown";
const NLMISC::CClassId CAnimatable::ClassId = NLMISC::CClassId(0x3101497b, 0x24af711b); /* Not official, please correct */ const NLMISC::CClassId CAnimatable::ClassId = NLMISC::CClassId(0x3101497b, 0x24af711b); /* Not official, please correct */
const TSClassId CAnimatable::SuperClassId = 0x77a60fbd;/* Not official, please correct */ const TSClassId CAnimatable::SuperClassId = 0x77a60fbd; /* Not official, please correct */
const CAnimatableClassDesc AnimatableClassDesc(&DllPluginDescBuiltin); const CAnimatableClassDesc AnimatableClassDesc(&DllPluginDescBuiltin);
const CAnimatableSuperClassDesc AnimatableSuperClassDesc(&AnimatableClassDesc); const CAnimatableSuperClassDesc AnimatableSuperClassDesc(&AnimatableClassDesc);

@ -60,6 +60,10 @@ void CBuiltin::registerClasses(CSceneClassRegistry *registry)
{ {
registry->add(&AnimatableClassDesc); registry->add(&AnimatableClassDesc);
registry->add(&AnimatableSuperClassDesc); registry->add(&AnimatableSuperClassDesc);
registry->add(&ReferenceMakerClassDesc);
registry->add(&ReferenceMakerSuperClassDesc);
registry->add(&ReferenceTargetClassDesc);
registry->add(&ReferenceTargetSuperClassDesc);
} }
} /* namespace BUILTIN */ } /* namespace BUILTIN */

@ -52,6 +52,55 @@ CReferenceMaker::~CReferenceMaker()
} }
const ucchar *CReferenceMaker::DisplayName = ucstring("ReferenceMaker").c_str();
const char *CReferenceMaker::InternalName = "ReferenceMaker";
const char *CReferenceMaker::InternalNameUnknown = "ReferenceMakerUnknown";
const NLMISC::CClassId CReferenceMaker::ClassId = NLMISC::CClassId(0x2ec43d15, 0x10a270ad); /* Not official, please correct */
const TSClassId CReferenceMaker::SuperClassId = 0x00000100;
const CReferenceMakerClassDesc ReferenceMakerClassDesc(&DllPluginDescBuiltin);
const CReferenceMakerSuperClassDesc ReferenceMakerSuperClassDesc(&ReferenceMakerClassDesc);
void CReferenceMaker::parse(uint16 version, TParseLevel level)
{
CAnimatable::parse(version, level);
}
void CReferenceMaker::clean()
{
CAnimatable::clean();
}
void CReferenceMaker::build(uint16 version)
{
CAnimatable:build(version);
}
void CReferenceMaker::disown()
{
CAnimatable::disown();
}
void CReferenceMaker::init()
{
CAnimatable::init();
}
bool CReferenceMaker::inherits(const NLMISC::CClassId classId) const
{
if (classId == classDesc()->classId()) return true;
return CAnimatable::inherits(classId);
}
const ISceneClassDesc *CReferenceMaker::classDesc() const
{
return &ReferenceMakerClassDesc;
}
void CReferenceMaker::toStringLocal(std::ostream &ostream, const std::string &pad) const
{
CAnimatable::toStringLocal(ostream, pad);
}
} /* namespace BUILTIN */ } /* namespace BUILTIN */
} /* namespace MAX */ } /* namespace MAX */
} /* namespace PIPELINE */ } /* namespace PIPELINE */

@ -52,8 +52,30 @@ public:
CReferenceMaker(); CReferenceMaker();
virtual ~CReferenceMaker(); virtual ~CReferenceMaker();
// class desc
static const ucchar *DisplayName;
static const char *InternalName;
static const char *InternalNameUnknown;
static const NLMISC::CClassId ClassId;
static const TSClassId SuperClassId;
// inherited
virtual void parse(uint16 version, TParseLevel level);
virtual void clean();
virtual void build(uint16 version);
virtual void disown();
virtual void init();
virtual bool inherits(const NLMISC::CClassId classId) const;
virtual const ISceneClassDesc *classDesc() const;
virtual void toStringLocal(std::ostream &ostream, const std::string &pad = "") const;
}; /* class CReferenceMaker */ }; /* class CReferenceMaker */
typedef CSceneClassDesc<CReferenceMaker> CReferenceMakerClassDesc;
extern const CReferenceMakerClassDesc ReferenceMakerClassDesc;
typedef CSuperClassDesc<CReferenceMaker> CReferenceMakerSuperClassDesc;
extern const CReferenceMakerSuperClassDesc ReferenceMakerSuperClassDesc;
} /* namespace BUILTIN */ } /* namespace BUILTIN */
} /* namespace MAX */ } /* namespace MAX */
} /* namespace PIPELINE */ } /* namespace PIPELINE */

@ -52,6 +52,55 @@ CReferenceTarget::~CReferenceTarget()
} }
const ucchar *CReferenceTarget::DisplayName = ucstring("ReferenceTarget").c_str();
const char *CReferenceTarget::InternalName = "ReferenceTarget";
const char *CReferenceTarget::InternalNameUnknown = "ReferenceTargetUnknown";
const NLMISC::CClassId CReferenceTarget::ClassId = NLMISC::CClassId(0x5d545dd9, 0xa422e4); /* Not official, please correct */
const TSClassId CReferenceTarget::SuperClassId = 0x00000200;
const CReferenceTargetClassDesc ReferenceTargetClassDesc(&DllPluginDescBuiltin);
const CReferenceTargetSuperClassDesc ReferenceTargetSuperClassDesc(&ReferenceTargetClassDesc);
void CReferenceTarget::parse(uint16 version, TParseLevel level)
{
CReferenceMaker::parse(version, level);
}
void CReferenceTarget::clean()
{
CReferenceMaker::clean();
}
void CReferenceTarget::build(uint16 version)
{
CReferenceMaker:build(version);
}
void CReferenceTarget::disown()
{
CReferenceMaker::disown();
}
void CReferenceTarget::init()
{
CReferenceMaker::init();
}
bool CReferenceTarget::inherits(const NLMISC::CClassId classId) const
{
if (classId == classDesc()->classId()) return true;
return CReferenceMaker::inherits(classId);
}
const ISceneClassDesc *CReferenceTarget::classDesc() const
{
return &ReferenceTargetClassDesc;
}
void CReferenceTarget::toStringLocal(std::ostream &ostream, const std::string &pad) const
{
CReferenceMaker::toStringLocal(ostream, pad);
}
} /* namespace BUILTIN */ } /* namespace BUILTIN */
} /* namespace MAX */ } /* namespace MAX */
} /* namespace PIPELINE */ } /* namespace PIPELINE */

@ -52,8 +52,30 @@ public:
CReferenceTarget(); CReferenceTarget();
virtual ~CReferenceTarget(); virtual ~CReferenceTarget();
// class desc
static const ucchar *DisplayName;
static const char *InternalName;
static const char *InternalNameUnknown;
static const NLMISC::CClassId ClassId;
static const TSClassId SuperClassId;
// inherited
virtual void parse(uint16 version, TParseLevel level);
virtual void clean();
virtual void build(uint16 version);
virtual void disown();
virtual void init();
virtual bool inherits(const NLMISC::CClassId classId) const;
virtual const ISceneClassDesc *classDesc() const;
virtual void toStringLocal(std::ostream &ostream, const std::string &pad = "") const;
}; /* class CReferenceTarget */ }; /* class CReferenceTarget */
typedef CSceneClassDesc<CReferenceTarget> CReferenceTargetClassDesc;
extern const CReferenceTargetClassDesc ReferenceTargetClassDesc;
typedef CSuperClassDesc<CReferenceTarget> CReferenceTargetSuperClassDesc;
extern const CReferenceTargetSuperClassDesc ReferenceTargetSuperClassDesc;
} /* namespace BUILTIN */ } /* namespace BUILTIN */
} /* namespace MAX */ } /* namespace MAX */
} /* namespace PIPELINE */ } /* namespace PIPELINE */

@ -123,12 +123,12 @@ CAppData::~CAppData()
} }
std::string CAppData::getClassName() std::string CAppData::className() const
{ {
return "AppData"; return "AppData";
} }
void CAppData::toString(std::ostream &ostream, const std::string &pad) void CAppData::toString(std::ostream &ostream, const std::string &pad) const
{ {
if (m_ChunksOwnsPointers) if (m_ChunksOwnsPointers)
{ {
@ -136,10 +136,10 @@ void CAppData::toString(std::ostream &ostream, const std::string &pad)
} }
else else
{ {
ostream << "(" << getClassName() << ") [" << m_Entries.size() << "] PARSED { "; ostream << "(" << className() << ") [" << m_Entries.size() << "] PARSED { ";
std::string padpad = pad + "\t"; std::string padpad = pad + "\t";
uint subi = 0; uint subi = 0;
for (TMap::iterator subit = m_Entries.begin(), subend = m_Entries.end(); subit != subend; ++subit) for (TMap::const_iterator subit = m_Entries.begin(), subend = m_Entries.end(); subit != subend; ++subit)
{ {
ostream << "\n" << pad << "Entries[" << subi << "]: "; ostream << "\n" << pad << "Entries[" << subi << "]: ";
subit->second->toString(ostream, padpad); subit->second->toString(ostream, padpad);
@ -330,7 +330,7 @@ CAppDataEntryKey::~CAppDataEntryKey()
} }
std::string CAppDataEntryKey::getClassName() std::string CAppDataEntryKey::className() const
{ {
return "AppDataEntryKey"; return "AppDataEntryKey";
} }
@ -343,9 +343,9 @@ void CAppDataEntryKey::serial(NLMISC::IStream &stream)
stream.serial(Size); stream.serial(Size);
} }
void CAppDataEntryKey::toString(std::ostream &ostream, const std::string &pad) void CAppDataEntryKey::toString(std::ostream &ostream, const std::string &pad) const
{ {
ostream << "(" << getClassName() << ") { "; ostream << "(" << className() << ") { ";
ostream << "\n" << pad << "ClassId: " << NLMISC::toString(ClassId); ostream << "\n" << pad << "ClassId: " << NLMISC::toString(ClassId);
ostream << "\n" << pad << "SuperClassId: " << SuperClassId; ostream << "\n" << pad << "SuperClassId: " << SuperClassId;
ostream << "\n" << pad << "SubId: " << SubId; ostream << "\n" << pad << "SubId: " << SubId;
@ -367,16 +367,16 @@ CAppDataEntry::~CAppDataEntry()
} }
std::string CAppDataEntry::getClassName() std::string CAppDataEntry::className() const
{ {
return "AppDataEntry"; return "AppDataEntry";
} }
void CAppDataEntry::toString(std::ostream &ostream, const std::string &pad) void CAppDataEntry::toString(std::ostream &ostream, const std::string &pad) const
{ {
if (m_Key && m_Value) if (m_Key && m_Value)
{ {
ostream << "(" << getClassName() << ") [" << m_Chunks.size() << "] PARSED { "; ostream << "(" << className() << ") [" << m_Chunks.size() << "] PARSED { ";
std::string padpad = pad + "\t"; std::string padpad = pad + "\t";
ostream << "\n" << pad << "Key: "; ostream << "\n" << pad << "Key: ";
m_Key->toString(ostream, padpad); m_Key->toString(ostream, padpad);

@ -74,8 +74,8 @@ public:
virtual ~CAppData(); virtual ~CAppData();
// inherited // inherited
virtual std::string getClassName(); virtual std::string className() const;
virtual void toString(std::ostream &ostream, const std::string &pad = ""); virtual void toString(std::ostream &ostream, const std::string &pad = "") const;
virtual void parse(uint16 version, TParseLevel level); virtual void parse(uint16 version, TParseLevel level);
virtual void clean(); virtual void clean();
virtual void build(uint16 version); virtual void build(uint16 version);
@ -128,9 +128,9 @@ public:
uint32 Size; uint32 Size;
// inherited // inherited
virtual std::string getClassName(); virtual std::string className() const;
virtual void serial(NLMISC::IStream &stream); virtual void serial(NLMISC::IStream &stream);
virtual void toString(std::ostream &ostream, const std::string &pad = ""); virtual void toString(std::ostream &ostream, const std::string &pad = "") const;
}; /* class CAppDataEntryKey */ }; /* class CAppDataEntryKey */
@ -147,8 +147,8 @@ public:
virtual ~CAppDataEntry(); virtual ~CAppDataEntry();
// inherited // inherited
virtual std::string getClassName(); virtual std::string className() const;
virtual void toString(std::ostream &ostream, const std::string &pad = ""); virtual void toString(std::ostream &ostream, const std::string &pad = "") const;
virtual void parse(uint16 version, TParseLevel level); virtual void parse(uint16 version, TParseLevel level);
virtual void clean(); virtual void clean();
virtual void build(uint16 version); virtual void build(uint16 version);

@ -55,12 +55,12 @@ CClassData::~CClassData()
} }
std::string CClassData::getClassName() std::string CClassData::className() const
{ {
return "ClassData"; return "ClassData";
} }
void CClassData::toString(std::ostream &ostream, const std::string &pad) void CClassData::toString(std::ostream &ostream, const std::string &pad) const
{ {
CStorageContainer::toString(ostream, pad); CStorageContainer::toString(ostream, pad);
} }
@ -112,12 +112,12 @@ CClassDataEntry::~CClassDataEntry()
} }
std::string CClassDataEntry::getClassName() std::string CClassDataEntry::className() const
{ {
return "ClassDataEntry"; return "ClassDataEntry";
} }
void CClassDataEntry::toString(std::ostream &ostream, const std::string &pad) void CClassDataEntry::toString(std::ostream &ostream, const std::string &pad) const
{ {
CStorageContainer::toString(ostream, pad); CStorageContainer::toString(ostream, pad);
} }
@ -174,7 +174,7 @@ CClassDataHeader::~CClassDataHeader()
} }
std::string CClassDataHeader::getClassName() std::string CClassDataHeader::className() const
{ {
return "ClassDataHeader"; return "ClassDataHeader";
} }
@ -185,9 +185,9 @@ void CClassDataHeader::serial(NLMISC::IStream &stream)
stream.serial(SuperClassID); stream.serial(SuperClassID);
} }
void CClassDataHeader::toString(std::ostream &ostream, const std::string &pad) void CClassDataHeader::toString(std::ostream &ostream, const std::string &pad) const
{ {
ostream << "(" << getClassName() << ") { "; ostream << "(" << className() << ") { ";
ostream << "\n" << pad << "ClassID: " << NLMISC::toString(ClassID); ostream << "\n" << pad << "ClassID: " << NLMISC::toString(ClassID);
ostream << "\n" << pad << "SuperClassID: " << SuperClassID; ostream << "\n" << pad << "SuperClassID: " << SuperClassID;
ostream << " } "; ostream << " } ";

@ -54,8 +54,8 @@ public:
virtual ~CClassData(); virtual ~CClassData();
// inherited // inherited
virtual std::string getClassName(); virtual std::string className() const;
virtual void toString(std::ostream &ostream, const std::string &pad = ""); virtual void toString(std::ostream &ostream, const std::string &pad = "") const;
virtual void parse(uint16 version, TParseLevel level); virtual void parse(uint16 version, TParseLevel level);
virtual void clean(); virtual void clean();
virtual void build(uint16 version); virtual void build(uint16 version);
@ -79,8 +79,8 @@ public:
virtual ~CClassDataEntry(); virtual ~CClassDataEntry();
// inherited // inherited
virtual std::string getClassName(); virtual std::string className() const;
virtual void toString(std::ostream &ostream, const std::string &pad = ""); virtual void toString(std::ostream &ostream, const std::string &pad = "") const;
virtual void parse(uint16 version, TParseLevel level); virtual void parse(uint16 version, TParseLevel level);
virtual void clean(); virtual void clean();
virtual void build(uint16 version); virtual void build(uint16 version);
@ -108,9 +108,9 @@ public:
uint32 SuperClassID; uint32 SuperClassID;
// inherited // inherited
virtual std::string getClassName(); virtual std::string className() const;
virtual void serial(NLMISC::IStream &stream); virtual void serial(NLMISC::IStream &stream);
virtual void toString(std::ostream &ostream, const std::string &pad = ""); virtual void toString(std::ostream &ostream, const std::string &pad = "") const;
}; /* class CClassDataHeader */ }; /* class CClassDataHeader */

@ -72,13 +72,13 @@ CClassDirectory3::~CClassDirectory3()
m_ClassIdToIndex.clear(); m_ClassIdToIndex.clear();
} }
std::string CClassDirectory3::getClassName() std::string CClassDirectory3::className() const
{ {
return "ClassDirectory3"; return "ClassDirectory3";
} }
// Parallel to CDllDirectory // Parallel to CDllDirectory
void CClassDirectory3::toString(std::ostream &ostream, const std::string &pad) void CClassDirectory3::toString(std::ostream &ostream, const std::string &pad) const
{ {
if (m_ChunksOwnsPointers) if (m_ChunksOwnsPointers)
{ {
@ -86,7 +86,7 @@ void CClassDirectory3::toString(std::ostream &ostream, const std::string &pad)
} }
else else
{ {
ostream << "(" << getClassName() << ") [" << m_Chunks.size() << "] PARSED { "; ostream << "(" << className() << ") [" << m_Chunks.size() << "] PARSED { ";
std::string padpad = pad + "\t"; std::string padpad = pad + "\t";
sint i = 0; sint i = 0;
for (TStorageObjectContainer::const_iterator it = m_ChunkCache.begin(), end = m_ChunkCache.end(); it != end; ++it) for (TStorageObjectContainer::const_iterator it = m_ChunkCache.begin(), end = m_ChunkCache.end(); it != end; ++it)
@ -97,7 +97,7 @@ void CClassDirectory3::toString(std::ostream &ostream, const std::string &pad)
case 0x2040: // ClassEntry case 0x2040: // ClassEntry
{ {
uint subi = 0; uint subi = 0;
for (std::vector<CClassEntry *>::iterator subit = m_Entries.begin(), subend = m_Entries.end(); subit != subend; ++subit) for (std::vector<CClassEntry *>::const_iterator subit = m_Entries.begin(), subend = m_Entries.end(); subit != subend; ++subit)
{ {
ostream << "\n" << pad << "Entries[" << subi << "]: "; ostream << "\n" << pad << "Entries[" << subi << "]: ";
(*subit)->toString(ostream, padpad); (*subit)->toString(ostream, padpad);
@ -315,16 +315,16 @@ CClassEntry::~CClassEntry()
} }
std::string CClassEntry::getClassName() std::string CClassEntry::className() const
{ {
return "ClassEntry"; return "ClassEntry";
} }
void CClassEntry::toString(std::ostream &ostream, const std::string &pad) void CClassEntry::toString(std::ostream &ostream, const std::string &pad) const
{ {
if (m_Header && m_Name) if (m_Header && m_Name)
{ {
ostream << "(" << getClassName() << ") [" << m_Chunks.size() << "] PARSED { "; ostream << "(" << className() << ") [" << m_Chunks.size() << "] PARSED { ";
std::string padpad = pad + "\t"; std::string padpad = pad + "\t";
ostream << "\n" << pad << "Header: "; ostream << "\n" << pad << "Header: ";
m_Header->toString(ostream, padpad); m_Header->toString(ostream, padpad);
@ -400,7 +400,7 @@ CClassEntryHeader::~CClassEntryHeader()
} }
std::string CClassEntryHeader::getClassName() std::string CClassEntryHeader::className() const
{ {
return "ClassEntryHeader"; return "ClassEntryHeader";
} }
@ -412,9 +412,9 @@ void CClassEntryHeader::serial(NLMISC::IStream &stream)
stream.serial(SuperClassId); stream.serial(SuperClassId);
} }
void CClassEntryHeader::toString(std::ostream &ostream, const std::string &pad) void CClassEntryHeader::toString(std::ostream &ostream, const std::string &pad) const
{ {
ostream << "(" << getClassName() << ") { "; ostream << "(" << className() << ") { ";
ostream << "\n" << pad << "DllIndex: " << DllIndex; ostream << "\n" << pad << "DllIndex: " << DllIndex;
ostream << "\n" << pad << "ClassId: " << NLMISC::toString(ClassId); ostream << "\n" << pad << "ClassId: " << NLMISC::toString(ClassId);
ostream << "\n" << pad << "SuperClassId: " << SuperClassId; ostream << "\n" << pad << "SuperClassId: " << SuperClassId;

@ -64,8 +64,8 @@ public:
virtual ~CClassDirectory3(); virtual ~CClassDirectory3();
// inherited // inherited
virtual std::string getClassName(); virtual std::string className() const;
virtual void toString(std::ostream &ostream, const std::string &pad = ""); virtual void toString(std::ostream &ostream, const std::string &pad = "") const;
virtual void parse(uint16 version, TParseLevel level); virtual void parse(uint16 version, TParseLevel level);
virtual void clean(); virtual void clean();
virtual void build(uint16 version); virtual void build(uint16 version);
@ -109,9 +109,9 @@ public:
uint32 SuperClassId; uint32 SuperClassId;
// inherited // inherited
virtual std::string getClassName(); virtual std::string className() const;
virtual void serial(NLMISC::IStream &stream); virtual void serial(NLMISC::IStream &stream);
virtual void toString(std::ostream &ostream, const std::string &pad = ""); virtual void toString(std::ostream &ostream, const std::string &pad = "") const;
}; /* class CClassEntryHeader */ }; /* class CClassEntryHeader */
@ -129,8 +129,8 @@ public:
virtual ~CClassEntry(); virtual ~CClassEntry();
// inherited // inherited
virtual std::string getClassName(); virtual std::string className() const;
virtual void toString(std::ostream &ostream, const std::string &pad = ""); virtual void toString(std::ostream &ostream, const std::string &pad = "") const;
virtual void parse(uint16 version, TParseLevel level); virtual void parse(uint16 version, TParseLevel level);
virtual void clean(); virtual void clean();
virtual void build(uint16 version); virtual void build(uint16 version);

@ -56,12 +56,12 @@ CConfig::~CConfig()
} }
std::string CConfig::getClassName() std::string CConfig::className() const
{ {
return "Config"; return "Config";
} }
void CConfig::toString(std::ostream &ostream, const std::string &pad) void CConfig::toString(std::ostream &ostream, const std::string &pad) const
{ {
CStorageContainer::toString(ostream, pad); CStorageContainer::toString(ostream, pad);
} }
@ -123,12 +123,12 @@ CConfig20a0::~CConfig20a0()
} }
std::string CConfig20a0::getClassName() std::string CConfig20a0::className() const
{ {
return "Config20a0"; return "Config20a0";
} }
void CConfig20a0::toString(std::ostream &ostream, const std::string &pad) void CConfig20a0::toString(std::ostream &ostream, const std::string &pad) const
{ {
CStorageContainer::toString(ostream, pad); CStorageContainer::toString(ostream, pad);
} }
@ -188,12 +188,12 @@ CConfig20a0Entry::~CConfig20a0Entry()
} }
std::string CConfig20a0Entry::getClassName() std::string CConfig20a0Entry::className() const
{ {
return "Config20a0Entry"; return "Config20a0Entry";
} }
void CConfig20a0Entry::toString(std::ostream &ostream, const std::string &pad) void CConfig20a0Entry::toString(std::ostream &ostream, const std::string &pad) const
{ {
CStorageContainer::toString(ostream, pad); CStorageContainer::toString(ostream, pad);
} }
@ -280,12 +280,12 @@ CConfigScript::~CConfigScript()
} }
std::string CConfigScript::getClassName() std::string CConfigScript::className() const
{ {
return "ConfigScript"; return "ConfigScript";
} }
void CConfigScript::toString(std::ostream &ostream, const std::string &pad) void CConfigScript::toString(std::ostream &ostream, const std::string &pad) const
{ {
CStorageContainer::toString(ostream, pad); CStorageContainer::toString(ostream, pad);
} }
@ -337,12 +337,12 @@ CConfigScriptEntry::~CConfigScriptEntry()
} }
std::string CConfigScriptEntry::getClassName() std::string CConfigScriptEntry::className() const
{ {
return "ConfigScriptEntry"; return "ConfigScriptEntry";
} }
void CConfigScriptEntry::toString(std::ostream &ostream, const std::string &pad) void CConfigScriptEntry::toString(std::ostream &ostream, const std::string &pad) const
{ {
CStorageContainer::toString(ostream, pad); CStorageContainer::toString(ostream, pad);
} }
@ -402,7 +402,7 @@ CConfigScriptHeader::~CConfigScriptHeader()
} }
std::string CConfigScriptHeader::getClassName() std::string CConfigScriptHeader::className() const
{ {
return "ConfigScriptHeader"; return "ConfigScriptHeader";
} }
@ -413,9 +413,9 @@ void CConfigScriptHeader::serial(NLMISC::IStream &stream)
stream.serial(ClassID); stream.serial(ClassID);
} }
void CConfigScriptHeader::toString(std::ostream &ostream, const std::string &pad) void CConfigScriptHeader::toString(std::ostream &ostream, const std::string &pad) const
{ {
ostream << "(" << getClassName() << ") { "; ostream << "(" << className() << ") { ";
ostream << "\n" << pad << "SuperClassID: " << SuperClassID; ostream << "\n" << pad << "SuperClassID: " << SuperClassID;
ostream << "\n" << pad << "ClassID: " << NLMISC::toString(ClassID); ostream << "\n" << pad << "ClassID: " << NLMISC::toString(ClassID);
ostream << " } "; ostream << " } ";
@ -435,12 +435,12 @@ CConfigScriptMetaContainer::~CConfigScriptMetaContainer()
} }
std::string CConfigScriptMetaContainer::getClassName() std::string CConfigScriptMetaContainer::className() const
{ {
return "ConfigScriptMetaContainer"; return "ConfigScriptMetaContainer";
} }
void CConfigScriptMetaContainer::toString(std::ostream &ostream, const std::string &pad) void CConfigScriptMetaContainer::toString(std::ostream &ostream, const std::string &pad) const
{ {
CStorageContainer::toString(ostream, pad); CStorageContainer::toString(ostream, pad);
} }
@ -514,7 +514,7 @@ CConfigScriptMetaString::~CConfigScriptMetaString()
} }
std::string CConfigScriptMetaString::getClassName() std::string CConfigScriptMetaString::className() const
{ {
return "ConfigScriptMetaString"; return "ConfigScriptMetaString";
} }
@ -538,9 +538,9 @@ void CConfigScriptMetaString::serial(NLMISC::IStream &stream)
nlassert(endByte == 0); nlassert(endByte == 0);
} }
void CConfigScriptMetaString::toString(std::ostream &ostream, const std::string &pad) void CConfigScriptMetaString::toString(std::ostream &ostream, const std::string &pad) const
{ {
ostream << "(" << getClassName() << ") { " << Value << " } "; ostream << "(" << className() << ") { " << Value << " } ";
} }
//////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////

@ -54,8 +54,8 @@ public:
virtual ~CConfig(); virtual ~CConfig();
// inherited // inherited
virtual std::string getClassName(); virtual std::string className() const;
virtual void toString(std::ostream &ostream, const std::string &pad = ""); virtual void toString(std::ostream &ostream, const std::string &pad = "") const;
virtual void parse(uint16 version, TParseLevel level); virtual void parse(uint16 version, TParseLevel level);
virtual void clean(); virtual void clean();
virtual void build(uint16 version); virtual void build(uint16 version);
@ -79,8 +79,8 @@ public:
virtual ~CConfig20a0(); virtual ~CConfig20a0();
// inherited // inherited
virtual std::string getClassName(); virtual std::string className() const;
virtual void toString(std::ostream &ostream, const std::string &pad = ""); virtual void toString(std::ostream &ostream, const std::string &pad = "") const;
virtual void parse(uint16 version, TParseLevel level); virtual void parse(uint16 version, TParseLevel level);
virtual void clean(); virtual void clean();
virtual void build(uint16 version); virtual void build(uint16 version);
@ -104,8 +104,8 @@ public:
virtual ~CConfig20a0Entry(); virtual ~CConfig20a0Entry();
// inherited // inherited
virtual std::string getClassName(); virtual std::string className() const;
virtual void toString(std::ostream &ostream, const std::string &pad = ""); virtual void toString(std::ostream &ostream, const std::string &pad = "") const;
virtual void parse(uint16 version, TParseLevel level); virtual void parse(uint16 version, TParseLevel level);
virtual void clean(); virtual void clean();
virtual void build(uint16 version); virtual void build(uint16 version);
@ -129,8 +129,8 @@ public:
virtual ~CConfigScript(); virtual ~CConfigScript();
// inherited // inherited
virtual std::string getClassName(); virtual std::string className() const;
virtual void toString(std::ostream &ostream, const std::string &pad = ""); virtual void toString(std::ostream &ostream, const std::string &pad = "") const;
virtual void parse(uint16 version, TParseLevel level); virtual void parse(uint16 version, TParseLevel level);
virtual void clean(); virtual void clean();
virtual void build(uint16 version); virtual void build(uint16 version);
@ -154,8 +154,8 @@ public:
virtual ~CConfigScriptEntry(); virtual ~CConfigScriptEntry();
// inherited // inherited
virtual std::string getClassName(); virtual std::string className() const;
virtual void toString(std::ostream &ostream, const std::string &pad = ""); virtual void toString(std::ostream &ostream, const std::string &pad = "") const;
virtual void parse(uint16 version, TParseLevel level); virtual void parse(uint16 version, TParseLevel level);
virtual void clean(); virtual void clean();
virtual void build(uint16 version); virtual void build(uint16 version);
@ -183,9 +183,9 @@ public:
NLMISC::CClassId ClassID; NLMISC::CClassId ClassID;
// inherited // inherited
virtual std::string getClassName(); virtual std::string className() const;
virtual void serial(NLMISC::IStream &stream); virtual void serial(NLMISC::IStream &stream);
virtual void toString(std::ostream &ostream, const std::string &pad = ""); virtual void toString(std::ostream &ostream, const std::string &pad = "") const;
}; /* class CConfigScriptHeader */ }; /* class CConfigScriptHeader */
@ -203,8 +203,8 @@ public:
virtual ~CConfigScriptMetaContainer(); virtual ~CConfigScriptMetaContainer();
// inherited // inherited
virtual std::string getClassName(); virtual std::string className() const;
virtual void toString(std::ostream &ostream, const std::string &pad = ""); virtual void toString(std::ostream &ostream, const std::string &pad = "") const;
virtual void parse(uint16 version, TParseLevel level); virtual void parse(uint16 version, TParseLevel level);
virtual void clean(); virtual void clean();
virtual void build(uint16 version); virtual void build(uint16 version);
@ -231,9 +231,9 @@ public:
std::string Value; std::string Value;
// inherited // inherited
virtual std::string getClassName(); virtual std::string className() const;
virtual void serial(NLMISC::IStream &stream); virtual void serial(NLMISC::IStream &stream);
virtual void toString(std::ostream &ostream, const std::string &pad = ""); virtual void toString(std::ostream &ostream, const std::string &pad = "") const;
}; /* class CConfigScriptMetaString */ }; /* class CConfigScriptMetaString */

@ -70,13 +70,13 @@ CDllDirectory::~CDllDirectory()
m_Entries.clear(); m_Entries.clear();
} }
std::string CDllDirectory::getClassName() std::string CDllDirectory::className() const
{ {
return "DllDirectory"; return "DllDirectory";
} }
// Parallel to CClassDirectory3 // Parallel to CClassDirectory3
void CDllDirectory::toString(std::ostream &ostream, const std::string &pad) void CDllDirectory::toString(std::ostream &ostream, const std::string &pad) const
{ {
if (m_ChunksOwnsPointers) if (m_ChunksOwnsPointers)
{ {
@ -84,7 +84,7 @@ void CDllDirectory::toString(std::ostream &ostream, const std::string &pad)
} }
else else
{ {
ostream << "(" << getClassName() << ") [" << m_Chunks.size() << "] PARSED { "; ostream << "(" << className() << ") [" << m_Chunks.size() << "] PARSED { ";
std::string padpad = pad + "\t"; std::string padpad = pad + "\t";
sint i = 0; sint i = 0;
for (TStorageObjectContainer::const_iterator it = m_ChunkCache.begin(), end = m_ChunkCache.end(); it != end; ++it) for (TStorageObjectContainer::const_iterator it = m_ChunkCache.begin(), end = m_ChunkCache.end(); it != end; ++it)
@ -95,7 +95,7 @@ void CDllDirectory::toString(std::ostream &ostream, const std::string &pad)
case 0x2038: // DllEntry case 0x2038: // DllEntry
{ {
uint subi = 0; uint subi = 0;
for (std::vector<CDllEntry *>::iterator subit = m_Entries.begin(), subend = m_Entries.end(); subit != subend; ++subit) for (std::vector<CDllEntry *>::const_iterator subit = m_Entries.begin(), subend = m_Entries.end(); subit != subend; ++subit)
{ {
ostream << "\n" << pad << "Entries[" << subi << "]: "; ostream << "\n" << pad << "Entries[" << subi << "]: ";
(*subit)->toString(ostream, padpad); (*subit)->toString(ostream, padpad);
@ -342,16 +342,16 @@ CDllEntry::~CDllEntry()
} }
std::string CDllEntry::getClassName() std::string CDllEntry::className() const
{ {
return "DllEntry"; return "DllEntry";
} }
void CDllEntry::toString(std::ostream &ostream, const std::string &pad) void CDllEntry::toString(std::ostream &ostream, const std::string &pad) const
{ {
if (m_DllDescription && m_DllFilename) if (m_DllDescription && m_DllFilename)
{ {
ostream << "(" << getClassName() << ") [" << m_Chunks.size() << "] PARSED { "; ostream << "(" << className() << ") [" << m_Chunks.size() << "] PARSED { ";
std::string padpad = pad + "\t"; std::string padpad = pad + "\t";
ostream << "\n" << pad << "DllDescription: " << m_DllDescription->Value.toUtf8(); ostream << "\n" << pad << "DllDescription: " << m_DllDescription->Value.toUtf8();
ostream << "\n" << pad << "DllFilename: " << m_DllFilename->Value.toUtf8(); ostream << "\n" << pad << "DllFilename: " << m_DllFilename->Value.toUtf8();

@ -55,8 +55,8 @@ public:
virtual ~CDllEntry(); virtual ~CDllEntry();
// inherited // inherited
virtual std::string getClassName(); virtual std::string className() const;
virtual void toString(std::ostream &ostream, const std::string &pad = ""); virtual void toString(std::ostream &ostream, const std::string &pad = "") const;
virtual void parse(uint16 version, TParseLevel level); virtual void parse(uint16 version, TParseLevel level);
virtual void clean(); virtual void clean();
virtual void build(uint16 version); virtual void build(uint16 version);
@ -92,8 +92,8 @@ public:
virtual ~CDllDirectory(); virtual ~CDllDirectory();
// inherited // inherited
virtual std::string getClassName(); virtual std::string className() const;
virtual void toString(std::ostream &ostream, const std::string &pad = ""); virtual void toString(std::ostream &ostream, const std::string &pad = "") const;
virtual void parse(uint16 version, TParseLevel level); virtual void parse(uint16 version, TParseLevel level);
virtual void clean(); virtual void clean();
virtual void build(uint16 version); virtual void build(uint16 version);

@ -29,6 +29,7 @@
#include "scene.h" #include "scene.h"
// STL includes // STL includes
#include <iostream>
// NeL includes // NeL includes
// #include <nel/misc/debug.h> // #include <nel/misc/debug.h>
@ -60,12 +61,12 @@ CScene::~CScene()
} }
std::string CScene::getClassName() std::string CScene::className() const
{ {
return "Scene"; return "Scene";
} }
void CScene::toString(std::ostream &ostream, const std::string &pad) void CScene::toString(std::ostream &ostream, const std::string &pad) const
{ {
CStorageContainer::toString(ostream, pad); CStorageContainer::toString(ostream, pad);
} }
@ -128,12 +129,12 @@ CSceneClassContainer::~CSceneClassContainer()
} }
std::string CSceneClassContainer::getClassName() std::string CSceneClassContainer::className() const
{ {
return "SceneClassContainer"; return "SceneClassContainer";
} }
void CSceneClassContainer::toString(std::ostream &ostream, const std::string &pad) void CSceneClassContainer::toString(std::ostream &ostream, const std::string &pad) const
{ {
CStorageContainer::toString(ostream, pad); CStorageContainer::toString(ostream, pad);
} }
@ -177,11 +178,19 @@ IStorageObject *CSceneClassContainer::createChunkById(uint16 id, bool container)
} }
else else
{ {
// Create an unknown scene class; TODO: By TSClassId, maybe the registry should have a createUnknown(TSuperClassId)
// const NLMISC::CClassId classId, const TSClassId superClassId, const ucstring &displayName, const std::strin &internalName, const ucstring &dllFilename, const ucstring &dllDescription
const CDllEntry *dllEntry = m_DllDirectory->get(classEntry->dllIndex()); const CDllEntry *dllEntry = m_DllDirectory->get(classEntry->dllIndex());
classEntry->toString(std::cout, "");
sceneClass = m_SceneClassRegistry->createUnknown(classEntry->classId(), classEntry->superClassId(), classEntry->displayName(), dllEntry->dllFilename(), dllEntry->dllDescription());
if (sceneClass)
{
return static_cast<IStorageObject *>(sceneClass);
}
else
{
// Create an invalid unknown scene class
return static_cast<IStorageObject *>(new CSceneClassUnknown<CSceneClass>(classEntry->classId(), classEntry->superClassId(), classEntry->displayName(), "SceneClassUnknown", dllEntry->dllFilename(), dllEntry->dllDescription())); return static_cast<IStorageObject *>(new CSceneClassUnknown<CSceneClass>(classEntry->classId(), classEntry->superClassId(), classEntry->displayName(), "SceneClassUnknown", dllEntry->dllFilename(), dllEntry->dllDescription()));
} }
}
} }
//////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////

@ -63,8 +63,8 @@ public:
virtual ~CScene(); virtual ~CScene();
// inherited // inherited
virtual std::string getClassName(); virtual std::string className() const;
virtual void toString(std::ostream &ostream, const std::string &pad = ""); virtual void toString(std::ostream &ostream, const std::string &pad = "") const;
virtual void parse(uint16 version, TParseLevel level); virtual void parse(uint16 version, TParseLevel level);
virtual void clean(); virtual void clean();
virtual void build(uint16 version); virtual void build(uint16 version);
@ -97,8 +97,8 @@ public:
virtual ~CSceneClassContainer(); virtual ~CSceneClassContainer();
// inherited // inherited
virtual std::string getClassName(); virtual std::string className() const;
virtual void toString(std::ostream &ostream, const std::string &pad = ""); virtual void toString(std::ostream &ostream, const std::string &pad = "") const;
virtual void parse(uint16 version, TParseLevel level); virtual void parse(uint16 version, TParseLevel level);
virtual void clean(); virtual void clean();
virtual void build(uint16 version); virtual void build(uint16 version);

@ -74,12 +74,12 @@ CSceneClass::~CSceneClass()
} }
std::string CSceneClass::getClassName() std::string CSceneClass::className() const
{ {
return classDesc()->internalName(); return classDesc()->internalName();
} }
void CSceneClass::toString(std::ostream &ostream, const std::string &pad) void CSceneClass::toString(std::ostream &ostream, const std::string &pad) const
{ {
if (m_ChunksOwnsPointers) if (m_ChunksOwnsPointers)
{ {
@ -87,7 +87,7 @@ void CSceneClass::toString(std::ostream &ostream, const std::string &pad)
} }
else else
{ {
ostream << "(" << getClassName() << ": " << ucstring(classDesc()->displayName()).toUtf8() << ", " << classDesc()->classId().toString() << ", " << ucstring(classDesc()->dllPluginDesc()->internalName()).toUtf8() << ") [" << m_Chunks.size() << "] { "; ostream << "(" << className() << ": " << ucstring(classDesc()->displayName()).toUtf8() << ", " << classDesc()->classId().toString() << ", " << ucstring(classDesc()->dllPluginDesc()->internalName()).toUtf8() << ") [" << m_Chunks.size() << "] { ";
toStringLocal(ostream, pad); toStringLocal(ostream, pad);
ostream << "} "; ostream << "} ";
} }

@ -59,8 +59,8 @@ public:
//! \name Inherited functions that are implemented by wrapping around other virtual functions in this class //! \name Inherited functions that are implemented by wrapping around other virtual functions in this class
//@{ //@{
virtual std::string getClassName(); // do not override, implemented using classDesc virtual std::string className() const; // do not override, implemented using classDesc
virtual void toString(std::ostream &ostream, const std::string &pad = ""); // do not override, implemented using toStringLocal virtual void toString(std::ostream &ostream, const std::string &pad = "") const; // do not override, implemented using toStringLocal
//@} //@}
//! \name Inherited functions called through the storage loading and saving system //! \name Inherited functions called through the storage loading and saving system

@ -41,6 +41,22 @@ using namespace std;
namespace PIPELINE { namespace PIPELINE {
namespace MAX { namespace MAX {
////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////
// Elevate warnings to errors in this file for stricter reading
#undef nlwarning
#define nlwarning nlerror
// Elevate debug to error in this file for debugging
// #undef nldebug
// #define nldebug nlerror
////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////
CSceneClassRegistry::CSceneClassRegistry() CSceneClassRegistry::CSceneClassRegistry()
{ {
@ -66,7 +82,7 @@ void CSceneClassRegistry::remove(const NLMISC::CClassId classId)
/// Add a superclass to the registry /// Add a superclass to the registry
void CSceneClassRegistry::add(const ISuperClassDesc *desc) void CSceneClassRegistry::add(const ISuperClassDesc *desc)
{ {
if (m_SuperClassDescriptions.find(desc->classDesc()->superClassId()) == m_SuperClassDescriptions.end()) { nlerror("Already added this superclass to the registry"); return; } if (m_SuperClassDescriptions.find(desc->classDesc()->superClassId()) != m_SuperClassDescriptions.end()) { nlerror("Already added this superclass to the registry"); return; }
m_SuperClassDescriptions[desc->classDesc()->superClassId()] = desc; m_SuperClassDescriptions[desc->classDesc()->superClassId()] = desc;
} }
@ -80,14 +96,14 @@ void CSceneClassRegistry::remove(const TSClassId superClassId)
/// Create a class by class id /// Create a class by class id
CSceneClass *CSceneClassRegistry::create(const NLMISC::CClassId classId) const CSceneClass *CSceneClassRegistry::create(const NLMISC::CClassId classId) const
{ {
if (m_ClassDescriptions.find(classId) == m_ClassDescriptions.end()) { nldebug("Try to create class that does not exist"); return NULL; } if (m_ClassDescriptions.find(classId) == m_ClassDescriptions.end()) { /* nldebug("Try to create class that does not exist"); */ return NULL; }
return m_ClassDescriptions.find(classId)->second->create(); return m_ClassDescriptions.find(classId)->second->create();
} }
/// Create an unknown class by superclass id /// Create an unknown class by superclass id
CSceneClass *CSceneClassRegistry::createUnknown(const TSClassId superClassId, const NLMISC::CClassId classId, const ucstring &displayName, const ucstring &dllFilename, const ucstring &dllDescription) const CSceneClass *CSceneClassRegistry::createUnknown(const TSClassId superClassId, const NLMISC::CClassId classId, const ucstring &displayName, const ucstring &dllFilename, const ucstring &dllDescription) const
{ {
if (m_ClassDescriptions.find(classId) == m_ClassDescriptions.end()) { nlwarning("Creating superclass that does not exist"); return NULL; } if (m_ClassDescriptions.find(classId) == m_ClassDescriptions.end()) { nlwarning("Creating superclass 0x%x (%s) that does not exist", superClassId, displayName.toUtf8().c_str()); return NULL; }
return m_SuperClassDescriptions.find(classId)->second->createUnknown(classId, displayName, dllFilename, dllDescription);; return m_SuperClassDescriptions.find(classId)->second->createUnknown(classId, displayName, dllFilename, dllDescription);;
} }
@ -104,6 +120,10 @@ const ISceneClassDesc *CSceneClassRegistry::describe(const NLMISC::CClassId clas
return m_ClassDescriptions.find(classId)->second; return m_ClassDescriptions.find(classId)->second;
} }
////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////
} /* namespace MAX */ } /* namespace MAX */
} /* namespace PIPELINE */ } /* namespace PIPELINE */

@ -103,7 +103,7 @@ CStorageContainer::~CStorageContainer()
m_Chunks.clear(); m_Chunks.clear();
} }
std::string CStorageContainer::getClassName() // why is this not const in IClassable? std::string CStorageContainer::className() const // why is this not const in IClassable?
{ {
return "StorageContainer"; return "StorageContainer";
} }
@ -171,7 +171,7 @@ void CStorageContainer::serial(NLMISC::IStream &stream)
} }
} }
void CStorageContainer::toString(std::ostream &ostream, const std::string &pad) void CStorageContainer::toString(std::ostream &ostream, const std::string &pad) const
{ {
// note: only use pad when multi-lining // note: only use pad when multi-lining
// like Blah: (Something) "SingleValue" // like Blah: (Something) "SingleValue"
@ -179,7 +179,7 @@ void CStorageContainer::toString(std::ostream &ostream, const std::string &pad)
// Moo: (Foo) "What" } // Moo: (Foo) "What" }
// only increase pad when multi-lining sub-items // only increase pad when multi-lining sub-items
nlassert(m_ChunksOwnsPointers); nlassert(m_ChunksOwnsPointers);
ostream << "(" << getClassName() << ") [" << m_Chunks.size() << "] { "; ostream << "(" << className() << ") [" << m_Chunks.size() << "] { ";
std::string padpad = pad + "\t"; std::string padpad = pad + "\t";
sint i = 0; sint i = 0;
for (TStorageObjectContainer::const_iterator it = m_Chunks.begin(), end = m_Chunks.end(); it != end; ++it) for (TStorageObjectContainer::const_iterator it = m_Chunks.begin(), end = m_Chunks.end(); it != end; ++it)
@ -313,7 +313,7 @@ CStorageRaw::~CStorageRaw()
} }
std::string CStorageRaw::getClassName() std::string CStorageRaw::className() const
{ {
return "StorageRaw"; return "StorageRaw";
} }
@ -323,14 +323,14 @@ void CStorageRaw::serial(NLMISC::IStream &stream)
stream.serialBuffer(&Value[0], Value.size()); stream.serialBuffer(&Value[0], Value.size());
} }
void CStorageRaw::toString(std::ostream &ostream, const std::string &pad) void CStorageRaw::toString(std::ostream &ostream, const std::string &pad) const
{ {
// note: only use pad when multi-lining // note: only use pad when multi-lining
// like Blah: (Something) "SingleValue" // like Blah: (Something) "SingleValue"
// Blahblah: (Container) { // Blahblah: (Container) {
// Moo: (Foo) "What" } // Moo: (Foo) "What" }
// only increase pad when multi-lining sub-items // only increase pad when multi-lining sub-items
ostream << "(" << getClassName() << ") { "; ostream << "(" << className() << ") { ";
ostream << "\n" << pad << "Size: " << Value.size(); ostream << "\n" << pad << "Size: " << Value.size();
bool isString = true; bool isString = true;
ostream << "\n" << pad << "String: "; ostream << "\n" << pad << "String: ";

@ -70,10 +70,11 @@ public:
IStorageObject(); IStorageObject();
virtual ~IStorageObject(); virtual ~IStorageObject();
// virtual std::string getClassName() = 0; // inherited from NLMISC::IClassable through NLMISC::IStreamable virtual std::string getClassName() { return className(); } // inherited from NLMISC::IClassable through NLMISC::IStreamable
virtual std::string className() const = 0; // renamed for constness
// virtual void serial(NLMISC::IStream &stream); // inherited from NLMISC::IStreamable // virtual void serial(NLMISC::IStream &stream); // inherited from NLMISC::IStreamable
std::string toString(); std::string toString();
virtual void toString(std::ostream &ostream, const std::string &pad = "") = 0; virtual void toString(std::ostream &ostream, const std::string &pad = "") const = 0;
public: // should be protected but that doesn't compile, nice c++! public: // should be protected but that doesn't compile, nice c++!
// Sets size when reading // Sets size when reading
@ -104,9 +105,9 @@ public:
virtual ~CStorageContainer(); virtual ~CStorageContainer();
// inherited // inherited
virtual std::string getClassName(); virtual std::string className() const;
virtual void serial(NLMISC::IStream &stream); // only used to wrap a container inside another stream virtual void serial(NLMISC::IStream &stream); // only used to wrap a container inside another stream
virtual void toString(std::ostream &ostream, const std::string &pad = ""); virtual void toString(std::ostream &ostream, const std::string &pad = "") const;
// virtual // virtual
// Parse this class with given version and parse level filter // Parse this class with given version and parse level filter
@ -147,9 +148,9 @@ public:
virtual ~CStorageRaw(); virtual ~CStorageRaw();
// inherited // inherited
virtual std::string getClassName(); virtual std::string className() const;
virtual void serial(NLMISC::IStream &stream); virtual void serial(NLMISC::IStream &stream);
virtual void toString(std::ostream &ostream, const std::string &pad = ""); virtual void toString(std::ostream &ostream, const std::string &pad = "") const;
public: // should be protected but that doesn't compile, nice c++! public: // should be protected but that doesn't compile, nice c++!
// Sets size when reading // Sets size when reading

@ -54,9 +54,9 @@ void CStorageValue<ucstring>::serial(NLMISC::IStream &stream)
} }
template <> template <>
void CStorageValue<ucstring>::toString(std::ostream &ostream, const std::string &pad) void CStorageValue<ucstring>::toString(std::ostream &ostream, const std::string &pad) const
{ {
ostream << "(" << getClassName() << ") { " << Value.toUtf8() << " } "; ostream << "(" << className() << ") { " << Value.toUtf8() << " } ";
} }
template <> template <>

@ -50,9 +50,9 @@ public:
TType Value; TType Value;
// inherited // inherited
virtual std::string getClassName(); virtual std::string className() const;
virtual void serial(NLMISC::IStream &stream); virtual void serial(NLMISC::IStream &stream);
virtual void toString(std::ostream &ostream, const std::string &pad = ""); virtual void toString(std::ostream &ostream, const std::string &pad = "") const;
public: // should be protected but that doesn't compile, nice c++! public: // should be protected but that doesn't compile, nice c++!
// Sets size when reading // Sets size when reading
@ -62,7 +62,7 @@ public: // should be protected but that doesn't compile, nice c++!
}; };
template <typename T> template <typename T>
std::string CStorageValue<T>::getClassName() std::string CStorageValue<T>::className() const
{ {
return "CStorageValue"; return "CStorageValue";
} }
@ -80,14 +80,14 @@ template <>
void CStorageValue<ucstring>::serial(NLMISC::IStream &stream); void CStorageValue<ucstring>::serial(NLMISC::IStream &stream);
template <typename T> template <typename T>
void CStorageValue<T>::toString(std::ostream &ostream, const std::string &pad) void CStorageValue<T>::toString(std::ostream &ostream, const std::string &pad) const
{ {
std::string s = NLMISC::toString(Value); std::string s = NLMISC::toString(Value);
ostream << "(" << getClassName() << ") { " << s << " } "; ostream << "(" << className() << ") { " << s << " } ";
} }
template <> template <>
void CStorageValue<ucstring>::toString(std::ostream &ostream, const std::string &pad); void CStorageValue<ucstring>::toString(std::ostream &ostream, const std::string &pad) const;
template <typename T> template <typename T>
void CStorageValue<T>::setSize(sint32 size) void CStorageValue<T>::setSize(sint32 size)

@ -75,6 +75,24 @@ private:
const ISceneClassDesc *m_ClassDesc; const ISceneClassDesc *m_ClassDesc;
}; /* class ISceneClassDesc */ }; /* class ISceneClassDesc */
/**
* \brief CSuperClassDescUnknown
* \date 2012-08-22 09:42GMT
* \author Jan Boon (Kaetemi)
* Template for non-implemented superclass descriptions
*/
template <typename T, TSClassId superClassId>
class CSuperClassDescUnknown : public ISuperClassDesc
{
public:
CSuperClassDescUnknown(const ISceneClassDesc *classDesc) : m_ClassDesc(classDesc) { }
virtual CSceneClass *createUnknown(const NLMISC::CClassId classId, const ucstring &displayName, const ucstring &dllFilename, const ucstring &dllDescription) const { return static_cast<CSceneClass *>(new CSceneClassUnknown<T>(classId, superClassId, displayName,internalNameUnknown(), dllFilename, dllDescription)); }
virtual const char *internalNameUnknown() const { return T::InternalNameUnknown; }
virtual const ISceneClassDesc *classDesc() const { return m_ClassDesc; }
private:
const ISceneClassDesc *m_ClassDesc;
}; /* class ISceneClassDesc */
} /* namespace MAX */ } /* namespace MAX */
} /* namespace PIPELINE */ } /* namespace PIPELINE */

@ -29,6 +29,7 @@
// Testing // Testing
#include "../max/builtin/storage/app_data.h" #include "../max/builtin/storage/app_data.h"
#include "../max/builtin/builtin.h"
static const char *filename = "/srv/work/database/interfaces/anims_max/cp_fy_hof_species.max"; static const char *filename = "/srv/work/database/interfaces/anims_max/cp_fy_hof_species.max";
//static const char *filename = "/home/kaetemi/source/minimax/GE_Acc_MikotoBaniere.max"; //static const char *filename = "/home/kaetemi/source/minimax/GE_Acc_MikotoBaniere.max";
@ -47,6 +48,7 @@ int main(int argc, char **argv)
PIPELINE::MAX::CSceneClassRegistry sceneClassRegistry; PIPELINE::MAX::CSceneClassRegistry sceneClassRegistry;
PIPELINE::MAX::BUILTIN::CBuiltin::registerClasses(&sceneClassRegistry);
GsfInfile *infile; GsfInfile *infile;

Loading…
Cancel
Save