SMP::SMPInterpreter Class Reference

The SMP interpreter The command line interface of SMP. More...

#include <interpreter.h>

Collaboration diagram for SMP::SMPInterpreter:

Collaboration graph
[legend]
List of all members.

Public Member Functions

void start_kernel (void)
 SMP starts working here.
void setup (void)
 setup SMP kernel with the current setup of filters and buffers
void reset (void)
 reset SMP kernel with empty filters and buffers
void clear_project (void)
 clear current project (will clear both filter and buffer)
void print_project (void)
 print current project information
void print_help (void)
 print SMP interpreter available commands
int get_filter_property (vector< _filter * > &target, int id)
 get and display filter's adjustable properties from _filter structure
void get_filter_property (vector< _filter * > &target)
 get and display all loaded filters' adjustable properties
void get_buffer_property ()
 get and display all buffers' detailed information
int get_buffer_property (int id)
 get and display buffer's adjustable properties from _buffer structure
int set_filter_property (int id, string property_name, string value)
 set property of a filter
int reset_filter_property (int id)
 reset property of a filter to default values
int reset_filter_property (void)
 reset property of all filters to default values
 SMPInterpreter (int *pargc, char ***pargv)
 ~SMPInterpreter ()
void start (void)
 Start the interpreter the entry point of the SMP interpreter. Start the interpreter the entry point of the SMP interpreter. SMP kernel control prompt, working as a thread it receives user input commands and invokes proper functions. A text-mode user interface.
bool load_project (char *filename)
 load project at first
void set_repository (char *path)
 Set repository path.
char * get_repository ()
 Get repository path.
int execute_cmd (char *cmd)
 execute user command
void show_current_filters ()
 show the filters used in current project on stdout
void show_current_buffers ()
 show the buffers used in current project on stdout
bool _load_filters ()
bool _print_filters ()
bool _add_filter (int fid, bool is_prompt=true)
bool _add_filter_byname (string fname, bool is_prompt=true)
bool _add_filter (_filter *filter, bool is_prompt=true)
bool _add_buffer (int src_fid, int src_pid, int dest_fid, int dest_pid, int type=DATA_BUFFER)
bool _set_buffer_size (int src_fid, int src_pid, int size, int type)
bool _del_filter (int fidx)
bool _del_buffer (int bidx)
bool _del_buffer (int src_fid, int src_pid, int dest_fid, int dest_pid)
int _get_fidx_by_fuid (uint fuid)
int _get_bidx_by_buid (uint buid)
void _start ()
void _stop ()
void _pause ()
void _resume ()
bool _isStopped ()
bool _isPaused ()

Static Public Member Functions

static void * cmd_handler (void *arg)
 this starts SMP server, which waits for any SMP controller to take control of itself. the socket connection handler thread, which handles incoming command
static void * run (void *arg)
 threading callback function, which calls prompt()

Public Attributes

void * kernel_lib
SMPKernelkernel
SMPParserparser
pthread_t kernel_thread
vector< string > cmd_history
map< string, int > kernel_config
vector< _filter * > filter_list
vector< _buffer * > buffer_list
vector< _filter * > filters
char repos_path [100]
int sw_fd
string err_string

Friends

class SMPParser

Detailed Description

The SMP interpreter The command line interface of SMP.

Note:
User should only access SMP kernel by this user interface


Constructor & Destructor Documentation

SMP::SMPInterpreter::SMPInterpreter ( int *  pargc,
char ***  pargv 
)

the constructor

SMP::SMPInterpreter::~SMPInterpreter (  ) 

the destructor


Member Function Documentation

void SMP::SMPInterpreter::start_kernel ( void   ) 

SMP starts working here.

Note:
this function is run concurrently with the interpreter itself, that is, this function works as a thread

int SMP::SMPInterpreter::get_filter_property ( vector< _filter * > &  target,
int  id 
)

get and display filter's adjustable properties from _filter structure

Parameters:
target the target vector, can be either filter_list or filters
id filter id in target
Returns:

void SMP::SMPInterpreter::get_filter_property ( vector< _filter * > &  target  ) 

get and display all loaded filters' adjustable properties

See also:
get_filter_property()

void SMP::SMPInterpreter::get_buffer_property (  ) 

get and display all buffers' detailed information

See also:
get_buffer_property()

int SMP::SMPInterpreter::get_buffer_property ( int  id  ) 

get and display buffer's adjustable properties from _buffer structure

Parameters:
id buffer id in vector<_buffer> buffer_list
Returns:

int SMP::SMPInterpreter::set_filter_property ( int  id,
string  property_name,
string  value 
)

set property of a filter

Parameters:
id filter id
property_name the name of the property
value the value to set
Returns:

int SMP::SMPInterpreter::reset_filter_property ( int  id  ) 

reset property of a filter to default values

Parameters:
id filter id

void * SMP::SMPInterpreter::run ( void *  arg  )  [static]

threading callback function, which calls prompt()

Parameters:
arg "this" pointer of SMPInterpreter so as to call prompt()
Returns:
not used

int SMP::SMPInterpreter::execute_cmd ( char *  cmd  ) 

execute user command

Parameters:
cmd the user command
Returns:
1 to signal prompt() to wait for user input 0 for prompt() to skip user input -1 for "quit" signal

void SMP::SMPInterpreter::show_current_filters (  ) 

show the filters used in current project on stdout

Author:
Mobo Chuang
Date:
2006/7/4

void SMP::SMPInterpreter::show_current_buffers (  ) 

show the buffers used in current project on stdout

Author:
Mobo Chuang
Date:
2006/7/4


Member Data Documentation

pthread_t SMP::SMPInterpreter::kernel_thread

a pthread thread to run kernel

vector<string> SMP::SMPInterpreter::cmd_history

command history list

map<string, int> SMP::SMPInterpreter::kernel_config

kernel configuration maps

vector<_filter*> SMP::SMPInterpreter::filter_list

the filter list SMP kernel will produce filters according to the list

vector<_buffer*> SMP::SMPInterpreter::buffer_list

the buffer list SMP kernel will produce buffers according to the list

vector<_filter*> SMP::SMPInterpreter::filters

the total filter list in the system

char SMP::SMPInterpreter::repos_path[100]

repository path

int SMP::SMPInterpreter::sw_fd

file descriptor for socket object


The documentation for this class was generated from the following files:
Generated on Fri Aug 31 15:41:59 2007 for SCREAMLinuxMiddleware(SLIM) by  doxygen 1.5.1