Added: #1440 First registration to the class registry

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

@ -57,32 +57,32 @@ const char *CAnimatable::InternalName = "Animatable";
const char *CAnimatable::InternalNameUnknown = "AnimatableUnknown";
const NLMISC::CClassId CAnimatable::ClassId = NLMISC::CClassId(0x3101497b, 0x24af711b); /* Not official, please correct */
const TSClassId CAnimatable::SuperClassId = 0x77a60fbd;/* Not official, please correct */
CAnimatableClassDesc AnimatableClassDesc(&DllPluginDescBuiltin);
CAnimatableSuperClassDesc AnimatableSuperClassDesc(&AnimatableClassDesc);
const CAnimatableClassDesc AnimatableClassDesc(&DllPluginDescBuiltin);
const CAnimatableSuperClassDesc AnimatableSuperClassDesc(&AnimatableClassDesc);
void CAnimatable::parse(uint16 version, TParseLevel level)
{
CSceneClass::parse(version, level);
}
void CAnimatable::clean()
{
CSceneClass::clean();
}
void CAnimatable::build(uint16 version)
{
CSceneClass:build(version);
}
void CAnimatable::disown()
{
CSceneClass::disown();
}
void CAnimatable::init()
{
CSceneClass::init();
}
// inherited
@ -93,7 +93,7 @@ const ISceneClassDesc *CAnimatable::classDesc()
void CAnimatable::toStringLocal(std::ostream &ostream, const std::string &pad) const
{
CSceneClass::toStringLocal(ostream, pad);
}
} /* namespace BUILTIN */

@ -35,7 +35,7 @@
// Project includes
#include "../scene_class.h"
#include "../scene_class_unknown.h"
#include "../super_class_desc.h"
namespace PIPELINE {
namespace MAX {
@ -72,9 +72,9 @@ public:
}; /* class CAnimatable */
typedef CSceneClassDesc<CAnimatable> CAnimatableClassDesc;
extern CAnimatableClassDesc AnimatableClassDesc;
typedef CSuperClassDesc<CAnimatable, CSceneClassUnknown<CAnimatable> > CAnimatableSuperClassDesc;
extern CAnimatableSuperClassDesc AnimatableSuperClassDesc;
extern const CAnimatableClassDesc AnimatableClassDesc;
typedef CSuperClassDesc<CAnimatable> CAnimatableSuperClassDesc;
extern const CAnimatableSuperClassDesc AnimatableSuperClassDesc;
} /* namespace BUILTIN */
} /* namespace MAX */

@ -35,9 +35,9 @@
// Project includes
#include "../scene_class_registry.h"
#include "../animatable.h"
#include "../reference_maker.h"
#include "../reference_target.h"
#include "animatable.h"
#include "reference_maker.h"
#include "reference_target.h"
// using namespace std;
// using namespace NLMISC;
@ -56,7 +56,11 @@ CBuiltin::~CBuiltin()
}
CBuiltin::registerClasses(
void CBuiltin::registerClasses(CSceneClassRegistry *registry)
{
registry->add(&AnimatableClassDesc);
registry->add(&AnimatableSuperClassDesc);
}
} /* namespace BUILTIN */
} /* namespace MAX */

