SMP::SMPParser Class Reference

The XML parser for SMP project xml and filter xml files. More...

#include <parser.h>

Collaboration diagram for SMP::SMPParser:

Collaboration graph
[legend]
List of all members.

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.

Detailed Description

The XML parser for SMP project xml and filter xml files.

Note:
This class is currently closely related to class SMPInterpreter
Warning:
cannot work alone by itself.
Todo:
fix the closely related functions such as load_project()


Constructor & Destructor Documentation

SMP::SMPParser::SMPParser ( vector< _filter * > *  f,
vector< _buffer * > *  b,
SMPInterpreter interpreter 
)

initialize xml parser

SMP::SMPParser::~SMPParser (  ) 

cleanup xml parser


Member Function Documentation

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

Parameters:
from the string to parse
fid the filter id, first number
pid the port id, second number
Returns:

int SMP::SMPParser::set_buffer_dest ( _buffer buf,
char *  str 
)

parse the buffer destination string and save to _buffer structure

Parameters:
buf the _buffer structure object pointer
str the format is something like "0:0,1:0,2:0" or simply "1:2"
Returns:
0 on success and -1 on error.

< 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

Parameters:
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)
Author:
Mobo Chuang
Date:
2006/7/5
Returns:
0 on success and -1 on error.

int SMP::SMPParser::load_filter ( vector< _filter * > *  target,
char *  filename 
)

load filter by its XML, save to target

Parameters:
target the target vector to save to
filename the XML filename
Returns:

< 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

Parameters:
filters the target vector to save to
Returns:

< directory pointer

< directory structure

bool SMP::SMPParser::load_project ( const char *  filename  ) 

Start the SMP using project file.

Parameters:
filename the filename of XML project file

< return number of the function which reads XML node

< XML node name

< XML node attribute value

< current filter _filter structure pointer

< current filter id

void SMP::SMPParser::save_project ( const char *  filename  ) 

Save project into file.

Parameters:
filename the filename to save the project XML file


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