From Marco Jez, updates to osgIntrospection.
This commit is contained in:
26
include/osgIntrospection/TypeNameAliasProxy
Normal file
26
include/osgIntrospection/TypeNameAliasProxy
Normal file
@@ -0,0 +1,26 @@
|
||||
#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
|
||||
Reference in New Issue
Block a user