DREAM::XMLParser Class Reference

XML Parser class. More...

#include <XMLParser.h>

List of all members.

Public Member Functions

 XMLParser ()
 Constructor.
 ~XMLParser ()
 Destructor.
void parse (char *xmlFile, DREAM::System *system) throw (DREAM::Exception)
 Starts the parsing of the XML input into the System root.
void set_system (DREAM::System *system_ptr)
 Sets the system_ptr_ root pointer for DREAM::System.

Private Member Functions

void check_mapping () throw (DREAM::Exception)
 Verifies whether each timer, task and channel is mapped to threads, and whether each thread is mapped to a CPU.
DREAM::Nodefind_node (const std::string &name) throw (DREAM::Exception)
 Looks up a temporarily stored node in node_map_.
DREAM::Threadfind_thread (const std::string &name) throw (DREAM::Exception)
 Looks up a temporarily stored node in thread_map_.
void process_node (xmlTextReaderPtr reader) throw (DREAM::Exception)
 Handler for libxml.
void process_task (xmlTextReaderPtr reader) throw (DREAM::Exception)
 Processes an XML <task> node.
void process_channel (xmlTextReaderPtr reader) throw (DREAM::Exception)
 Processes an XML <channel> node.
void process_timer (xmlTextReaderPtr reader) throw (DREAM::Exception)
 Processes an XML <timer> node.
void process_thread (xmlTextReaderPtr reader) throw (DREAM::Exception)
 Processes an XML <thread> node.
void process_timer_to_task (xmlTextReaderPtr reader) throw (DREAM::Exception)
 Processes an XML <timertotask> connection.
void process_task_to_task (xmlTextReaderPtr reader) throw (DREAM::Exception)
 Processes an XML <tasktotask> connection.
void process_task_to_channel (xmlTextReaderPtr reader) throw (DREAM::Exception)
 Processes an XML <tasktochannel> connection.
void process_channel_to_task (xmlTextReaderPtr reader) throw (DREAM::Exception)
 Processes an XML <channeltotask> connection.
void process_task_mapping (xmlTextReaderPtr reader) throw (DREAM::Exception)
 Processes an XML <taskmapping> mapping.
void process_channel_mapping (xmlTextReaderPtr reader) throw (DREAM::Exception)
 Processes an XML <channelmapping> mapping.
void process_timer_mapping (xmlTextReaderPtr reader) throw (DREAM::Exception)
 Processes an XML <timermapping> mapping.
void process_component_mapping (xmlTextReaderPtr reader)
 Processes an XML <componentmapping> mapping.
void process_CPU (xmlTextReaderPtr reader) throw (DREAM::Exception)
 Processes an XML <CPU> node.
void process_thread_mapping (xmlTextReaderPtr reader) throw (DREAM::Exception)
 Processes an XML <threadmapping> mapping.

Private Attributes

DREAM::NODE_MAP node_map_
 Stores DREAM::Node and inherited implementations.
DREAM::THREAD_STR_MAP thread_map_
 Stores DREAM::Thread and inherited implementations.
DREAM::Threadcurrent_thread_
 Pointer to the last Thread used.
DREAM::Schedulercurrent_scheduler_
 Pointer to the last Scheduler used.
DREAM::Systemsystem_ptr_
 Pointer to the system root.


Detailed Description

XML Parser class.

Parses an XML file using libxml.

Definition at line 63 of file XMLParser.h.


Constructor & Destructor Documentation

DREAM::XMLParser::XMLParser (  )  [inline]

Constructor.

Definition at line 67 of file XMLParser.h.

DREAM::XMLParser::~XMLParser (  )  [inline]

Destructor.

Definition at line 70 of file XMLParser.h.


Member Function Documentation

void DREAM::XMLParser::parse ( char *  xmlFile,
DREAM::System system 
) throw (DREAM::Exception)

Starts the parsing of the XML input into the System root.

Definition at line 56 of file XMLParser.cpp.

References DREAM::for_each().

Referenced by main().

void DREAM::XMLParser::set_system ( DREAM::System system_ptr  ) 

