#include <parser.h>
Collaboration diagram for SMP::SMPParser:
Public Member Functions | |
SMPParser (vector< _filter * > *f, vector< _buffer * > *b, SMPInterpreter *interpreter) | |
~SMPParser () | |
int | parse_filter_port_pair (const char *from, int &fid, int &pid) |
small function used to parse "[number]:[number]" string, and save back | |
int | set_buffer_dest (_buffer *buf, char *str) |
parse the buffer destination string and save to _buffer structure | |
int | set_buffer_dest_new (int src_fid, int src_pid, char *str, int type) |
parse the buffer destination string and save to interpreter->buffer_list | |
int | load_filter (vector< _filter * > *target, char *filename) |
load filter by its XML, save to target | |
int | load_filters (vector< _filter * > *f) |
load filter lists in the default dir This call will iterate through every .so file in the dir, and stores their information(from XML) such as ports and properties in a data structure "_filter" here | |
bool | load_project (const char *filename) |
Start the SMP using project file. | |
void | save_project (const char *filename) |
Save project into file. |
SMP::SMPParser::SMPParser | ( | vector< _filter * > * | f, | |
vector< _buffer * > * | b, | |||
SMPInterpreter * | interpreter | |||
) |
initialize xml parser
SMP::SMPParser::~SMPParser | ( | ) |
cleanup xml parser
int SMP::SMPParser::parse_filter_port_pair | ( | const char * | from, | |
int & | fid, | |||
int & | pid | |||
) |
small function used to parse "[number]:[number]" string, and save back
from | the string to parse | |
fid | the filter id, first number | |
pid | the port id, second number |
int SMP::SMPParser::set_buffer_dest | ( | _buffer * | buf, | |
char * | str | |||
) |
parse the buffer destination string and save to _buffer structure
buf | the _buffer structure object pointer | |
str | the format is something like "0:0,1:0,2:0" or simply "1:2" |
< buffer destination filter id array, as a vector
< buffer destination filter's port id array, as a vector
int SMP::SMPParser::set_buffer_dest_new | ( | int | src_fid, | |
int | src_pid, | |||
char * | str, | |||
int | type | |||
) |
parse the buffer destination string and save to interpreter->buffer_list
src_fid | source filter id | |
src_pid | source filter port id | |
str | the format is something like "0:0,1:0,2:0" or simply "1:2" | |
type | the type of the buffer (DATA_BUFFER, or SIGNAL_BUFFER) |
int SMP::SMPParser::load_filter | ( | vector< _filter * > * | target, | |
char * | filename | |||
) |
load filter by its XML, save to target
target | the target vector to save to | |
filename | the XML filename |
< return number of the function which reads XML node
< XML node name
< XML node attribute value
< the _filter object to be created through parsing XML
int SMP::SMPParser::load_filters | ( | vector< _filter * > * | f | ) |
load filter lists in the default dir This call will iterate through every .so file in the dir, and stores their information(from XML) such as ports and properties in a data structure "_filter" here
filters | the target vector to save to |
< directory pointer
< directory structure
bool SMP::SMPParser::load_project | ( | const char * | filename | ) |
void SMP::SMPParser::save_project | ( | const char * | filename | ) |
Save project into file.
filename | the filename to save the project XML file |