コード例 #1
0
ファイル: tuple_vals.hpp プロジェクト: Kangmo/actor-framework
 const char* uniform_name_at(size_t pos) const override {
   auto& et = m_types[pos];
   if (et.first != 0) {
     return numbered_type_names[et.first - 1];
   }
   return uniform_typeid(*et.second)->name();
 }
コード例 #2
0
ファイル: types_array.hpp プロジェクト: albertoma/libcppa
 inline const uniform_type_info* operator[](size_t p) const {
     auto result = data[p].load();
     if (result == nullptr) {
         auto tinfo = tinfo_data[p];
         if (tinfo != nullptr) {
             result = uniform_typeid(*tinfo);
             data[p].store(result, std::memory_order_relaxed);
         }
     }
     return result;
 }
コード例 #3
0
ファイル: types_array.hpp プロジェクト: alepharchives/libcppa
 // pairs[sizeof...(T)];
 types_array_impl()
     : tinfo_data{ta_util<std_tinf,util::is_builtin<T>::value,T>::get()...} {
     bool static_init[sizeof...(T)] = {    !std::is_same<T,anything>::value
                                        && util::is_builtin<T>::value ...  };
     for (size_t i = 0; i < sizeof...(T); ++i) {
         if (static_init[i]) {
             data[i].store(uniform_typeid(*(tinfo_data[i])),
                           std::memory_order_relaxed);
         }
     }
 }
コード例 #4
0
ファイル: from_string.hpp プロジェクト: alepharchives/libcppa
T from_string(const std::string& what) {
    object o = from_string(what);
    const std::type_info& tinfo = typeid(T);
    if (tinfo == *(o.type())) {
        return std::move(get_ref<T>(o));
    }
    else {
        std::string error_msg = "expected type name ";
        error_msg += uniform_typeid(tinfo)->name();
        error_msg += " found ";
        error_msg += o.type()->name();
        throw std::logic_error(error_msg);
    }
}
コード例 #5
0
ファイル: types_array.hpp プロジェクト: albertoma/libcppa
 static inline const uniform_type_info* get() {
     return uniform_typeid(typeid(T));
 }
コード例 #6
0
inline uniform_type_info const* uniform_typeid()
{
    return uniform_typeid(typeid(T));
}