Orocos Real-Time Toolkit
2.6.0
|
00001 #ifndef DATASOURCE_TYPE_INFO_INL 00002 #define DATASOURCE_TYPE_INFO_INL 00003 00004 #include "../types/TypeInfo.hpp" 00005 #include "../types/TypeInfoRepository.hpp" 00006 00007 namespace RTT 00008 { 00009 namespace internal { 00010 template< class T> 00011 const std::string& DataSourceTypeInfo<T>::getType() { 00012 return getTypeInfo()->getTypeName(); 00013 } 00014 00015 template< class T> 00016 const std::string& DataSourceTypeInfo<T>::getTypeName() { 00017 return getTypeInfo()->getTypeName(); 00018 } 00019 00020 template< class T> 00021 const std::string& DataSourceTypeInfo<T>::getQualifier() { 00022 return DataSourceTypeInfo<UnknownType>::getQualifier(); 00023 } 00024 00025 template< class T> 00026 const types::TypeInfo* DataSourceTypeInfo<T>::getTypeInfo() { 00027 types::TypeInfo* ret; 00028 ret = types::TypeInfoRepository::Instance()->getTypeInfo<T>(); 00029 if (!ret) 00030 return DataSourceTypeInfo<UnknownType>::getTypeInfo(); 00031 return ret; 00032 } 00033 00034 template< class T> 00035 types::TypeInfo* DataSourceTypeInfo<T>::TypeInfoObject = 0; 00036 00037 template< class T> 00038 const types::TypeInfo* DataSourceTypeInfo<T*>::getTypeInfo() { 00039 types::TypeInfo* ret; 00040 ret = types::TypeInfoRepository::Instance()->getTypeInfo<T*>(); 00041 if (!ret) 00042 return DataSourceTypeInfo<UnknownType>::getTypeInfo(); 00043 return ret; 00044 } 00045 00046 template< class T> 00047 types::TypeInfo* DataSourceTypeInfo<T*>::TypeInfoObject = 0; 00048 00049 template< class T> 00050 const types::TypeInfo* DataSourceTypeInfo< types::carray<T> >::getTypeInfo() { 00051 // return carray type info 00052 if (!TypeInfoObject) { 00053 TypeInfoObject = types::TypeInfoRepository::Instance()->getTypeInfo< types::carray<T> >(); 00054 if (!TypeInfoObject) 00055 return DataSourceTypeInfo<UnknownType>::getTypeInfo(); 00056 } 00057 return TypeInfoObject; 00058 } 00059 00060 template< class T> 00061 types::TypeInfo* DataSourceTypeInfo< types::carray<T> >::TypeInfoObject = 0; 00062 00063 } 00064 00065 } 00066 00067 #endif