SST  13.0.0
StructuralSimulationToolkit
SST::SSTElementPythonModuleCode Class Reference

Class to represent the code that needs to be added to create the python module struture for the library. More...

#include <element_python.h>

Public Member Functions

SSTElementPythonModuleCodeaddSubModule (const std::string &module_name, char *code, const std::string &filename)
 Add a submodule to the module. More...
 
SSTElementPythonModuleCodeaddSubModule (const std::string &module_name)
 Add an empty submodule to the module. More...
 
std::string getFullModuleName ()
 Get the full name of the module. More...
 

Friends

class SSTElementPythonModule
 

Detailed Description

Class to represent the code that needs to be added to create the python module struture for the library.

Member Function Documentation

◆ addSubModule() [1/2]

SSTElementPythonModuleCode * SST::SSTElementPythonModuleCode::addSubModule ( const std::string &  module_name,
char *  code,
const std::string &  filename 
)

Add a submodule to the module.

Python files will need to be turned into a char array (code parameter). One way to do this is to use the following in your Makefile:

%.inc: %.py
///         od -v -t x1 < $< | sed -e 's/^[^ ]*[ ]*//g' -e '/^\s*$$/d' -e 's/\([0-9a-f]*\)[ $$]*/0x\1,/g' > $@
///         
Parameters
module_namesimple name of the module
codecode to be compiled
filenamefilname used when reporting errors

◆ addSubModule() [2/2]

SSTElementPythonModuleCode * SST::SSTElementPythonModuleCode::addSubModule ( const std::string &  module_name)

Add an empty submodule to the module.

Parameters
module_namesimple name of the module

◆ getFullModuleName()

std::string SST::SSTElementPythonModuleCode::getFullModuleName ( )

Get the full name of the module.

Get the full name of the module formatted as parent_full_name.module_name.

Returns
full name of module as a string

References getFullModuleName().

Referenced by getFullModuleName().


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