OpenSceneGraph/include/osgIntrospection/TypeNameAliasProxy
2005-04-04 13:50:07 +00:00

27 lines
543 B
Plaintext

#ifndef OSGINTROSPECTION_TYPENAMEALIASPROXY_
#define OSGINTROSPECTION_TYPENAMEALIASPROXY_
#include <osgIntrospection/Type>
#include <osgIntrospection/Reflection>
#include <string>
#include <algorithm>
namespace osgIntrospection
{
template<typename C>
struct TypeNameAliasProxy
{
TypeNameAliasProxy(const std::string &name)
{
Type *type = Reflection::getOrRegisterType(typeid(C));
if (std::find(type->aliases_.begin(), type->aliases_.end(), name) == type->aliases_.end())
type->aliases_.push_back(name);
}
};
}
#endif