OpenSceneGraph/include/osgIntrospection/TypeNameAliasProxy

27 lines
543 B
Plaintext
Raw Normal View History

#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