Classes | Functions
test_onion.cxx File Reference
#include <memory>
#include "WireCellUtil/IComponent.h"
#include "WireCellUtil/Testing.h"

Go to the source code of this file.

Classes

class  IFunctor
 
class  IFunctorT< InputType, OutputType >
 
class  IMyIFConverter
 
class  MyIFConverter
 
class  INode
 

Functions

int main ()
 

Function Documentation

int main ( void  )

Definition at line 64 of file test_onion.cxx.

65 {
66  // emulate NF lookup
67  std::shared_ptr<IFunctor> fun(new MyIFConverter);
68 
69 
70  // emulate node maker and wrapper
71  auto myfun = std::dynamic_pointer_cast<IMyIFConverter>(fun);
72 
73  // emulate running a node
74  auto in = std::make_shared<const int>(42);
75  auto out = std::make_shared<const float>(0);
76  bool ok = (*myfun)(in, out);
77 
78  Assert(ok);
79  Assert(42.0 == *out);
80  return 0;
81 }
#define Assert
Definition: Testing.h:7