Imported Upstream version 3.2.2
[debian/gnuradio] / gr-gcell / src / gc_job_manager.i
1 /* -*- c++ -*- */
2 /*
3  * Copyright 2008 Free Software Foundation, Inc.
4  * 
5  * This file is part of GNU Radio
6  * 
7  * GNU Radio is free software; you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation; either version 3, or (at your option)
10  * any later version.
11  * 
12  * GNU Radio is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15  * GNU General Public License for more details.
16  * 
17  * You should have received a copy of the GNU General Public License along
18  * with this program; if not, write to the Free Software Foundation, Inc.,
19  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
20  */
21     
22 struct spe_program_handle_t;
23 typedef boost::shared_ptr<spe_program_handle_t> spe_program_handle_sptr;
24 %template(spe_program_handle_sptr) boost::shared_ptr<spe_program_handle_t>;
25
26 class gc_job_manager;
27 typedef boost::shared_ptr<gc_job_manager> gc_job_manager_sptr;
28 %template(gc_job_manager_sptr) boost::shared_ptr<gc_job_manager>;
29
30
31 %rename(program_handle_from_filename) gc_program_handle_from_filename;
32 spe_program_handle_sptr 
33 gc_program_handle_from_filename(const std::string &filename);
34
35 %rename(program_handle_from_address) gc_program_handle_from_address;
36 spe_program_handle_sptr 
37 gc_program_handle_from_address(spe_program_handle_t *handle);
38
39
40 %rename(jm_options) gc_jm_options;
41 struct gc_jm_options {
42   unsigned int max_jobs;            // max # of job descriptors in system
43   unsigned int max_client_threads;  // max # of client threads of job manager
44   unsigned int nspes;               // how many SPEs shall we use? 0 -> all of them
45   bool gang_schedule;               // shall we gang schedule?
46   bool use_affinity;                // shall we try for affinity (FIXME not implmented)
47   bool enable_logging;              // shall we log SPE events?
48   uint32_t log2_nlog_entries;              // log2 of number of log entries (default is 12 == 4k)
49   spe_program_handle_sptr program_handle;  // program to load into SPEs
50
51   gc_jm_options(spe_program_handle_sptr program_handle_,
52                 unsigned int nspes_ = 0) :
53     max_jobs(0), max_client_threads(0), nspes(nspes_),
54     gang_schedule(false), use_affinity(false),
55     enable_logging(false), log2_nlog_entries(12),
56     program_handle(program_handle_)
57   {
58   }
59 };
60
61 %rename(job_manager) gc_make_job_manager;
62 gc_job_manager_sptr
63 gc_make_job_manager(const gc_jm_options *options);
64
65 %inline {
66   void set_singleton(gc_job_manager_sptr mgr)
67   {
68     gc_job_manager::set_singleton(mgr);
69   }
70
71   gc_job_manager_sptr singleton()
72   {
73     return gc_job_manager::singleton();
74   }
75 }