#include "WireCellUtil/Testing.h"
#include "WireCellUtil/Interface.h"
#include <iostream>
#include <typeinfo>
#include <map>
#include <string>
Go to the source code of this file.
Definition at line 144 of file test_typeid.cxx.
147 if (!port) {
return nullptr; }
virtual std::string port_type_name() const =0
static map< string, CallTransfer * > callers
Definition at line 152 of file test_typeid.cxx.
160 cout <<
"typeid(si) = " <<
typeid(si).
name() <<
endl;
161 cout <<
"typeid(*si) = " <<
typeid(*si).name() <<
endl;
162 cout <<
"typeid(sf) = " <<
typeid(sf).
name() <<
endl;
163 cout <<
"typeid(*sf) = " <<
typeid(*sf).name() <<
endl;
164 cout <<
"typeid(sfo) = " <<
typeid(sfo).
name() <<
endl;
165 cout <<
"typeid(*sfo) = " <<
typeid(*sfo).name() <<
endl;
166 cout <<
"typeid(sfi) = " <<
typeid(sfi).
name() <<
endl;
167 cout <<
"typeid(*sfi) = " <<
typeid(*sfi).name() <<
endl;
187 register_caller<int>();
188 register_caller<float>();
virtual bool call(const IPort &a, IPort &b)=0
bool transfer(const A &a, B &b)
virtual std::string port_type_name() const =0
CallTransfer * get_caller(const IPort &comp)
QTextStream & endl(QTextStream &s)
Definition at line 138 of file test_typeid.cxx.
std::string port_type_name() const
static map< string, CallTransfer * > callers
template<typename A , typename B >
bool transfer |
( |
const A & |
a, |
|
|
B & |
b |
|
) |
| |
Definition at line 91 of file test_typeid.cxx.
94 <<
typeid(
A).
name() <<
"<->" <<
typeid(
a).
name() <<
" " 98 if (
a.port_type_name() != b.port_type_name()) {
99 cerr <<
"Port type mismatch: " 100 <<
a.port_type_name() <<
" != " << b.port_type_name() <<
endl;
103 typename A::port_type
dat;
105 cerr <<
"Failed to get output of type " <<
a.port_type_name() <<
endl;
109 cerr <<
"Failed to put input of type " << b.port_type_name() <<
endl;
const GenericPointer< typename T::ValueType > T2 T::AllocatorType & a
QTextStream & endl(QTextStream &s)