Changed: #1440 Constness

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

@ -85,8 +85,13 @@ void CAnimatable::init()
CSceneClass::init(); CSceneClass::init();
} }
// inherited bool CAnimatable::inherits(const NLMISC::CClassId classId) const
const ISceneClassDesc *CAnimatable::classDesc() {
if (classId == classDesc()->classId()) return true;
return CSceneClass::inherits(classId);
}
const ISceneClassDesc *CAnimatable::classDesc() const
{ {
return &AnimatableClassDesc; return &AnimatableClassDesc;
} }

@ -66,7 +66,8 @@ public:
virtual void build(uint16 version); virtual void build(uint16 version);
virtual void disown(); virtual void disown();
virtual void init(); virtual void init();
virtual const ISceneClassDesc *classDesc(); virtual bool inherits(const NLMISC::CClassId classId) const;
virtual const ISceneClassDesc *classDesc() const;
virtual void toStringLocal(std::ostream &ostream, const std::string &pad = "") const; virtual void toStringLocal(std::ostream &ostream, const std::string &pad = "") const;
}; /* class CAnimatable */ }; /* class CAnimatable */

@ -181,7 +181,7 @@ IStorageObject *CSceneClass::createChunkById(uint16 id, bool container)
return CStorageContainer::createChunkById(id, container); return CStorageContainer::createChunkById(id, container);
} }
const ucchar *CSceneClass::DisplayName = ucstring("Scene Class").c_str(); const ucchar *CSceneClass::DisplayName = ucstring("Invalid Scene Class").c_str();
const char *CSceneClass::InternalName = "SceneClass"; const char *CSceneClass::InternalName = "SceneClass";
const NLMISC::CClassId CSceneClass::ClassId = NLMISC::CClassId::Null; // This class is invalid const NLMISC::CClassId CSceneClass::ClassId = NLMISC::CClassId::Null; // This class is invalid
const TSClassId CSceneClass::SuperClassId = 0x0000; // This class is invalid const TSClassId CSceneClass::SuperClassId = 0x0000; // This class is invalid
@ -190,7 +190,12 @@ namespace {
static const CSceneClassDesc<CSceneClass> SceneClassDesc(static_cast<const IDllPluginDescInternal *>(&DllPluginDescBuiltin)); static const CSceneClassDesc<CSceneClass> SceneClassDesc(static_cast<const IDllPluginDescInternal *>(&DllPluginDescBuiltin));
} /* anonymous namespace */ } /* anonymous namespace */
const ISceneClassDesc *CSceneClass::classDesc() bool CSceneClass::inherits(const NLMISC::CClassId classId) const
{
return false;
}
const ISceneClassDesc *CSceneClass::classDesc() const
{ {
return static_cast<const ISceneClassDesc *>(&SceneClassDesc); return static_cast<const ISceneClassDesc *>(&SceneClassDesc);
} }

@ -91,8 +91,10 @@ public:
//! \name More virtual functionality for inheriting classes to implement //! \name More virtual functionality for inheriting classes to implement
//@{ //@{
/// Returns whether the class inherits from a class with given class id
virtual bool inherits(const NLMISC::CClassId classId) const;
/// Return the class description of the inheriting class /// Return the class description of the inheriting class
virtual const ISceneClassDesc *classDesc(); virtual const ISceneClassDesc *classDesc() const;
/// Create a readable representation of this class /// Create a readable representation of this class
virtual void toStringLocal(std::ostream &ostream, const std::string &pad = "") const; virtual void toStringLocal(std::ostream &ostream, const std::string &pad = "") const;
//@} //@}

@ -100,7 +100,7 @@ public:
virtual ~CSceneClassUnknown() { } virtual ~CSceneClassUnknown() { }
// inherited // inherited
virtual const ISceneClassDesc *classDesc() { return &m_Desc; } virtual const ISceneClassDesc *classDesc() const { return &m_Desc; }
private: private:
CSceneClassUnknownDesc m_Desc; CSceneClassUnknownDesc m_Desc;

Loading…
Cancel
Save