30 #include "configurator.hh" 44 LINFO(
plog,
"Attempting to cancel" );
49 int main(
int argc,
char** argv )
53 scarab::param_node t_default_config;
54 t_default_config.add(
"ip", scarab::param_value(
"127.0.0.1" ) );
55 t_default_config.add(
"port", scarab::param_value( 23530 ) );
56 t_default_config.add(
"interface", scarab::param_value(
"eth1" ) );
58 scarab::configurator t_configurator( argc, argv, t_default_config );
60 std::string t_ip( t_configurator.get< std::string >(
"ip" ) );
61 unsigned t_port = t_configurator.get<
unsigned >(
"port" );
62 std::string t_interface( t_configurator.get< std::string >(
"interface" ) );
63 bool t_use_fpa( t_configurator.config().has(
"fpa" ) );
65 LINFO(
plog,
"Creating and configuring nodes" );
67 midge::diptera* t_root =
new midge::diptera();
73 t_pck_rec->set_name(
"pck_rec" );
74 t_pck_rec->set_length( 10 );
75 t_pck_rec->set_port( t_port );
76 t_pck_rec->interface() = t_interface;
77 t_root->add( t_pck_rec );
80 LERROR(
plog,
"FPA was requested, but is only available on a Linux machine" );
87 t_pck_rec->set_name(
"pck_rec" );
88 t_pck_rec->set_length( 10 );
89 t_pck_rec->set_port( t_port );
90 t_pck_rec->ip() = t_ip;
91 t_root->add( t_pck_rec );
96 t_tfr_rec->set_name(
"tfr_rec" );
97 t_tfr_rec->set_time_length( 10 );
98 t_tfr_rec->set_start_paused(
false );
99 t_root->add( t_tfr_rec );
102 t_term_t->set_name(
"term_t" );
103 t_root->add( t_term_t );
106 t_term_f->set_name(
"term_f" );
107 t_root->add( t_term_f );
109 LINFO(
plog,
"Connecting nodes" );
111 t_root->join(
"pck_rec.out_0:tfr_rec.in_0" );
112 t_root->join(
"tfr_rec.out_0:term_t.in_0" );
113 t_root->join(
"tfr_rec.out_1:term_f.in_0" );
115 LINFO(
plog,
"Exit with ctrl-c" );
120 LINFO(
plog,
"Executing" );
122 std::exception_ptr t_e_ptr = t_root->run(
"pck_rec:tfr_rec:term_t:term_f" );
124 if( t_e_ptr ) std::rethrow_exception( t_e_ptr );
126 LINFO(
plog,
"Execution complete" );
135 catch( std::exception& e )
137 LERROR(
plog,
"Exception caught: " << e.what() );
static scarab::logger plog("batch_executor")
scarab::cancelable * f_cancelable
int main(int argc, char **argv)
A producer to receive UDP packets via the standard socket interface and write them as raw blocks of m...
A producer to receive UDP packets via the fast-packet-acquisition interface and write them as raw blo...
A transformer to receive raw blocks of memory, parse them, and distribute them as time and frequency ...
LOGGER(plog, "egg_writer")