Sets the system_ptr_ root pointer for DREAM::System.

Parameters:
system_ptr is the pointer to be set in system_ptr_.

Definition at line 203 of file XMLParser.cpp.

References system_ptr_.

void DREAM::XMLParser::check_mapping (  )  throw (DREAM::Exception) [private]

Verifies whether each timer, task and channel is mapped to threads, and whether each thread is mapped to a CPU.

Definition at line 135 of file XMLParser.cpp.

References node_map_, and thread_map_.

DREAM::Node * DREAM::XMLParser::find_node ( const std::string &  name  )  throw (DREAM::Exception) [private]

Looks up a temporarily stored node in node_map_.

Parameters:
name is the name of the node to be searched for.
Returns:
pointer to the Node.

Definition at line 171 of file XMLParser.cpp.

DREAM::Thread * DREAM::XMLParser::find_thread ( const std::string &  name  )  throw (DREAM::Exception) [private]

Looks up a temporarily stored node in thread_map_.

Parameters:
name is the name of the thread to be searched for.
Returns:
pointer to the Thread.

Definition at line 187 of file XMLParser.cpp.

void DREAM::XMLParser::process_node ( xmlTextReaderPtr  reader  )  throw (DREAM::Exception) [private]

Handler for libxml.

This is the entry point for XML parsing.

Parameters:
reader is a pointer to the xmlTextReader.

Definition at line 208 of file XMLParser.cpp.

void DREAM::XMLParser::process_task ( xmlTextReaderPtr  reader  )  throw (DREAM::Exception) [private]

Processes an XML <task> node.

This function processes a <task> node from the XML input and creates the corresponding DREAM representation.

Parameters:
reader is a pointer to the xmlTextReader.

Definition at line 254 of file XMLParser.cpp.

References DREAM::chartouint().

void DREAM::XMLParser::process_channel ( xmlTextReaderPtr  reader  )  throw (DREAM::Exception) [private]

Processes an XML <channel> node.

This function processes a <channel> node from the XML input and creates the corresponding DREAM representation.

Parameters:
reader is a pointer to the xmlTextReader.

Definition at line 314 of file XMLParser.cpp.

References DREAM::chartouint().

void DREAM::XMLParser::process_timer ( xmlTextReaderPtr  reader  )  throw (DREAM::Exception) [private]

Processes an XML <timer> node.

This function processes a <timer> node from the XML input and creates the corresponding DREAM representation.

Parameters:
reader is a pointer to the xmlTextReader.

Definition at line 362 of file XMLParser.cpp.

References DREAM::chartouint().

void DREAM::XMLParser::process_thread ( xmlTextReaderPtr  reader  )  throw (DREAM::Exception) [private]

Processes an XML <thread> node.

This function processes a <thread> node from the XML input and creates the corresponding DREAM representation.

Parameters:
reader is a pointer to the xmlTextReader.

Definition at line 401 of file XMLParser.cpp.

References DREAM::chartouint().

void DREAM::XMLParser::process_timer_to_task ( xmlTextReaderPtr  reader  )  throw (DREAM::Exception) [private]

Processes an XML <timertotask> connection.

This function processes a <timertotask> connection from the XML input and creates the corresponding connections in the DREAM representation.

Parameters:
reader is a pointer to the xmlTextReader.

Definition at line 462 of file XMLParser.cpp.

void DREAM::XMLParser::process_task_to_task ( xmlTextReaderPtr  reader  )  throw (DREAM::Exception) [private]

Processes an XML <tasktotask> connection.

This function processes a <timertotask> connection from the XML input and creates the corresponding connections in the DREAM representation.

Parameters:
reader is a pointer to the xmlTextReader.

Definition at line 498 of file XMLParser.cpp.

void DREAM::XMLParser::process_task_to_channel ( xmlTextReaderPtr  reader  )  throw (DREAM::Exception) [private]

Processes an XML <tasktochannel> connection.

This function processes a <timertotask> connection from the XML input and creates the corresponding connections in the DREAM representation.