@ -164,42 +164,6 @@ private:
}; /* class CSceneClassDesc */
/**
* \brief ISuperClassDesc
* \date 2012-08-22 09:42GMT
* \author Jan Boon (Kaetemi)
* ISuperClassDesc
*/
class ISuperClassDesc
{
public:
/// Create an unknown class that inherits from this superclass
virtual CSceneClass *createUnknown(const NLMISC::CClassId classId, const ucstring &displayName, const ucstring &dllFilename, const ucstring &dllDescription) const = 0;
/// Get an internal name associated with unknown classes of this superclass
virtual const char *internalNameUnknown() const = 0;
/// Return the class description that directly implements this superclass
virtual const ISceneClassDesc *classDesc() const = 0;
}; /* class ISceneClassDesc */
/**
* \brief CSuperClassDesc
* \date 2012-08-22 09:42GMT
* \author Jan Boon (Kaetemi)
* ISuperClassDesc
*/
template <typename T, typename TUnknown>
class CSuperClassDesc : public ISuperClassDesc
{
public:
CSuperClassDesc(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 TUnknown(classId, m_ClassDesc->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 PIPELINE */

@ -35,6 +35,7 @@
// Project includes
#include "scene_class.h"
#include "super_class_desc.h"
namespace PIPELINE {
namespace MAX {

@ -0,0 +1,49 @@
/**
* \file super_class_desc.cpp
* \brief CSuperClassDesc
* \date 2012-08-22 11:19GMT
* \author Jan Boon (Kaetemi)
* CSuperClassDesc
*/
/*
* Copyright (C) 2012 by authors
*
* This file is part of RYZOM CORE PIPELINE.
* RYZOM CORE PIPELINE is free software: you can redistribute it
* and/or modify it under the terms of the GNU Affero General Public
* License as published by the Free Software Foundation, either
* version 3 of the License, or (at your option) any later version.
*
* RYZOM CORE PIPELINE is distributed in the hope that it will be
* useful, but WITHOUT ANY WARRANTY; without even the implied warranty
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public
* License along with RYZOM CORE PIPELINE. If not, see
* <http://www.gnu.org/licenses/>.
*/
#include <nel/misc/types_nl.h>
#include "super_class_desc.h"
// STL includes
// NeL includes
// #include <nel/misc/debug.h>
// Project includes
// using namespace std;
// using namespace NLMISC;
namespace PIPELINE {
namespace MAX {
void nyannyannyan() { }
} /* namespace MAX */
} /* namespace PIPELINE */
/* end of file */

@ -0,0 +1,83 @@
/**
* \file super_class_desc.h
* \brief CSuperClassDesc
* \date 2012-08-22 11:19GMT
* \author Jan Boon (Kaetemi)
* CSuperClassDesc
*/
/*
* Copyright (C) 2012 by authors
*
* This file is part of RYZOM CORE PIPELINE.
* RYZOM CORE PIPELINE is free software: you can redistribute it
* and/or modify it under the terms of the GNU Affero General Public
* License as published by the Free Software Foundation, either
* version 3 of the License, or (at your option) any later version.
*
* RYZOM CORE PIPELINE is distributed in the hope that it will be
* useful, but WITHOUT ANY WARRANTY; without even the implied warranty
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public
* License along with RYZOM CORE PIPELINE. If not, see
* <http://www.gnu.org/licenses/>.
*/
#ifndef PIPELINE_SUPER_CLASS_DESC_H
#define PIPELINE_SUPER_CLASS_DESC_H
#include <nel/misc/types_nl.h>
// STL includes
// NeL includes
// Project includes
#include "scene_class_unknown.h"
namespace PIPELINE {
namespace MAX {
/**
* \brief ISuperClassDesc
* \date 2012-08-22 09:42GMT
* \author Jan Boon (Kaetemi)
* ISuperClassDesc
*/
class ISuperClassDesc
{
public:
/// Create an unknown class that inherits from this superclass
virtual CSceneClass *createUnknown(const NLMISC::CClassId classId, const ucstring &displayName, const ucstring &dllFilename, const ucstring &dllDescription) const = 0;
/// Get an internal name associated with unknown classes of this superclass
virtual const char *internalNameUnknown() const = 0;
/// Return the class description that directly implements this superclass
virtual const ISceneClassDesc *classDesc() const = 0;
}; /* class ISceneClassDesc */
/**
* \brief CSuperClassDesc
* \date 2012-08-22 09:42GMT
* \author Jan Boon (Kaetemi)
* ISuperClassDesc
*/
template <typename T>
class CSuperClassDesc : public ISuperClassDesc
{
public:
CSuperClassDesc(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, m_ClassDesc->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 PIPELINE */
#endif /* #ifndef PIPELINE_SUPER_CLASS_DESC_H */
/* end of file */
Loading…
Cancel
Save