Menu

#3 Implement interface more "boost like" way.

1.0
open
nobody
None
2012-01-27
2012-01-27
No

class myapp
{
public:
int operator()( const std::vector< std::string >& args,
boost::application::application< myapp,
boost::application::default_application_type >& app )
{
// your application logic here!
do
{
std::cout << "Hello Boost.Application!" << std::endl;
// ...
} while( app.state() != boost::application::application_stoped );
return 0;
}
};

// this is a minimal main(). It could also include more sophisticatet logic,
// like e.g. depending on the command line start different applications or
// application types.

int main( int argc, char** argv )
{
myapp application_functor;
// instantiate application object
boost::application::application< myapp,
boost::application::default_application_type >
app( application_functor,
"MainTutorial1", "Boost.Application Main Tutorial 1!");

return app( argc, argv );

}

Discussion


Log in to post a comment.

MongoDB Logo MongoDB