GraphTool  1.0
Tool for analyzing and graphically visualizing code dependencies for Ericsson.
 All Classes Namespaces Functions Variables Typedefs Enumerations Pages
Public Member Functions | List of all members
Linkler Class Reference

#include <linkler.h>

Public Member Functions

 Linkler ()
 
 Linkler (std::string f)
 
 Linkler (Linkler &l)
 
 ~Linkler ()
 
SWUadd_swu (std::string s_name)
 
Moduleadd_module (std::string m_name, std::string type)
 
Executableadd_executable (std::string e_name, int esp_id)
 
Moduleadd_file_to_module (std::string m_name, std::string f_name)
 
bool add_dependency (std::string a_module, std::string b_module, bool b_mod_type)
 
Moduleadd_external_dependent (std::string m_name)
 
Moduleremove_file_from_module (std::string m_name, std::string f_name)
 
bool assoc_module_swu (std::string m_name, std::string s_name)
 
bool assoc_module_executable (std::string m_name, std::string e_name)
 
SWUfind_swu (std::string s_name)
 
Modulefind_module (std::string module_name)
 
Executablefind_executable (std::string exec_name)
 
void add_swus_to_executables ()
 
void assoc_swu_to_exec (Executable *e)
 
SWUSet * get_full_swuset (std::string e_name)
 
std::string file_path ()
 
unsigned int num_modules ()
 
SWUSet * swus ()
 Accessor for the set of swu pointers.
 
ModuleSet * modules ()
 Accessor for the set of module pointers.
 
ExecutableSet * executables ()
 Accessor for the set of executable pointers.
 
void print_swu_dependency_types ()
 Prints all swu dependency types to stdout (can be called from the XML Parser to make sure that all dependency types are correct)
 
void print_module_dependency_types ()
 Prints all module dependency types to stdout (can be called from the XML Parser to make sure that all dependency types are correct)
 

Detailed Description

Linkler is a singleton class that is used to coordinate the loading of the XML input file. This is used to pass around the list of SWUS, Modules and Executables used, it can be used to add external dependencies. This class also handles the dependencies between modules and between swus as well as the connection between swus and executables (not an direct dependency).

Constructor & Destructor Documentation

Linkler::Linkler ( )

Constructor, takes no parameters

Linkler::Linkler ( std::string  f)

Constructor which takes filepath to the xml-file loaded

Linkler::Linkler ( Linkler l)

Copy constructor, performs a deep copy on the associated linkler structure

Linkler::~Linkler ( )

Destructor, clears the contained sets

Member Function Documentation

bool Linkler::add_dependency ( std::string  a_module,
std::string  b_module,
bool  b_mod_type 
)

Adds a dependency between given module names as well as their corresponding swus

Parameters
a_modulename of the refFrom module
b_modulename of the refTo module
b_mod_typetype of the dependency, absolute/relative
Returns
true if both dependencies were inserted, false otherwise
Executable * Linkler::add_executable ( std::string  e_name,
int  esp_id 
)

Adds an executable to this linkler

Parameters
e_namename of the executable to be added
esp_idthe esp-id number of the executable
Returns
pointer to added executable
Module * Linkler::add_external_dependent ( std::string  m_name)

Adds a external dependency to given module (dependency that has no refFrom tag in the XML file)

Returns
pointer to the updated module object
Module * Linkler::add_file_to_module ( std::string  m_name,
std::string  f_name 
)

Adds a file to a module

Parameters
m_namename of module to recieve file
f_namename of file to be added
Returns
pointer to module the file was added to
Module * Linkler::add_module ( std::string  m_name,
std::string  type 
)

Adds a module to this linkler

Parameters
m_namename of the module to be added
typememoryType of the module
Returns
pointer to added module
SWU * Linkler::add_swu ( std::string  s_name)

Adds a swu to this linkler

Parameters
s_namename of the swu to be added
Returns
pointer to added swu
void Linkler::add_swus_to_executables ( )

Adds corresponding swus to their respective executables with information from modules. Should ONLY be called after adding all modules and swus.

bool Linkler::assoc_module_executable ( std::string  m_name,
std::string  e_name 
)

Associates the given module with the given Executable.

Parameters
m_namemodule to be updated
e_nameExecutable to associate module with
Returns
true if association succeeded, otherwise false
bool Linkler::assoc_module_swu ( std::string  m_name,
std::string  s_name 
)

Associates the given module with the given SWU.

Parameters
m_namemodule to be updated
s_nameSWU to associate module with
Returns
true if association succeeded, otherwise false
void Linkler::assoc_swu_to_exec ( Executable e)

Helper function for add_swus_to_executables

Parameters
eexecutable that will recieve swus
std::string Linkler::file_path ( )

Accessor method for the file path associated with this linkler.

Returns
string representation of the file path to the file which this linkler originates from.
Executable * Linkler::find_executable ( std::string  exec_name)

Find Executable by name, returns null if not found.

Parameters
exec_namename of Executable to be found
Returns
pointer to Executable object
Module * Linkler::find_module ( std::string  module_name)

Find Module by name, returns null if not found.

Parameters
module_namename of Module to be found
Returns
pointer to Module object
SWU * Linkler::find_swu ( std::string  s_name)

Find SWU by name, returns null if not found.

Parameters
s_namename of SWU to be found
Returns
pointer to SWU object
SWUSet * Linkler::get_full_swuset ( std::string  e_name)

Will return a swuset that will include all swus with any modules in the given executable.

Parameters
@returnpointer to full swuset of given executable
unsigned int Linkler::num_modules ( )

Returns the number of modules (pointers) in the module set

Returns
unsigned int number of pointers to modules in set modules_
Module * Linkler::remove_file_from_module ( std::string  m_name,
std::string  f_name 
)

Removes a file with the given name from a module with the given name

Parameters
m_namename of module to remove file from
f_namename of file to remove
Returns
pointer to updated module object

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