Parameters:
reader is a pointer to the xmlTextReader.

Definition at line 534 of file XMLParser.cpp.

void DREAM::XMLParser::process_channel_to_task ( xmlTextReaderPtr  reader  )  throw (DREAM::Exception) [private]

Processes an XML <channeltotask> connection.

This function processes a <timertotask> connection from the XML input and creates the corresponding connections in the DREAM representation.

Parameters:
reader is a pointer to the xmlTextReader.

Definition at line 570 of file XMLParser.cpp.

void DREAM::XMLParser::process_task_mapping ( xmlTextReaderPtr  reader  )  throw (DREAM::Exception) [private]

Processes an XML <taskmapping> mapping.

This function processes a <taskmapping> mapping from the XML input and creates the corresponding mappings in the DREAM representation.

Parameters:
reader is a pointer to the xmlTextReader.

Definition at line 606 of file XMLParser.cpp.

void DREAM::XMLParser::process_channel_mapping ( xmlTextReaderPtr  reader  )  throw (DREAM::Exception) [private]

Processes an XML <channelmapping> mapping.

This function processes a <channelmapping> mapping from the XML input and creates the corresponding mappings in the DREAM representation.

Parameters:
reader is a pointer to the xmlTextReader.

Definition at line 631 of file XMLParser.cpp.

void DREAM::XMLParser::process_timer_mapping ( xmlTextReaderPtr  reader  )  throw (DREAM::Exception) [private]

Processes an XML <timermapping> mapping.

This function processes a <timermapping> mapping from the XML input and creates the corresponding mappings in the DREAM representation.

Parameters:
reader is a pointer to the xmlTextReader.

Definition at line 656 of file XMLParser.cpp.

void DREAM::XMLParser::process_component_mapping ( xmlTextReaderPtr  reader  )  [private]

Processes an XML <componentmapping> mapping.

This function processes a <componentmapping> mapping from the XML input and creates the corresponding mappings in the DREAM representation.

Parameters:
reader is a pointer to the xmlTextReader.
Todo:
Handling components by the parser.
Todo:
Handling power aware tasks by the parser.

void DREAM::XMLParser::process_CPU ( xmlTextReaderPtr  reader  )  throw (DREAM::Exception) [private]

Processes an XML <CPU> node.

This function processes a <CPU> node from the XML input and creates the corresponding DREAM representation.

Parameters:
reader is a pointer to the xmlTextReader.

Definition at line 681 of file XMLParser.cpp.

References DREAM::chartouint().

void DREAM::XMLParser::process_thread_mapping ( xmlTextReaderPtr  reader  )  throw (DREAM::Exception) [private]

Processes an XML <threadmapping> mapping.

This function processes a <threadmapping> mapping from the XML input and creates the corresponding mappings in the DREAM representation.

Parameters:
reader is a pointer to the xmlTextReader.

Definition at line 746 of file XMLParser.cpp.


Member Data Documentation

DREAM::NODE_MAP DREAM::XMLParser::node_map_ [private]

Stores DREAM::Node and inherited implementations.

Connections between elements are built using this list.

Definition at line 210 of file XMLParser.h.

Referenced by check_mapping().

DREAM::THREAD_STR_MAP DREAM::XMLParser::thread_map_ [private]

Stores DREAM::Thread and inherited implementations.

Connections between elements are built using this list.

Definition at line 215 of file XMLParser.h.

Referenced by check_mapping().

DREAM::Thread* DREAM::XMLParser::current_thread_ [private]

Pointer to the last Thread used.

Definition at line 218 of file XMLParser.h.

DREAM::Scheduler* DREAM::XMLParser::current_scheduler_ [private]

Pointer to the last Scheduler used.

Definition at line 221 of file XMLParser.h.

DREAM::System* DREAM::XMLParser::system_ptr_ [private]

Pointer to the system root.

Definition at line 224 of file XMLParser.h.

Referenced by set_system().


The documentation for this class was generated from the following files:
Generated on Fri Jul 27 18:30:04 2007 for DREAM by  doxygen 1.5.1