main.cpp
#include <iostream>
#include <stdexcept>
class sample_event_exception_logger_t
:
{
public:
virtual ~sample_event_exception_logger_t()
{}
virtual void
const std::exception & event_exception,
const std::string & coop_name )
{
std::cerr
<< "Event_exception, coop:"
<< coop_name << "; "
" error: "
<< event_exception.what()
<< std::endl;
}
};
class a_hello_t
:
{
public:
:
base_type_t( env )
{}
virtual ~a_hello_t()
{}
virtual void
{
new sample_event_exception_logger_t ) );
throw std::runtime_error( "sample exception" );
}
virtual void
{
}
};
void
{
coop->add_agent(
new a_hello_t( env ) ) );
}
int
main( int, char ** )
{
try
{
}
catch( const std::exception & ex )
{
std::cerr << "Error: " << ex.what() << std::endl;
return 1;
}
return 0;
}