#include <kernel.h>
Collaboration diagram for SMP::SMPKernel:

Public Member Functions | |
| ~SMPKernel (void) | |
| void | pat_dog (int id) |
| for filter to pat the watchdog at regular time (when processing in the main loop) | |
| void | set_unmonitored (int fid) |
| for filter to unregister itself to the watchdog, so that watchdog will not check this thread's heartbeat | |
| SMPConfiguration & | get_config () |
| void | set_config (SMPConfiguration &c) |
| void | set_config (string name, int value) |
| int | destruct_filters (void) |
| construct a filter destruct all the filters in the system, this will free any resources related to filters | |
| int | construct_binding (size_t size, int input, int input_port, vector< int > &output, vector< int > &output_port, int type) |
| construct a buffer this function also updates filter's buffer information | |
| int | destruct_buffers (void) |
| destruct all the buffers in the system, this will free any resources related to buffers | |
| int | init (void) |
| initialization of SMP kernel, does filter initialize() function | |
| void | start (void) |
| void | pause (void) |
| void | resume (void) |
| void | stop (void) |
| void | halt (void) |
| void | set_buf_status (int buf_id, int status) |
| add buffer to the filter's input port add buffer to the filter's output port set filter property get filter property set if kernel will run in real time scheduling set buffer status | |
| int | get_buf_status (int buf_id) |
| get buffer status | |
| void | flush_buffer (int buf_id) |
| reset buffer flags so that it becomes empty | |
| ssize_t | buf_read (int buf_id, void *buff, size_t nbytes, int fid=0) |
| ssize_t | buf_write (int buf_id, const void *buff, size_t nbytes) |
| ssize_t | buf_read_nonblock (int buf_id, void *buff, size_t nbytes, int fid=0) |
| ssize_t | buf_write_nonblock (int buf_id, const void *buff, size_t nbytes) |
| ssize_t | buf_read_space (int buf_id, int fid) |
| ssize_t | buf_write_space (int buf_id) |
| void | show_buffers (void) |
| display each buffer's status in the system | |
| void | show_buffer (int bid) |
| display a buffer's status by buffer id | |
| void | show_threads (void) |
| display each threads' status in the system | |
| void | show_thread (int fid) |
| display a thread's status by filter id | |
| void | set_priority (int fid, int prio) |
| set thread priority | |
| void | update_property (int fid, map< string, property_item > &prop) |
| update filter property using given property map | |
| void | set_env (int pargc, char **pargv) |
| void | get_env (int *pargc, char ***pargv) |
| void | run_additional () |
| void | begin () |
| void | join () |
Static Public Member Functions | |
| static SMPKernel * | get_kernel (void) |
| return a kernel object If there are already a kernel there, do not new | |
Public Attributes | |
| SMPSignalManager * | signal_manager |
| char | version [6] |
| bool | stopped |
| bool | paused |
| bool | buf_rw_info |
| int | argc |
| char ** | argv |
Friends | |
| class | SMPWatchdog |
| SMP::SMPKernel::~SMPKernel | ( | void | ) |
public destructor
| void SMP::SMPKernel::pat_dog | ( | int | id | ) |
for filter to pat the watchdog at regular time (when processing in the main loop)
| id | this is the same as the filter's id, specifying which flag to raise |
| void SMP::SMPKernel::set_unmonitored | ( | int | fid | ) |
for filter to unregister itself to the watchdog, so that watchdog will not check this thread's heartbeat
| fid | the filter id |
| int SMP::SMPKernel::destruct_filters | ( | void | ) |
construct a filter destruct all the filters in the system, this will free any resources related to filters
| int SMP::SMPKernel::construct_binding | ( | size_t | size, | |
| int | input, | |||
| int | input_port, | |||
| vector< int > & | output, | |||
| vector< int > & | output_port, | |||
| int | type | |||
| ) |
construct a buffer this function also updates filter's buffer information
| size | number of MAX bytes allowed in the buffer | |
| input | input filter id | |
| input_port | input filter port id | |
| output | output filters' id, as a vector | |
| output_port | output filter port id, as a vector | |
| type | 0: DATA_BUFFER, 1:SIGNAL_BUFFER |
| int SMP::SMPKernel::destruct_buffers | ( | void | ) |
destruct all the buffers in the system, this will free any resources related to buffers
| int SMP::SMPKernel::init | ( | void | ) |
initialization of SMP kernel, does filter initialize() function
| void SMP::SMPKernel::start | ( | void | ) |
start execution of SMP kernel
| void SMP::SMPKernel::pause | ( | void | ) |
pause execution of SMP kernel
| void SMP::SMPKernel::resume | ( | void | ) |
resume execution of SMP kernel
| void SMP::SMPKernel::stop | ( | void | ) |
stop execution of SMP kernel
| void SMP::SMPKernel::set_buf_status | ( | int | buf_id, | |
| int | status | |||
| ) |
add buffer to the filter's input port add buffer to the filter's output port set filter property get filter property set if kernel will run in real time scheduling set buffer status
| buf_id | the buffer id | |
| status | the status to set |
| int SMP::SMPKernel::get_buf_status | ( | int | buf_id | ) |
get buffer status
| buf_id | the buffer id |
| void SMP::SMPKernel::flush_buffer | ( | int | buf_id | ) |
reset buffer flags so that it becomes empty
| buf_id | the buffer id |
| ssize_t SMP::SMPKernel::buf_read | ( | int | buf_id, | |
| void * | buff, | |||
| size_t | nbytes, | |||
| int | fid = 0 | |||
| ) |
blocking read from buf_id
| ssize_t SMP::SMPKernel::buf_write | ( | int | buf_id, | |
| const void * | buff, | |||
| size_t | nbytes | |||
| ) |
blocking write to buf_id
| ssize_t SMP::SMPKernel::buf_read_nonblock | ( | int | buf_id, | |
| void * | buff, | |||
| size_t | nbytes, | |||
| int | fid = 0 | |||
| ) |
nonblocking read from buf_id
| ssize_t SMP::SMPKernel::buf_write_nonblock | ( | int | buf_id, | |
| const void * | buff, | |||
| size_t | nbytes | |||
| ) |
nonblocking write to buf_id
| void SMP::SMPKernel::show_buffer | ( | int | bid | ) |
display a buffer's status by buffer id
| bid | buffer id |
| void SMP::SMPKernel::show_thread | ( | int | fid | ) |
display a thread's status by filter id
| fid | filter id |
| void SMP::SMPKernel::set_priority | ( | int | fid, | |
| int | prio | |||
| ) |
set thread priority
| fid | the thread of filter id = fid | |
| prio | the priority to set. Min = -5, Max = 5 |
| void SMP::SMPKernel::update_property | ( | int | fid, | |
| map< string, property_item > & | prop | |||
| ) |
update filter property using given property map
| fid | the filter id | |
| prop | reference of the property map |
| void SMP::SMPKernel::run_additional | ( | ) |
run additional components after kernel has started
| void SMP::SMPKernel::begin | ( | ) |
a function for invoking start() as a thread
| void SMP::SMPKernel::join | ( | ) |
a function which blocks until kernel stops
the signal manager (watchdog for each signal handler thread)
| char SMP::SMPKernel::version[6] |
SMP kernel version
to note if this kernel has stopped
to note if this kernel has paused
flag to control the display of buffer r/w information
1.5.1