Configurator
Public Member Functions | List of all members
data_structures.Module Class Reference

One Module device. More...

Inheritance diagram for data_structures.Module:
data_structures.Node

Public Member Functions

def __init__
 Module constructor.
 
def __format__
 Return formatted version of self using fmt for format control.
 
def cpp_header_write
 Write C++ header file for self out to file_name.
 
def cpp_local_header_write
 Write a local C++ header file for self to file_name
 
def cpp_local_source_write
 Write local C++ code for self into file_name
 
def cpp_remote_header_write
 Write a C++ header for remote access to self out to file-name
 
def cpp_remote_source_write
 Write C++ source file for RPC access to self to *file_name.
 
def cpp_slave_write
 Write "slave" C++ to support RPC's for self out to file_name.
 
def fences_read
 Read in the fenced code for file_name into a table of self
 
def fence_write
 Write fenced code for fence_name from self to out_stream
 
def python_write
 Write out Python RPC access code for self to file_name
 
- Public Member Functions inherited from data_structures.Node
def __init__
 Node Constructor
 
def parent_index_find
 Recursively find parent of self starting from root_node.
 
def show
 Method print self indented by indent.
 
def sub_node_append
 Append sub_node to the children sub nodes of self.
 
def xml_write
 Method writes self to out_stream indented by indent.
 

Detailed Description

One Module device.

A Module corresponds to an electronic device that can be plugged together. The overall structure of a Module corresponds to an <Module ...> tag in an XML file:

   <Module Name="..." Vendor="..." Brief="...">
     <Overview>
       Module overview text goes here.
     </Overview>
     <Classification /> ...
     <Register /> ...
     <Function /> ...
   </Module> 

Constructor & Destructor Documentation

def data_structures.Module.__init__ (   self,
  module_element,
  style 
)

Module constructor.

Parameters
selfModule to initialize
module_elementET.Element to initialize from
styleStyle object that specifies how to format generate code.

This method will initialize the contents of self by read the associated XML infromation from *module_element.

Member Function Documentation

def data_structures.Module.__format__ (   self,
  fmt 
)

Return formatted version of self using fmt for format control.

Parameters
selfModule to format
fmtA str that controls formatting
Returns
str formatted result string

This mehod will return a formated version of self using fmt to control the formatting. fmt must be one of:

  • 'n' returns the module name.
def data_structures.Module.cpp_header_write (   self,
  file_name,
  with_fences 
)

Write C++ header file for self out to file_name.

Parameters
selfModule to generate C++ for
file_namestr File name to open and write C++ into
with_fencesbool if True, causes fences to be written as well

This method will write out a C++ header file that contains declarations for all the functions and registers associated with module.

def data_structures.Module.cpp_local_header_write (   self,
  file_name 
)

Write a local C++ header file for self to file_name

Parameters
selfModule to write C++ header for
file_namestr File name to open and write C++ into

This method will write a local C++ header file for self into the file name file_name. If file_name does not exist, it will be created. If file_name does exist, it is replaced such that all the code in the fenced off area inside the source code is retained.

def data_structures.Module.cpp_local_source_write (   self,
  file_name 
)

Write local C++ code for self into file_name

Parameters
selfModule to geneate C++ code for
file_namefile_name file name to open and pour C++ code into

This method will write out local C++ code for self into file_name. This basically consists of of some include files, a class constructor for self, and each of the register and function methods.

def data_structures.Module.cpp_remote_header_write (   self,
  file_name 
)

Write a C++ header for remote access to self out to file-name

Parameters
selfModule to write C++ header information for.
file_name
def data_structures.Module.cpp_remote_source_write (   self,
  file_name 
)

Write C++ source file for RPC access to self to *file_name.

Parameters
selfModule to write C++ source code for
file_namestr Name of file to write C++ code to

This routine will write out a C++ source file that contains access methods to use RPC to access remote functions and registers on the remote module self. The code is written out to the file name file_name.

def data_structures.Module.cpp_slave_write (   self,
  file_name 
)

Write "slave" C++ to support RPC's for self out to file_name.

Parameters
selfModule for write C++ code for
file_namestr Name of file to write C++ code to

This method will write out a C++ framework to support remote procedure calls for self. This frame work will have places where user supplied code is provided (called a fence.) The code is written out to file_name.

def data_structures.Module.fence_write (   self,
  fence_name,
  out_stream 
)

Write fenced code for fence_name from self to out_stream

Parameters
selfModule object that contains fenced code table
fence_namestr Name of fence to write out
out_streamFile file output stream that is open for writing

A this method will write out the fenced code for fence_name out to out_stream using the fences table in self. A fence is user supplied code that is spliced into a file of computer generated code. A fence looks as follows:

     //////// Edit begins here: {FENCE_NAME}
     ...
     //////// Edit ends here: {FENCE_NAME}

where "..." is zero, one or more lines of user supplied code. This code is read from *file_name prior to overwriting the file with newly generated code.

def data_structures.Module.fences_read (   self,
  file_name 
)

Read in the fenced code for file_name into a table of self

Parameters
selfModule that contains the fences table
file_namestr file name of the file to be read

A this method will read in all of the fenced code for the file named file_name into a fences table for self. A fence is user supplied code that is spliced into a file of computer generated code. A fence looks as follows:

     //////// Edit begins here: {FENCE_NAME}
     ...
     //////// Edit ends here: {FENCE_NAME}

where "..." is zero, one or more lines of user supplied code. This code reads in the "..." for each fence and hangs onto it for subsequent out during code generation.

def data_structures.Module.python_write (   self,
  file_name 
)

Write out Python RPC access code for self to file_name

Parameters
selfModule to write Python code for
file_namestr file name to write Python code into

This method will write out Python access code for self out to the file named file_name.


The documentation for this class was generated from the following file: