Skip to content

Instantly share code, notes, and snippets.

#include <iostream>
#include <vector>
#include <numeric>
#include <ctime>
int main()
{
// Seed random generator (std::rand is awful but's what we got)
std::srand(std::time(0));
// array of fitness values
#include <boost/asio.hpp>
#include <boost/bind.hpp>
#include <boost/date_time/posix_time/posix_time.hpp>
#include <boost/thread.hpp>
#include <boost/shared_ptr.hpp>
#include <iostream>
class display_class
{
public:
display_class(boost::thread_group& threads, boost::asio::strand* st) : strand(st)
{
iosrv = &strand->get_io_service();
t = new boost::thread(boost::bind(&boost::asio::io_service::run, &strand->get_io_service()));
strand->post(strand->wrap(boost::bind(&display_class::get, this)));
threads.add_thread(t);
}
class queue
{
public:
static std::vector<int> display_messages;
static std::vector<int> app_messages;
};
std::vector<int> queue::display_messages;
std::vector<int> queue::app_messages;
class app_class
{
public:
app_class(boost::thread_group& threads, boost::asio::strand* st) : strand(st)
{
iosrv = &strand->get_io_service();
t = new boost::thread(boost::bind(&boost::asio::io_service::run, &strand->get_io_service()));
strand->post(strand->wrap(boost::bind(&app_class::send, this)));
threads.add_thread(t);
}
int main(int argc, char **argv)
{
boost::asio::io_service ios;
boost::asio::strand strand(ios);
boost::thread_group threads;
app_class app_thread(threads, &strand);
display_class display_thread(threads, &strand);
threads.join_all();
return 0;
// main.cpp
#include <owlsl/cwl.h>
int main()
{
owlsl::cwl cwl;
if (cwl.open("program1.c"))
{
// program1.c
class Program
{
void Main()
{
}
}
// program1.c
class test
{
number num;
void set_number(number val)
{
num = val;
}
// main.cpp
#include <owlsl/cwl.h>
class console
{
public:
void print_line (const owlsl::text& text)
{
std::wcout << text.wstring() <<std::endl;
}